Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to include XPRA into transport request by code?

Former Member
0 Kudos

Hey experts,

is there some FM with which I can include a XPRA into transport request by code?


I usually use the following FM to include objects into TR, but it does not work for XPRA.


CALL FUNCTION 'RS_TOOL_ACCESS'

     EXPORTING

       operation           = 'TRANSPORT'

     TABLES

       objlist             = lt_objlist

     CHANGING

       p_request           = lg_request

     EXCEPTIONS

       invalid_object_type = 01

       not_executed        = 02

OTHERS              = 03.

Thank you.

Best regards,
Robert

2 REPLIES 2

raymond_giuseppi
Active Contributor
0 Kudos

Try TR_OBJECTS_CHECK followed by TR_OBJECTS_INSERT.


wa_ko200-pgmid     = 'R3TR'.

wa_ko200-object    = 'XPRA'.

wa_ko200-obj_name  = wi_progname.

APPEND wa_ko200 TO lt_trans.

CALL FUNCTION 'TR_OBJECTS_CHECK'

  IMPORTING

    we_order               = we_order " already locked in this transport

  TABLES

    wt_ko200               = lt_trans

  EXCEPTIONS

    cancel_edit_other_error = 1

    show_only_other_error  = 2

    OTHERS                 = 3.

* CHECK we_order IS INITIAL.

* CHECK sy-subrc = 0.

CALL FUNCTION 'TR_OBJECTS_INSERT'

  EXPORTING

    wi_order               = wi_order

    iv_no_show_option      = ' '

  TABLES

    wt_ko200               = lt_trans

  EXCEPTIONS

    cancel_edit_other_error = 1

    show_only_other_error  = 2

    OTHERS                 = 3.

Regards,

Raymond

0 Kudos

Hey Raymond,
It does not work
My exact code is the following:


REPORT  YOCT_TEST.

data: wa_ko200 type ko200,

       lt_trans type STANDARD TABLE OF ko200,

       we_order type e070-trkorr,

       wi_order type e070-trkorr.

wi_order = 'TIEK900138'.

wa_ko200-pgmid     = 'R3TR'.

wa_ko200-object    = 'XPRA'.

wa_ko200-obj_name  = 'YOCT_XPRA'.

APPEND wa_ko200 TO lt_trans.

CALL FUNCTION 'TR_OBJECTS_CHECK'

   IMPORTING

     we_order               = we_order " already locked in this transport

   TABLES

     wt_ko200               = lt_trans

   EXCEPTIONS

     cancel_edit_other_error = 1

     show_only_other_error  = 2

     OTHERS                 = 3.

  CHECK we_order IS INITIAL.

  CHECK sy-subrc = 0.

CALL FUNCTION 'TR_OBJECTS_INSERT'

   EXPORTING

     wi_order               = wi_order

     iv_no_show_option      = ' '

   TABLES

     wt_ko200               = lt_trans

   EXCEPTIONS

     cancel_edit_other_error = 1

     show_only_other_error  = 2

     OTHERS                 = 3.

CHECK sy-subrc = 0.

After I run it, it finish every FM with return code 0, but the TIEK900138 workbench TR is still empty what am I doing wrong?

Regards,
Robert