If you want to generate a random string in ABAP, you can use the following FM where you can specify the length of the generated random string: CRR_GET_RANDOM_STRING
If you want a random and unique string, then you need to use the UUID generation class cl_system_uuid which can be accessed in either instance or static form. See the API for the UUID generation document attached to SAP Note 935047 – Creating and using GUIDs (UUIDs) or click on the download below.
Download – UsingTheUUIDABAPInterface2.pdf – 30.0 KB – 961 downloads
Download – SAPNote0000935047_CreateUseUUIDs.pdf – 38.1 KB – 892 downloads
To monitor performance of the execution of planning functions and sequences in SAP Integrated Planning application, we needed to setup a mechanism to log generic messages with timestamps.
I created a Planning Function based on a ‘dummy’ Aggregation Level / Real Time Infoprovider that only processes 1 record and does nothing apart from logging a message in the SAP Application Log. This function can then be called within existing sequences to log execution duration of the complete sequence or of individual steps.
Creation of Objects and Cubes
- Info Object Char IIP_MSG / CHAR 3 / With MD (no attributes) + Text Short => Maintain at value ‘001’ in Master Data
- Need one KF (ex 0QUANTITY)
- Create Real Time Infocube IIP_LOG=> 1 dimension with Char IIP_MSG, 1 key figure (ex ICOUNT)
Creation of Planning Function Type and logging entries (SLG0)
- Create a Class for logging named Z_IP_LOG_TS by copying the example Planning Function Type class CL_RSPLFA_SRVTYPE_IMP.
- Edit method IF_RSPLFA_SRVTYPE_IMP_EXEC->INIT_EXECUTION
" Enter a Log in SLG1 for Object ZIIP, SubObject ZIIP
" The log message contains the TS + Calling PF name
log_handle TYPE balloghndl,
t_log_handle type BAL_T_LOGH,
log TYPE bal_s_log,
log_msg TYPE bal_s_msg.
log-extnumber = 'Infrabel IP Logging'.
log-object = 'ZIIP'.
log-subobject = 'ZIIP'.
log-aldate = sy-datum.
log-altime = sy-uzeit.
log-aluser = sy-uname.
log-alprog = sy-repid.
CALL FUNCTION 'BAL_LOG_CREATE'
i_s_log = log
e_log_handle = log_handle
OTHERS = 1.
log_msg-msgty = 'I'.
log_msg-msgid = 'ZIIP'.
log_msg-msgno = '000'.
log_msg-msgv1 = sy-msgv1. " set to Planning Function
log_msg-msgv2 = sy-msgv2. " set to value of filter
log_msg-msgv3 = sy-msgv3. " set to planning sequence if any
log_msg-msgv4 = sy-msgv4. " planning function step
CALL FUNCTION 'BAL_LOG_MSG_ADD'
i_log_handle = log_handle
i_s_msg = log_msg
log_not_found = 1
msg_inconsistent = 2
log_is_full = 3
OTHERS = 4.
append log_handle to t_log_handle.
CALL FUNCTION 'BAL_DB_SAVE'
I_T_LOG_HANDLE = t_log_handle.
- Create in RSPLF1 the Planning Function Type Z_IP_LOG_TS pointing to class Z_IP_LOG_TS / Without Blocks / Hide columns to be changed
- Create the Object ZIIP and Subobject ZIIP on SLG0
Creation of Aggregation Level, Filter and Planning Function
- Create Aggregation Level AG_LOG_01on IIP_LOG => Chars = IIP_MSG , KF = ICOUNT
- Use transaction RSINPUT to create 1 record in Real Time Infocube IIP_LOG
- Create a filter FL_LOG_01 on AG_LOG_01 => Set Char Selection on IIP_MSG = ‘001’
- Create a Planning Function of type Z_IP_LOG_TS on Aggregation Level AG_LOG_01
Using Logging in Planning Sequence
You can insert in your planning sequences a step on Aggregation Level AG_LOG_01, Filter FL_LOG_01 and Planning Function Z_IP_LOG_TS. When the step is called, a message is created in the Application Log (transaction SLG1).
One way to get the complete list of Transportable Object types is to use FM TRINT_OBJECT_TABLE (set IV_COMPLETE to ‘X’). In my system I get 785 different object types!
The R3TR entries are also available in table OBJT by selecting a language and objectype = ‘L’
Table OBJH contains more detailed info about each tyme (ex: customizing or workbench)