Application Development and Automation 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: 
Read only

Writing objects to a transport request

Former Member
0 Likes
1,257

Hi all,

I generate structures and table types in an ABAP Program and I want to record these objects to a transport request. I use the function modules 'TR_OBJECTS_CHECK' and 'TR_OBJECTS_INSERT' to write the objects to a transport request, but in this case, for each object the dialog for entering the package name and transport request is shown. I want that all objects are saved in the same package and transport requests. Is there another function module by which I can record all generated objects in a transport request after the request and package number is asked only once?

Regards,

Sükrü

Hi all,

I generate structures and table types in an ABAP Program and I want to record these objects to a transport request. I use the function modules 'TR_OBJECTS_CHECK' and 'TR_OBJECTS_INSERT' to write the objects to a transport request, but in this case, for each object the dialog for entering the package name and transport request is shown. I want that all objects are saved in the same package and transport requests. Is there another function module by which I can record all generated objects in a transport request after the request and package number is asked only once?

Regards,

Sükrü

2 REPLIES 2
Read only

Former Member
0 Likes
979

Hi there. Please see if this will work for you:

TR_INSERT_NEW_COMM

I hope this helps.

- April King

Read only

Clemenss
Active Contributor
0 Likes
979

Hi Suekrue,

I think 'TR_APPEND_TO_COMM' is the one. We did something similar. First choose/Create the Request, then append objects:



*&---------------------------------------------------------------------*
*&      Form  TR_REQUEST_CHOICE
*&---------------------------------------------------------------------*
FORM tr_request_choice  CHANGING pv_trkorr TYPE trkorr.
  TYPE-POOLS:
    trwbo. "complex types for transport request display
  DATA:
    ls_request                            TYPE trwbo_request_header.
  CALL FUNCTION 'TR_REQUEST_CHOICE'
    EXPORTING
*   IV_SUPPRESS_DIALOG                    = ' '
*   IV_REQUEST_TYPES                      =
*   IV_CLI_DEP                            = ' '
*   IV_REQUEST                            = ' '
*   IT_E071                               =
*   IT_E071K                              =
*   IV_LOCK_OBJECTS                       = ' '
      iv_title                            = 'Auftrag auswählen, Aufgabe wird gefunden'
*   IV_START_COLUMN                       = 3
*   IV_START_ROW                          = 7
*   IV_WITH_ERROR_LOG                     = 'X'
*   IV_NO_OWNER_CHECK                     = ' '
    IMPORTING
      es_request                          = ls_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
            .
  IF sy-subrc                             = 0.
    SELECT trkorr
      INTO pv_trkorr UP TO 1 ROWS
      FROM e070
      WHERE trfunction = 'S'
        AND trstatus = 'D'
        AND as4user = sy-uname
        AND strkorr = ls_request-trkorr.
      EXIT.
    ENDSELECT."rkorr into pv_trkorr
  ENDIF.
ENDFORM.                    " TR_REQUEST_CHOICE

*&---------------------------------------------------------------------*
*&      Form  TR_APPEND_TO_COMM
*&---------------------------------------------------------------------*
FORM tr_append_to_comm
  CHANGING ps_alv                         TYPE LINE OF ty_t_alv.
  DATA:
    ls_e071                               TYPE e071,
    lv.
  ls_e071-pgmid                           = 'LIMU'.
  ls_e071-object                          = 'FUNC'.
  ls_e071-obj_name                        = ps_alv-funcname.
  CALL FUNCTION 'TR_APPEND_TO_COMM'
    EXPORTING
      pi_korrnum                          = p_trkorr
      wi_e071                             = ls_e071
      wi_simulation                       = p_test
*   WI_SUPPRESS_KEY_CHECK                 = ' '
* TABLES
*   WT_E071K                              =
    EXCEPTIONS
      no_authorization                    = 1
      no_systemname                       = 2
      no_systemtype                       = 3
      tr_check_keysyntax_error            = 4
      tr_check_obj_error                  = 5
      tr_enqueue_failed                   = 6
      tr_ill_korrnum                      = 7
      tr_key_without_header               = 8
      tr_lockmod_failed                   = 9
      tr_lock_enqueue_failed              = 10
      tr_modif_only_in_modif_order        = 11
      tr_not_owner                        = 12
      tr_no_append_of_corr_entry          = 13
      tr_no_append_of_c_member            = 14
      tr_no_shared_repairs                = 15
      tr_order_not_exist                  = 16
      tr_order_released                   = 17
      tr_order_update_error               = 18
      tr_repair_only_in_repair_order      = 19
      tr_wrong_order_type                 = 20
      wrong_client                        = 21
      OTHERS                              = 22
            .
  IF sy-subrc                             <> 0.
    MESSAGE ID sy-msgid                   TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
            INTO ps_alv-tr_message.
  ENDIF.

ENDFORM.                    " TR_APPEND_TO_COMM

Pleas adapt to your needs.

Regards,

Clemens