Skip to Content
0
Former Member
Jan 08, 2008 at 12:50 PM

assigning structures with different fields to a field symbol

24 Views

Hi,

can anybody give a example code of how to assign a structure to a field symbol in aloop if the structure is containing more than 1 type of data .

i am giving the code please try so that it could run ina unicode environment.and doesnt give dump.

TABLES: SNAP,

SNAP_BEG,

SNAPT.

DATA: BEGIN OF I_SNAP_BEG OCCURS 0.

INCLUDE STRUCTURE SNAP_BEG.

DATA TCODE LIKE SY-TCODE.

DATA REPID LIKE SY-REPID.

DATA TLINE LIKE SNAPT-TLINE.

DATA SIGN(1).

DATA END OF I_SNAP_BEG.

DATA DATUM LIKE SY-DATUM.

DATA: BEGIN OF FCC,

ID(2), LL(3), ERRID LIKE SNAPT-ERRID,

END OF FCC.

FIELD-SYMBOLS: <F> .

SELECT * FROM SNAP_BEG INTO TABLE I_SNAP_BEG.

SELECT * FROM SNAP UP TO 1 ROWS

WHERE DATUM = I_SNAP_BEG-DATUM.

ENDSELECT.

MODIFY I_SNAP_BEG.

LOOP AT I_SNAP_BEG ASSIGNING <F>.

MOVE-CORRESPONDING I_SNAP_BEG TO SNAP.

FCC = I_SNAP_BEG-FLIST.

IF FCC-LL CO '0123456789'.

ASSIGN FCC-ERRID(FCC-LL) TO <F>.

SNAPT-ERRID = <F>.

ELSE.

SNAPT-ERRID = '?????'.

ENDIF.

ENDLOOP.

WRITE : <F>.