Search This Blog

Tuesday, February 19, 2008

Move nodata character '/' to every field of a structure (sample code).

FIELD-SYMBOLS: fs TYPE ANY.

DEFINE nodata.
do.
assign component sy-index of structure &1 to fs.
if sy-subrc <> 0. exit. endif.
fs = '/'.
enddo.
END-OF-DEFINITION.

nodata: bbkpf, bbseg, bbtax, bwith, bselk, bselp.

**Another use for this type of loop:
FIELD-SYMBOLS: TYPE ANY.

DO.
ASSIGN COMPONENT sy-index OF STRUCTURE o_return TO .
IF sy-subrc <> 0. EXIT. ENDIF.
IF NOT IS INITIAL.
WRITE: / .
ENDIF.
ENDDO.

1 comment:

Dfloth said...
This comment has been removed by the author.