‎2014 Nov 27 1:44 PM
Hi guys,
I need to create a TR when modifying a custom table by abap code.
The changed data should attached to the created TR.
Ex - Modify (Ztable) By (work area)
Thanks and Regards,
Chinthaka
‎2014 Nov 27 1:47 PM
Hi Chinthaka,
Please clarify your requirement in detail?
Regards,
Sudeesh Soni
‎2014 Nov 27 1:47 PM
Hi Chinthaka,
Please clarify your requirement in detail?
Regards,
Sudeesh Soni
‎2014 Nov 27 1:54 PM
Hi,
Hopefully you can find the solution on the link below.
Transporting Table Entries in ABAP programmatically - ABAP Development - SCN Wiki
Kind Regards
Bert
‎2014 Dec 01 10:31 AM
Hi Bert,
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.
‎2014 Nov 27 1:55 PM
Hi,
you have to write BDC for the Customizing table using SM30.
‎2014 Dec 01 5:07 AM
Hi Vijay,
Can you please explain more about this.
Thanks,
Chinthaka
‎2014 Dec 01 5:32 AM
HI,
Record the BDC for customizing table....while passing the customizing TR ,
use the BAPI " BAPI_CTREQUEST_CREATE". You will get the TR number in the importing parameter
in requestid, pass this to the BDC field where tr number is shown.
Regards,
Vijay.