Wednesday, 1 June 2016

Move-corresponding


  • Move-corresponding  : corresponding fields we can pass from one work area to another.
  • Syntax

           Move-corresponding  <Source work Area > TO <Destination Work Area>

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




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 VBRP,
       IT_TEMP TYPE TABLE OF 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-CORRESPONDING  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.


  • Save->check->Activate->Execute.

Input


Output





No comments:

Post a Comment