SAP ABAP: Converting unique identifier in data dictionary objects
With basic knowledge on data dictionary objects, it is clear that all the records in the database are stored with a unique identifier. And this unique identifier can be of any form. However, one of the challenges is to deal with the unique key which is stored in the form of RAW16.
The unique identifier for the records in CRM module and in Audit Management Application of Quality Module is in RAW16 format. However the way we display the record name on the screen is with the External Identifier which exists for each unique identifier.
Code provided below demonstrates how to get the Character format of the unique identifier which is stored in RAW format.
This will be helpful for the objects which use tables like CGPL_PROJECT, CGPL_TASK etc, (which are used in CRM modules and also in Audit Management Application of Quality Module as mentioned above).
To convert the GUID (RAW16) into Char24:
DATA: V_GUID TYPE PLMT_QUEST_RES_UI,
V_EXTERNAL_ID TYPE CGPL_EXTID.
Pass the value of GUID (RAW16) for which we need to convert into Character Format into the variable V_GUID-GUID.
CALL METHOD CL_PLM_AUDIT_CONVERT_SERVICES=>CONVERSION_OUTPUT
EXPORTING
IV_INPUT = V_GUID-GUID
RECEIVING
RV_OUTPUT = V_EXTERNAL_ID.
This method internally uses the function module CONVERSION_EXIT_CGPLP_OUTPUT for the conversion purpose.
Here is the process to call a method inside our object (report, function module etc,):
- Click the Button “Pattern” or Ctrl+F6 present on the toolbar.
- Select the radio button “ABAP Object patterns” and click Ok button.
- Enter the class name in Class/Interface field (Enter CL_PLM_AUDIT_CONVERT_SERVICES).
- Enter instance variable also incase of calling an Instance method. (As CONVERSION_OUTPUT is a static method no need of instance in this case)
Press F4 in method field which will list the methods that are available for the class (Select CONVERSION_OUTPUT) and click ‘Yes’.




Leave a comment!