Make your own free website on Tripod.com
SAP ABAP Programming, Functional and Basis Components Books


Download ztable to the dataset

REPORT ZPHYEXP1.

* ZBISEG is a transparent table.  The structure copy from BISEG_MDE.

TABLES: ZBISEG,
        RLGRAP.

SELECT-OPTIONS: S_WERKS FOR ZBISEG-WERKS,
                S_LGORT FOR ZBISEG-LGORT.
*                s_matnr for ZBISEG-matnr.

DATA: BEGIN OF ITAB OCCURS 100.
        INCLUDE STRUCTURE BISEG_MDE.
DATA: END OF ITAB.

SELECT * FROM ZBISEG WHERE WERKS IN S_WERKS AND
     LGORT IN S_LGORT.
*     matnr in s_matnr.
  MOVE-CORRESPONDING ZBISEG TO ITAB.
  MOVE '1' TO ITAB-BSTAR.
  APPEND ITAB.
ENDSELECT.

OPEN DATASET '/usr/sap/trans/data/phyinvmde' FOR OUTPUT IN TEXT MODE.
LOOP AT ITAB.
  TRANSFER ITAB TO '/usr/sap/trans/data/phyinvmde'.
ENDLOOP.
CLOSE DATASET '/usr/sap/trans/data/phyinvmde'.

Back to Previous

Return to SAP Hints and Tips on Configuration and ABAP/4 Programming