Application Development and Automation 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: 
Read only

How to modify table dynamically with user input?

vinayad
Participant
0 Likes
682

i want to modify table with user input data in a selected field. How to achieve this ?

FIELD-SYMBOLS:
<i_itab> TYPE table,
<wa_tab> TYPE ANY,
<w_field> TYPE ANY.

CREATE DATA i_table TYPE TABLE OF (viewname).
ASSIGN i_table->* TO <i_itab>.

ASSIGN wa_all->* TO <wa_tab>.
ASSIGN wa_all->* to <w_field>.

what would i can right next code to modify the row? it should modify only the entered field others should not change.

-thanks for your help!

1 REPLY 1
Read only

StevenDeSaeger
Contributor
0 Likes
505

If I understand you correctly - you have some input fields and you only want to apply those input fields data to your dynamic table ?

You will have to iterate over the input fields - so assuming you have some kind of field catalog ( eg based upon a struct info )

Pseudo code:

loop at lt_input_field_catalog assigning field-symbol<fs_fc_info>.
assign component <fs_fc_info>-x of structure <wa_input_data_line> to field-symbol(<fs_field_input>).
check (sy-subrc eq 0).
assign component <fs_fc_info>-x of structure <wa_tab> to field-symbol(<fs_field_target>).
check (sy-subrc eq 0).
<fs_field_target> = <fs_field_source>.
endloop.