Tuesday, April 9, 2013

SAP WHERE Statement

Program to use WHERE Statement in SAP

Example


REPORT  ZG15.

"Internal table declaration
DATA: it TYPE EKPO.

WRITE:/1 'Item' color 5,9 'Short Text' color 5,27 'Order Quantity' color 5,
      37 'Price Unit' color 5,49 'Price Date' color 5.

"Data retrieval
SELECT * FROM EKPO INTO it UP TO 100 ROWS WHERE peinh = 10.

  WRITE:/1 it-ebelp, 9 it-txz01,
        27 it-menge,37 it-peinh,
        49 it-prdat.
ENDSELECT.


SYNTAX


SELECT *|<FLD_LIST>
    FROM <DB_TABLE>
        INTO TABLE <ITAB>
            WHERE <CONDITION>.

No comments:

Post a Comment