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: 

Change the Value of column of the internal table at run time

sanju_joseph
Participant
0 Kudos

Hello Experts,

With the below code i am able to determine the value hold

by internal table at run time for a sepcific column but i am not getting the way

of how to update the internal if one of the value is changed,

lr_desc_table ?= cl_abap_typedescr=>describe_by_data( itab ).

lr_desc_struc ?= lr_desc_table->get_table_line_type( ).

loop at itab assigning <fs_data>.

loop at lr_desc_struc->components ASSIGNING <fs_comp_wa>.

assign component <fs_comp_wa>-name of structure <fs_data> to <fs_field>.

lv_excel_row = <fs_field>.

CALL FUNCTION 'SCP_REPLACE_STRANGE_CHARS'

EXPORTING

INTEXT = lv_excel_row

IMPORTING

OUTTEXT = lv_excel_row.

assign lv_excel_row to <fs_field>. "this is not changing the value actually hold in internal table

endloop.

endloop.

2 REPLIES 2

Former Member
0 Kudos

I think this would be enough:

*assign lv_excel_row to <fs_field>. "this is not changing the value actually hold in internal table

<fs_field> = lv_excel_row.

0 Kudos

Hi,

Resolved this issue with the code mentioned below.

Code:

loop at lt_export_items assigning <fs_data>.

ls_data = <fs_data>.

loop at lr_desc_struc->components ASSIGNING <fs_comp_wa>.

assign component <fs_comp_wa>-name of structure <fs_data> to <fs_field>.

lv_excel_row = <fs_field>.

CALL FUNCTION 'SCP_REPLACE_STRANGE_CHARS'

EXPORTING

INTEXT = lv_excel_row

IMPORTING

OUTTEXT = lv_excel_row.

concatenate 'ls_data-' <fs_comp_wa>-name into lv_var.

assign (lv_var) to <fs_var>.

<fs_var> = lv_excel_row.

endloop.

modify lt_export_items from ls_data .

clear:ls_data.

endloop.

Take care,

Sanju