Google Search - Blog...........

ABAP - Number Of Records In A Table At Runtime.

report .

DATA : BEGIN OF it_mara OCCURS 0,
matnr LIKE mara-matnr,
ersda LIKE mara-ersda,
meins like mara-meins,
END OF it_mara.

DATA : p(5) TYPE c.
FIELD-SYMBOLS: TYPE ANY.
FIELD-SYMBOLS: TYPE ANY.

ASSIGN it_mara TO .
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE TO .
IF sy-subrc EQ 0.
p = p + 1.
ELSE.
EXIT.
ENDIF.
ENDDO.

WRITE : / p.

No comments:

Post a Comment