You are on page 1of 3

Create a prg as below .

REPORT ZBKPF.
DATA : I_BKPF TYPE TABLE OF BKPF .
DATA : WA_BKPF TYPE BKPF .
SELECT * FROM BKPF
INTO TABLE I_BKPF
WHERE XBLNR <> ' ' .
LOOP AT I_BKPF INTO WA_BKPF .
WRITE : / WA_BKPF-BELNR .
ENDLOOP .
Check the runtime analysis in SE30.

Now change the prog as bleow.


REPORT ZBKPF.
TYPES : BEGIN OF TY_BKPF,
BUKRS TYPE BKPF-BUKRS,
BELNR TYPE BKPF-BELNR,
GJAHR TYPE BKPF-GJAHR,
XBLNR TYPE BKPF-XBLNR,
END OF TY_BKPF.
DATA : I_BKPF TYPE TABLE OF ty_BKPF .
DATA : WA_BKPF TYPE ty_BKPF .
*bukrs belnr gjahr xblnr
SELECT bukrs belnr gjahr xblnr FROM BKPF
INTO TABLE I_BKPF
WHERE bukrs = '0001' .
LOOP AT I_BKPF INTO WA_BKPF .
WRITE : / WA_BKPF-BELNR .
ENDLOOP .
Check the runtime analysis in SE30.