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.
Showing results for 
Search instead for 
Did you mean: 


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).


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.



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.

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,