Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Badi

Former Member
0 Kudos

how to pass a value which is in a variable (i.e. w_column) to a structure (i.e. l_mdezx).

3 REPLIES 3

former_member589029
Active Contributor
0 Kudos

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

0 Kudos

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.

0 Kudos

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