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
- Go to transaction code SE38.
- Enter the program name Z or Y<program name>
- Select attribute type as Executable program.
- 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.
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.
No comments:
Post a Comment