Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Dynamic fied assigment

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

Tags:
Former Member
Former Member replied

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

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question