Skip to end of metadata
Go to start of metadata

If you want to create a transport request for table entries.

Please use the same method to add table entries to the transport request.

Example table used here is - T510

Error rendering macro 'code': Invalid value specified for parameter 'com.atlassian.confluence.ext.code.render.InvalidValueException'
*** Variablen
DATA:
  lt_e071     LIKE e071             OCCURS 0 WITH HEADER LINE,
  lt_e071k    LIKE e071k            OCCURS 0 WITH HEADER LINE,
  lt_data     LIKE t510             OCCURS 0 WITH HEADER LINE,
  lv_checkbox TYPE c,
  tr_order    LIKE e071-trkorr,
  tr_task     LIKE e071-trkorr.

*** Selektionsbild
SELECT-OPTIONS:
  s_molga FOR lt_data-molga.

START-OF-SELECTION.

*** Liststatus mit Funktionscode "SICH"
  SET PF-STATUS '1'.

*** Selektion der Länder
  SELECT * FROM t510 INTO TABLE lt_data
   WHERE molga IN s_molga.

*** Ausgabe
  LOOP AT lt_data.
    WRITE /1 lv_checkbox AS CHECKBOX INPUT ON.
    WRITE    lt_data-molga.
  ENDLOOP.

END-OF-SELECTION.

AT USER-COMMAND.

  CASE sy-ucomm.
    WHEN 'SICH'.
*** Sichern: Aufnahme der markierten Einträge
      REFRESH: lt_e071, lt_e071k.
*** Auswahl eines Auftrags
      CALL FUNCTION 'TRINT_ORDER_CHOICE'
        EXPORTING
          wi_order_type = 'W'
          wi_task_type  = 'Q'
          wi_category   = 'CUST'
        IMPORTING
          we_order      = tr_order
          we_task       = tr_task
        TABLES
          wt_e071       = lt_e071
          wt_e071k      = lt_e071k
        EXCEPTIONS
          OTHERS        = 6.
      CHECK sy-subrc = 0.

      DO.
*** Markierte Länder ermitteln
        READ LINE sy-index FIELD VALUE
              lv_checkbox lt_data-molga.
        IF sy-subrc > 0.
*** Ende der Liste
          EXIT.

        ELSEIF lv_checkbox <> space.
*** E071 füllen
          lt_e071-trkorr      = space.
          lt_e071-as4pos      = 0.
          lt_e071-pgmid       = 'R3TR'.
          lt_e071-object      = 'TABU'.
          lt_e071-obj_name    = 'T510'.
          lt_e071-objfunc     = 'K'.
          COLLECT lt_e071.
*** E071K - Schlüsseleinträge füllen
          lt_e071k-trkorr     = space.
          lt_e071k-pgmid      = 'R3TR'.
          lt_e071k-object     = 'TABU'.
          lt_e071k-objname    = 'T510'.
          lt_e071k-as4pos     = 0.
          lt_e071k-mastertype = 'TABU'.
          lt_e071k-mastername = 'T510'.
          lt_e071k-viewname   = space.
          lt_e071k-objfunc    = space.
*** Schlüssel basteln
          CONCATENATE sy-mandt '07' '10' '01' '1' 'TMS05' '05' '31.03.2010'
          INTO lt_e071k-tabkey.

          COLLECT lt_e071k.
        ENDIF.
      ENDDO.

      IF NOT lt_e071k[] IS INITIAL.
*** Aufnahme der Einträge in Transportauftrag
        CALL FUNCTION 'TR_APPEND_TO_COMM_OBJS_KEYS'
          EXPORTING
            wi_trkorr = tr_task
          TABLES
            wt_e071   = lt_e071
            wt_e071k  = lt_e071k
          EXCEPTIONS
            OTHERS    = 68.
        IF sy-subrc = 0.
          MESSAGE s000(vz)
             WITH 'Einträge aufgenommen in Transport' tr_order.
        ENDIF.
      ENDIF.
  • No labels