cancel
Showing results for 
Search instead for 
Did you mean: 

How to include a table entry in task using TR_APPEND_TO_COMM_OBJS_KEYS?

0 Kudos

Hi to all.

I'm trying to include an entry from /IWFND/V_MGDEAM in my task using this FM but couldn't figure out how to.

Can someone help me?

Accepted Solutions (1)

Accepted Solutions (1)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert

Hi Daniel,

you can try out the following coding:

DATA: lt_mgdeam         TYPE TABLE OF /iwfnd/c_mgdeam,
lv_srv_identifier type /iwfnd/med_mdl_srg_identifier.

 lv_srv_identifier = '< enter your Service identifier here'.


 SELECT *
    FROM /iwfnd/c_mgdeam
    INTO TABLE lt_mgdeam
      WHERE service_id    =   lv_srv_identifier.
    IF lt_mgdeam IS NOT INITIAL.
      TRY.
          /iwfnd/cl_transport=>append_to_transport_wo_commit(
          EXPORTING
            it_content    = lt_mgdeam
            iv_tablename  = '/IWFND/C_MGDEAM'
            iv_keylength  = 43
            iv_create_generic_key = abap_true "needed as tables keys exceed 120 characters
          CHANGING
            cv_tr_request = cv_transport
            ).
        CATCH /iwfnd/cx_transport INTO DATA(lx_transport).
          RAISE EXCEPTION TYPE /iwfnd/cx_med_remote
            EXPORTING
              previous = lx_transport.
      ENDTRY.
    ENDIF.

Much thanks, Andre Fischer! It worked.

Answers (0)