‎2010 Mar 03 11:43 AM
Hi,
I like to get a field from a structure which i read from a customizing table. I think with a snippet it is easy to understand:
FIELD-SYMBOLS: <fs_value> TYPE Any.
DATA: lv_field type text30,
lv_structure type but000,
lv_Structure_name type text30.
select single *
into lv_structure
from but000.
lv_field = 'PARTNER'.
lv_Structure_name = 'LV_STRUCTURE'.
ASSIGN COMPONENT lv_field OF STRUCTURE lv_Structure_name TO <fs_value>.
But this doesn't wok, because it seems, that this statement try to get the fieldname from the variable 'lv_Structure_name'.
If i replace lv_Structure_name with lv_Structure than it works, but this is not what I like.
Any ideas
Stefan
‎2010 Mar 03 11:54 AM
Hi,
with a little addition of a second fs:
FIELD-SYMBOLS: <fs_value> TYPE ANY.
FIELD-SYMBOLS: <fs_struc> TYPE ANY.
DATA: lv_field TYPE text30,
lv_structure TYPE but000,
lv_structure_name TYPE text30.
SELECT SINGLE *
INTO lv_structure
FROM but000.
lv_field = 'PARTNER'.
lv_structure_name = 'LV_STRUCTURE'.
ASSIGN (lv_structure_name) TO <fs_struc>.
ASSIGN COMPONENT lv_field OF STRUCTURE <fs_struc> TO <fs_value>.
it will work.
regards
Jörg
‎2010 Mar 03 11:54 AM
Hi,
with a little addition of a second fs:
FIELD-SYMBOLS: <fs_value> TYPE ANY.
FIELD-SYMBOLS: <fs_struc> TYPE ANY.
DATA: lv_field TYPE text30,
lv_structure TYPE but000,
lv_structure_name TYPE text30.
SELECT SINGLE *
INTO lv_structure
FROM but000.
lv_field = 'PARTNER'.
lv_structure_name = 'LV_STRUCTURE'.
ASSIGN (lv_structure_name) TO <fs_struc>.
ASSIGN COMPONENT lv_field OF STRUCTURE <fs_struc> TO <fs_value>.
it will work.
regards
Jörg