2008 Oct 08 4:42 PM
Hello,
Is there a dynamic way of doing this:
CASE lv_iobj.
WHEN 'net_price'.
ls_keyf-net_price = <fs_keyf1>.
WHEN 'net_value'.
ls_keyf-net_value = <fs_keyf1>.
WHEN '/bic/znet_valu'.
ls_keyf-/bic/znet_valu = <fs_keyf1>.
WHEN '/bic/zknbasunt'.
ls_keyf-/bic/zknbasunt = <fs_keyf1>.
WHEN '/bic/zknvalbas'.
ls_keyf-/bic/zknvalbas = <fs_keyf1>.
WHEN '/bic/zknvalind'.
ls_keyf-/bic/zknvalind = <fs_keyf1>.
WHEN '/bic/zknindunt'.
ls_keyf-/bic/zknindunt = <fs_keyf1>.
ENDCASE.
Thanks
Matthieu
2008 Oct 08 4:49 PM
Hi,
Try this..
FIELD-SYMBOLS: <FS>.
ASSIGN COMPONENT LV_OBJ OF STRUCTURE LS_KEYF TO <FS>.
IF SY-SUBRC = 0.
<FS> = <fs_keyf1>.
ENDIF.
Thanks
Naren
2008 Oct 08 4:49 PM
Yes it's possible.
Do an F1 on the statement ASSIGN. You should look for ASSIGN COMPONENT
2008 Oct 08 4:49 PM
Hi,
Try this..
FIELD-SYMBOLS: <FS>.
ASSIGN COMPONENT LV_OBJ OF STRUCTURE LS_KEYF TO <FS>.
IF SY-SUBRC = 0.
<FS> = <fs_keyf1>.
ENDIF.
Thanks
Naren
2008 Oct 08 4:59 PM
To have a working version of
ASSIGN COMPONENT LV_OBJ OF STRUCTURE LS_KEYF TO <FS>.
IF SY-SUBRC = 0.
<FS> = <fs_keyf1>.
ENDIF.
You'll need to do the following:
LV_OBJECT = 'insert your fieldname'.
ASSIGN COMPONENT LV_OBJ OF STRUCTURE LS_KEYF TO <FS>.
IF SY-SUBRC = 0.
<FS> = <fs_keyf1>.
ENDIF.
So you will need to repeat that part for each single field in your structure; better create a FORM that you call for each field in your structure.
But if this is not what you want, maybe yo ushould post a bit more: where does <fs_keyf1> get its value from?
2008 Oct 08 4:50 PM
Yes.
Do like this:
ASSIGN COMPONENT lv_iobj OF STRUCTURE LS_KEYF TO <FS_FIELD>
<FS_FIELD> = <FS_KEYF1>.
Regards,
Naimesh Patel
2008 Oct 08 4:53 PM
Sorry my question was not precise enough.
I want a copy of the value of the field symbol to be stored into the correct field of my structure.
Thanks
Matthieu
2008 Oct 08 5:06 PM