‎2014 Dec 01 10:43 AM
Hi,
I used the way in the above link using the FM TR_REQUEST_CHOICE.
TR can be created but FM return exception 4 (Objects are not attached.)
Can you please help on this.
this is my code
DATA: lt_zxa_header TYPE TABLE OF zxa_header,
ls_zxa_header TYPE zxa_header.
DATA: l_request TYPE trkorr VALUE 'IDSK901097',
lt_e071 TYPE tr_objects,
lt_e071k TYPE tr_keys,
lv_position TYPE ddposition,
lv_tabkey TYPE trobj_name,
ls_e071 TYPE e071,
ls_e071k TYPE e071k.
CLEAR lt_zxa_header[].
SELECT *
FROM zxa_header
INTO TABLE lt_zxa_header.
ls_e071-trkorr = l_request.
ls_e071-as4pos = 1.
ls_e071-pgmid = 'R3TR'.
ls_e071-object = 'TABU'.
ls_e071-obj_name = 'ZXA_HEADER'.
ls_e071-objfunc = 'K'.
ls_e071-lang = sy-langu.
APPEND ls_e071 TO lt_e071.
CLEAR ls_e071.
CLEAR lv_position.
* add all table entries in table zxa_header that need to be transported to lt_e071k
LOOP AT lt_zxa_header INTO ls_zxa_header.
lv_position = lv_position + 1.
lv_tabkey = ls_zxa_header-id.
ls_e071k-trkorr = l_request.
ls_e071k-pgmid = 'R3TR'.
ls_e071k-object = 'TABU'.
ls_e071k-objname = 'ZXA_HEADER'.
ls_e071k-as4pos = lv_position.
ls_e071k-mastertype = 'TABU'.
ls_e071k-mastername = 'ZXA_HEADER'.
ls_e071k-lang = sy-langu.
ls_e071k-tabkey = lv_tabkey.
APPEND ls_e071k TO lt_e071k.
CLEAR ls_e071k.
ENDLOOP.
break att_develop2.
*To add entries to the transport request we call the following function module
CALL FUNCTION 'TR_REQUEST_CHOICE'
EXPORTING
iv_suppress_dialog = 'X'
iv_request = l_request
it_e071 = lt_e071
it_e071k = lt_e071k
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.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks and Regards,
Chinthaka
‎2014 Dec 01 10:57 AM
‎2014 Dec 01 10:57 AM
‎2014 Dec 01 11:20 AM
Thanks Rawat,
Can you please provide me an example of this FM.
(What i want is to attach Z table data to the TR)
‎2014 Dec 01 11:26 AM
Fill the table ct_k0200 in changing parameter with the objects.
‎2014 Dec 01 11:18 AM
Hi,
try these
TR_INSERT_REQUEST_WITH_TASKS, create new request.
TR_REQUEST_CHOICE, fill with objects (with or without user dialogue)
and
for more search check this Function Groups
STR*
Thanks.
‎2014 Dec 03 1:23 PM