‎2006 Nov 09 11:53 PM
Hi all,
I have a structure with many fields eg
begin of struc
field01
field02
fieldnn
end of struc
I then work out a variable to get to one field in struc eg
concatenate 'struc-field' lv_num into lv_temp.
(lv_temp now has 'struc-field15' in it as a value).
I would like to use something like:
move '12345' to lv_temp. (where I want the value 12345 to end up in struc-field15 not in lv_temp).
Any help will be appreciated.
Regards
Michael
‎2006 Nov 09 11:56 PM
Hi,
Use field-symbols ..
Ex..
FIELD-SYMBOLS: <FS>.
ASSIGN (LV_TEMP) TO <FS>.
<FS> = '1234'.
Working example..
-
data: begin of struc,
field1(10),
end of struc.
DATA: lv_temp type char30.
lv_temp = 'STRUC-FIELD1'.
FIELD-SYMBOLS: <FS>.
ASSIGN (LV_TEMP) TO <FS>.
<FS> = '1234'.
WRITE: / STRUC-FIELD1.
Thanks,
Naren
Message was edited by: Narendran Muthukumaran
‎2006 Nov 09 11:56 PM
Hi,
Use field-symbols ..
Ex..
FIELD-SYMBOLS: <FS>.
ASSIGN (LV_TEMP) TO <FS>.
<FS> = '1234'.
Working example..
-
data: begin of struc,
field1(10),
end of struc.
DATA: lv_temp type char30.
lv_temp = 'STRUC-FIELD1'.
FIELD-SYMBOLS: <FS>.
ASSIGN (LV_TEMP) TO <FS>.
<FS> = '1234'.
WRITE: / STRUC-FIELD1.
Thanks,
Naren
Message was edited by: Narendran Muthukumaran
‎2006 Nov 10 12:02 AM
Thanks Narendran
I was using field symbols but was missing the brackets around lv_temp, so I couldnt get it to work.
Many thanks for your help.
Points awared.
Regards
Michael
‎2008 Jan 15 5:45 AM