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

Syntax for changing column-name

Former Member
0 Likes
435

Hi All,

I would like to delete an internal table with changing columns. Could you please suggest what should be done if I have to execute the following code.

DELETE lr_rep->mt_sel_prg_plans WHERE (ls_sel_value-name) <> ls_sel_value-value.

Thanks and Regards,

Varun.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
412

Have a look an Txn ABAPHELP key word "DELETE itab": There it says:

The dynamic specification of components using character-type data objects in parentheses is not supported here.

I would do the following:


LOOP AT lr_rep->mt_sel_prg_plans ASSIGNING <wa>.
  ASSIGN COMPONENT ls_sel_value-name TO <fs>.
  IF <fs> EQ ls_sel_value-value.
    CLEAR <fs>.
  ENDIF.
ENDLOOP.

2 REPLIES 2
Read only

Former Member
0 Likes
413

Have a look an Txn ABAPHELP key word "DELETE itab": There it says:

The dynamic specification of components using character-type data objects in parentheses is not supported here.

I would do the following:


LOOP AT lr_rep->mt_sel_prg_plans ASSIGNING <wa>.
  ASSIGN COMPONENT ls_sel_value-name TO <fs>.
  IF <fs> EQ ls_sel_value-value.
    CLEAR <fs>.
  ENDIF.
ENDLOOP.

Read only

Former Member
0 Likes
412
LOOP AT my_table INTO my_work_area. " or ASSIGNING TO <my_work_area>
  ASSIGN COMPONENT (variable_containing_column_name) OF STRUCTURE my_work_area INTO  <field_symbol>.
  CLEAR <field_symbol>.
ENDLOOP.