TABLES: ekpo.

* Creating a custom structure of Item Table
TYPES:
      BEGIN OF ty_ekpo,
        ebeln TYPE ekpo-ebeln,
        ebelp TYPE ekpo-ebelp,
        matnr TYPE ekpo-matnr,
        werks TYPE ekpo-werks,
        lgort TYPE ekpo-lgort,
      END OF ty_ekpo.

* Creating a line type of predefined structure
DATA:
      wa_ekpo TYPE ty_ekpo,
      it_ekpo TYPE STANDARD TABLE OF ty_ekpo,

* Creating a line type and internal table
* to use as dynamic columns specification
      line TYPE char100,
      itab TYPE TABLE OF line.

line = 'ebeln ebelp matnr werks lgort'.
APPEND line TO itab.

SELECT (itab)
  FROM ekpo INTO TABLE it_ekpo
  WHERE ebeln = '3000000232'.

WRITE:/    'PO No.',
        15 'Item No',
        28 'Material',
        48 'Plant',
        55 'Storage'.
ULINE.
SKIP.

LOOP AT it_ekpo INTO wa_ekpo.
  WRITE:/    wa_ekpo-ebeln,
          15 wa_ekpo-ebelp,
          28 wa_ekpo-matnr,
          48 wa_ekpo-werks,
          55 wa_ekpo-lgort.
ENDLOOP.



Serkan AKKAVAK
Bilgisayar Mühendisi
serkurumsal@yandex.com