2008 Nov 19 1:55 PM
how to pass a value which is in a variable (i.e. w_column) to a structure (i.e. l_mdezx).
2008 Nov 19 2:47 PM
l_mdezx-FIELD_NAME = w_column.
FIELD_NAME would be the name of the field in the structure you want to pass the value of the variable into.
Regards,
Michael
2008 Nov 19 3:24 PM
thx for reply.
but the prob is l_mdezx is define as a table type MDEZ_USER_EXIT_T and the field is in a line type MDEZ_USER_EXIT.
2008 Nov 19 3:47 PM
All right, the first thing is to know which line of the table do you need to change?
If it is just one:
* ok assumed this is the data declaration:
*data: l_mdezx type mdez_user_exit_t,
* wa_dez type mdez_user_exit.
read table l_mdezx into wa_dez with key "what ever your criteria are
if sy-subrc eq 0.
wa_dez-FIELD_NAME = w_column.
modify l_mdezx from wa_dez.
endif.
If you have more than one line to update do a LOOP AT L_MDEZX into wa_dez WHERE ....... and change the field content within the loop.
If you need to update all fields in the table
wa_dez-FIELD_NAME = w_column.
modify l_mdezx from wa_dez transporting FIELD_NAME where FIELD_NAME ne wa_dez-FIELD_NAME.
Hope that clarifies it,
Michael