Technical Articles
Function module to capture entries into a transport request
Introduction:
As a developer, you would have come across the requirement of manually capturing the objects into the Transport request and transport them to different systems.
There are many ways to perform this action. One of the way is to use the standard FM’s.
The Standard Function Module, CTS_WBO_API_INSERT_OBJECTS can be used to add the entries of a table to a customizing Transport request.
Pre-requisite : Please create an Transport request and follow the below steps.
Example: I have a TR: TRxxxxxx , and I want to add an entry of Zxy table to it so that it can be transported. Follow the steps below.
Step 1: Data declaration should be done to outline the Structure.
DATA: lt_e071k TYPE TABLE OF e071k,
ls_e071k TYPE e071k,
lt_ko200 TYPE TABLE OF ko200.
Ko200 is an Interface Structures for Objects in CTS.
E071k is a Transparent table which contains Key entries of requests/tasks.
Step 2: Fill the tables with the objects which needs to lock into TR. For Interface Structure, the following details needs to be filled.
- TR number has to be provided.
- Program ID (Pg ID) should be given.
The Possible values for Pg ID are shown below.
- Object Should be given.
The Possible values for Object are shown below based on PgID.
- Object name should be given.
Object name can be view name, table name, Report name etc.
- Object function should be given to specify the Key.
See the code below for example.
ls_ko200-trkorr = TRxxxxxx
ls_ko200-pgmid = ‘R3TR’.
ls_ko200-object = ‘XXXX’. “VXXX, TXXX ( Table/ View name ),
ls_ko200-obj_name = ‘XXXX’. ”V_XXX, TXXX
ls_ko200-objfunc = ‘K’.
- For Transparent table, where the Keys has to be maintained.
- TR number is not obligatory.
- Program ID (Pg ID) should be given.
- Object Should be given.
- Object name should be given. ( Object name can be table name or view name and etc )
- Mastertype should be provided. This is the object passed to Interface structure.
- Mastername Should be provided.This is the object name passed to Interface structure.
- Tabkey should be provided. This is applicable for the Table entrie, where the Tabkey should include all key values including the sy-mandt.
- See the code below for our example.
ls_e071k-trkorr = ‘ ‘.
ls_e071k-pgmid = ‘R3TR’.
ls_e071k-object = ‘TABU’. ” For tables, TABU is the object name
ls_e071k-objname = ‘XXXX’. “ Table name
ls_e071k-mastertype = ‘XXXX’. “Object passed to ls_ko200
ls_e071k-mastername = xxxx. “Objectname passed to ls_ko200
ls_e071k-tabkey = |{ sy-mandt }{ xx }|.
Step 3: Once the objects are filled into Interface structure and TAB key table,
Call the FM ‘CTS_WBO_API_INSERT_OBJECTS’ to perform the action.
CALL FUNCTION ‘CTS_WBO_API_INSERT_OBJECTS’
EXPORTING
trkorr = lv_tr
IMPORTING
result = lv_result
messages = lt_messages
CHANGING
ct_ko200 = lt_ko200
ct_e071k = lt_e071k.
IF lv_result = ‘S’.
“ Objects are captured in Transport
Endif.
Step 4: Go to SE09 transaction and check for the TR for the object locked manually.
Conclusion.
By following the above steps , any tables entries can be captured into the TR .
NOTE: The TR can also be transported from system to other systems without any issues.
Thanks for sharing the same
Tried the above approach and it was giving dump due to missing mandatory parameter call ...
to FM CTS_WBO_API_INSERT_OBJECTS, mandatory parameter recording_entries must be populated of type CTS_RECORDING_ENTRIES. (data: lt_Rec type CTS_RECORDING_ENTRIES. )
By passing only initial lt_rec does the trick for handling table/view related.
Also code requires minor correction
ls_ko200-object = ‘XXXX’. “VXXX, TXXX ( Table/ View name ), -- Not working
it should be
ls_ko200-object = 'TABU’. ” For tables, TABU is the object name
--Thanks for quick solution to add table entry via abap program helps a lot in various automation programs.