- Move : we can move the content of one work area into another work area if only exact structure of both work area’s are matching.
- Syntax
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
REPORT ZTOT_SUB NO STANDARD PAGE HEADING.
TYPES : BEGIN OF TY_VBRP,
VBELN TYPE VBRP-VBELN,
POSNR TYPE VBRP-POSNR,
MATNR TYPE VBRP-MATNR,
ARKTX TYPE VBRP-ARKTX,
NETWR TYPE VBRP-NETWR,
END OF TY_VBRP.
DATA : WA_VBRP TYPE TY_VBRP,
IT_VBRP TYPE TABLE OF TY_VBRP.
DATA : WA_TEMP TYPE TY_VBRP,
IT_TEMP TYPE TABLE OF TY_VBRP.
SELECT-OPTIONS : S_VBELN FOR WA_VBRP-VBELN.
SELECT VBELN POSNR MATNR ARKTX NETWR FROM VBRP INTO TABLE IT_VBRP
WHERE
VBELN IN S_VBELN.
LOOP AT IT_VBRP INTO WA_VBRP.
MOVE WA_VBRP TO WA_TEMP.
WRITE : / WA_VBRP-VBELN , WA_VBRP-POSNR , WA_VBRP-MATNR ,
WA_VBRP-ARKTX , WA_VBRP-NETWR.
APPEND WA_TEMP TO IT_TEMP.
CLEAR : WA_TEMP , WA_VBRP .
ENDLOOP.
ULINE.
LOOP AT IT_TEMP INTO WA_TEMP.
WRITE : / WA_TEMP-VBELN , WA_TEMP-MATNR.
ENDLOOP.
TYPES : BEGIN OF TY_VBRP,
VBELN TYPE VBRP-VBELN,
POSNR TYPE VBRP-POSNR,
MATNR TYPE VBRP-MATNR,
ARKTX TYPE VBRP-ARKTX,
NETWR TYPE VBRP-NETWR,
END OF TY_VBRP.
DATA : WA_VBRP TYPE TY_VBRP,
IT_VBRP TYPE TABLE OF TY_VBRP.
DATA : WA_TEMP TYPE TY_VBRP,
IT_TEMP TYPE TABLE OF TY_VBRP.
SELECT-OPTIONS : S_VBELN FOR WA_VBRP-VBELN.
SELECT VBELN POSNR MATNR ARKTX NETWR FROM VBRP INTO TABLE IT_VBRP
WHERE
VBELN IN S_VBELN.
LOOP AT IT_VBRP INTO WA_VBRP.
MOVE WA_VBRP TO WA_TEMP.
WRITE : / WA_VBRP-VBELN , WA_VBRP-POSNR , WA_VBRP-MATNR ,
WA_VBRP-ARKTX , WA_VBRP-NETWR.
APPEND WA_TEMP TO IT_TEMP.
CLEAR : WA_TEMP , WA_VBRP .
ENDLOOP.
ULINE.
LOOP AT IT_TEMP INTO WA_TEMP.
WRITE : / WA_TEMP-VBELN , WA_TEMP-MATNR.
ENDLOOP.
No comments:
Post a Comment