To update description of structure/model node of a record

[] [] [] [] [] [] [] [] []

  1. Node Level filter rule does not filter child node instancesSymptom 1. In case of Node level filter rules, child records are not filtered based on the device subscriptions.2. Duplicate messages are sent to the device in case of custom channel assigned...
  2. Successful creation of record has entry in application logSymptom On the successful creation of a new record or record model, error entries are written in the application log. Error message says ['Document damaged: Contains no versions']. Other terms slg1, record,...

Symptom

Suppose user has created records based on a record model which is in German Language. Now the user has traslated the nodes of a record model into different language(say english) but structure and model nodes of old records still appears in German language.
Other terms

Record, Record Model, Structure Node, Model Node, Language
Reason and Prerequisites

There was no Function Module or Report Program which could be used to update the description of structure and model node of a record based on record model.
Note : Function Module “srm_rec_update_node_desc” will not update the Record’s instance node description.
Solution

We have created a new Function Module(FM) to resolve the issue and the newly created FM “srm_rec_update_node_desc” will update the Structure and Model Node description of records that are based on a record model.
This FM will update the nodes of the record, only if they have not been previously renamed from frontend.
Also this FM only updates the node descriptions of the record and it is not the same as renaming the nodes through frontend/GUI. That means we can run call this FM multiple times to update the same node descriptions of a record successfully.
This FM could be used to update records only in Records Management area. So a new optional importing parameter has been added to the function module – SPS ID to fetch the records from other areas also like the Case records.
This importing parameter has to be added manually to the FM.
For this-
1> Goto transaction – SE37 and access the FM – SRM_REC_UPDATE_NODE_DESC
PARAMETER NAME
2> Click on the Import tab and enter the the new optional parameter under the specific columns
PARAMETERNAME TYPING ASSOCIATEDTYPE DEFAULTVALUE OPTIONAL
SPSID TYPE STRING Yes(tick mark)
PASSVALUE SHORTDESCRIPTION
Framework area Service Provider ID
3> Save and activate the FM.
The SPSID is optional parameter and if no value is entered for this then by default the Records area SPSID – SRM_RMS_CLIENTFRAME_WIN is taken.
The below is the sample report program which calls our function module “srm_rec_update_node_desc” to update the description of a structure or model node of a record.
User need to log on to the system with the corresponding log on language and need to run the report program with the required input or the above function module directly to update the node description.
Input required to the report program:
1. POID Directory ID of Record Model – Right click on the record model in the history and select #Information# option. Then select #Technical Information# tab. At the end is the POID Directory ID.
2. SPS ID (framework area Service Provider ID) – In the RM registry choose Application Registry and then the framework area (S_AREA_FRAMEWORK). Here select the client framework of the required area and then the corresponding SPS ID. For example SRM_RMS_CLIENTFRAME_WIN or SRM_CMG_CLIENTFRAME_WIN.
3. Node id and Node description of Record.

Based on the Record Model POID Directory ID(user input), the function module will fetch all the records that were created based on this record model and updates the node description of each record.
************** Start of Report Program ******************************
data : node_desc_wa type SRMGSPROP,
opened_rec type SRT_LP_VALUES,
opened_rec_wa like line of opened_rec,
NODEID_DESC type SRMGSPROPT,
inv_ID type SRMGSPROPT,
inv_ID_wa like line of inv_ID,
nodeId type string,
recordId type string.
Node_desc_wa-name = ‘2′. “Node ID
Node_desc_wa-value = ‘FIRST_DESCR’. “Node Description
append Node_desc_wa TO Nodeid_desc.
*** Please repeat the above 3 lines of code, if you wants to change the
*** description of morethan one node.
CALL FUNCTION ‘SRM_REC_UPDATE_NODE_DESC’
EXPORTING
POIDDIRID = ‘7DD29B4451245457E10000000A424010′ “POID “Directory of a Record Model
SPS ID = ‘SRM_CMG_CLIENTFRAME_WIN’ “Framework area “Service Provider ID
NODEID_DESC = NODEID_DESC “Node ID and Description
IMPORTING
opened_recordid = opened_rec “List of already opened records
INVALID_ID = inv_id “List of Invalid Node id’s of a Record
EXCEPTIONS
INVALID_POIDDIRID = 1
NO_REC_PRESENT = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
case sy-subrc.
when 0.
when 1. write ‘INVALID POID DIRECTORY ID. PLEASE CHECK IT’.
when 2. write ‘No Records are created based on this Record Model. Please check’.
when others.
endcase.
ENDIF.
*List of Records that are opened in other sessions.
loop at opened_rec into opened_rec_wa.
write : / ‘Record : ‘,opened_rec_wa, ‘ is opened. Please Close’.
endloop.
write /.
*Invalid Nodes of a Each Record
loop at inv_id into inv_id_wa.
nodeId = inv_id_wa-name.
recordid = inv_id_wa-value.
write : / ‘Node Id : ‘, nodeId ,
‘ is invalid for record : ‘,recordId,’. Please Check it.’.
endloop.
************** End of Report Program ******************************

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Leave a Comment