‎2014 Dec 16 11:31 AM
I am trying to insert table entries in a transport request thorugh program.
Program Id :R3TR
Object Id :TABU
I have tried FM : TR_REQUEST_CHOICE, but it is raising exception no 4.
NO_OBJECTS_APPENDED = 4
Code Snippet:LL FUNCTION '
CALL FUNCTION 'TR_REQUEST_CHOICE'
EXPORTING
IV_SUPPRESS_DIALOG = 'X'
IV_REQUEST_TYPES = 'K'
* IV_CLI_DEP = ' '
IV_REQUEST = gs_request_header-TRKORR
IT_E071 = gt_e071
IT_E071K = gt_e071k
* IV_LOCK_OBJECTS = ' '
* IV_TITLE =
* IV_START_COLUMN = 3
* IV_START_ROW = 7
IV_WITH_ERROR_LOG = 'X'
* IV_NO_OWNER_CHECK = ' '
* IV_FOREIGN_REQUEST = ' '
* IT_E071K_STR =
* IT_OBJ_ENTRIES =
IMPORTING
ES_REQUEST = gs_request
EXCEPTIONS
INVALID_REQUEST = 1
INVALID_REQUEST_TYPE = 2
USER_NOT_OWNER = 3
NO_OBJECTS_APPENDED = 4
ENQUEUE_ERROR = 5
CANCELLED_BY_USER = 6
RECURSIVE_CALL = 7
OTHERS = 8.
debugger snapshot:
Now, i am trying to achieve same using FM TR_EDIT_CHECK_OBJECTS_KEYS.
It is also raising exception CANCEL_EDIT_SYSTEM_ERROR
Message:
No key fields are defined for table ZTABL_PROCESSHDR.
Please guide me how to rectify this.
‎2014 Dec 16 11:07 PM
There appears to be a problem with your Z table ZTABL_PROCESSHDR.
Check that first.
cheers
Paul
‎2014 Dec 17 6:14 AM
This is not the case however, i have used table VBAK instead of Ztable.
The error msg remains same and so does exception raised.
‎2014 Dec 17 7:21 AM
Check this wiki:
Transporting Table Entries in ABAP programmatically - ABAP Development - SCN Wiki
If you are filling E071 and E071K right way. Do you have table keys in E071K? Do you have e071-objfunc = 'K' etc...
‎2014 Dec 17 7:32 AM
‎2014 Dec 17 9:18 AM
i am now trying to insert table entries of VBAK to understand where i am mistaken.
Code snippet:
REFRESH:gt_e071,gt_e071k.
MOVE 1 TO LV_COUNT.
gs_e071k-TRKORR = gs_request_header-TRKORR.
gs_e071k-PGMID = 'R3TR'.
gs_e071k-OBJECT = 'TABU'.
gs_e071k-OBJNAME = 'VBAK'.
gs_e071k-AS4POS = lv_count.
gs_e071k-MASTERTYPE = 'TABU'.
gs_e071k-MASTERNAME = 'VBAK'.
CLEAR lv_key.
CONCATENATE sy-mandt '0000004969' INTO lv_key."client and sale order no
gs_e071k-TABKEY = lv_key.
APPEND gs_e071k to gt_e071k .
CLEAR gs_e071k .
gs_e071-TRKORR = gs_request_header-TRKORR.
gs_e071-AS4POS = lv_count.
gs_e071-PGMID = 'R3TR'.
gs_e071-OBJECT = 'TABU'.
gs_e071-OBJ_NAME = 'VBAK'.
gs_e071-OBJFUNC = 'K'.
APPEND gs_e071 to gt_e071.
CLEAR gs_e071 .
This is the screen shot of debugger (internal table gt_e071k), Line 1.
Field tabkey container 800(client) ,0000004969 sale order no in concatenation.,.
Is something wrong in this key?
‎2014 Dec 17 9:55 AM
okay..above one error is fixed.
Now i am trying to add Ztable entries, which has only 1 key field that too of data type char 20.
while populating e071k with char values, it says use only numeric values.