Monday 30 May 2016

Corresponding fields of Table

Corresponding fields of Table

  • Corresponding fields of table keyword used to place the selected  fields from database into corresponding fields of Internal Table.
  • Keyword : Corresponding fields of  Table.

Ex :

Steps

  1. Go to transaction code SE38.
  2. Enter the program name Z or Y<program name>
  3. Select attribute type as Executable program.
  4. Click on Save.

Source Code

TYPES BEGIN OF TY_VBRP,
        VBELN TYPE VBRP-VBELN,
        POSNR TYPE  VBRP-POSNR,
        MATNR TYPE VBRP-MATNR,
        ARKTX TYPE VBRP-ARKTX,
     END  OF TY_VBRP.

DATA WA TYPE TY_VBRP,
       IT TYPE TABLE OF TY_VBRP.

SELECT-OPTIONS S_VBELN FOR WA-VBELN.

SELECT *  FROM VBRP INTO CORRESPONDING FIELDS OF TABLE IT WHERE   VBELN IN S_VBELN.

  LOOP AT IT INTO WA.

    WRITE / WA-VBELN WA-POSNR WA-MATNR WA-ARKTX.

  ENDLOOP.




Input



Output







No comments:

Post a Comment