‎2007 Nov 28 8:52 AM
Hi all. I need to clear a field in a structure, but the problem is that this field is known only during runtime and is contained as a value of another field (lv_need_clear). How can the value be into transformed into variable?
CONCATENATE 'ls_bapi_' <ls_matdata>-tabname 'x' '-'
<ls_dd03p>-deffdname INTO lv_need_clear.
CLEAR "...???
‎2007 Nov 28 8:58 AM
hi, try this code.
FIELD-SYMBOLS <fs>.
ASSIGN COMPONENT (lv_need_clear) OF STRUCTURE Your Structure name TO <fs>.
CHECK sy-subrc EQ 0.
CLEAR <fs>.
‎2007 Nov 28 1:27 PM
Thanks, but the structure is also known only during runtime, as well as the field I need to clear.
‎2007 Nov 28 1:31 PM
u can assign structure too.
FIELD-SYMBOLS <fs_struc> TYPE ANY.
ASSIGN (structure_name) TO <fs_struc>.
check sy-subrc EQ 0.
then.
ASSIGN COMPONENT (field_name) OF structure <fs_struct> TO <fs>.