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

ABAP - Determine Number Of Rows In An Internal Table At Runtime.

Report ztests .



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(4) 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