‎2008 Apr 29 8:06 AM
Hi all,
While executing a program in background i am getting the dump with the error 'TABLE_ILLEGAL_STATEMENT'.
In the dump it is showing the error line as the modify statement.
Error code:-
LOOP AT gt_order_sub_data.
gt_list_subs-sel_flag = 'X'.
-> MODIFY gt_list_subs TRANSPORTING sel_flag.
Endloop.
Is there any issue with the modify statement?.
Regards,
Neslin.
‎2008 Apr 29 8:16 AM
‎2008 Apr 29 8:18 AM
Hi Neslin,
use this code...
LOOP AT gt_order_sub_data.
gt_list_subs-sel_flag = 'X'.
MODIFY gt_list_subs index sy-tabix TRANSPORTING sel_flag .
Endloop.
Hope this would solved.
please do reward if solved.
Amit.
‎2008 Apr 29 8:19 AM
Error code:-
LOOP AT gt_order_sub_data.
gt_list_subs-sel_flag = 'X'.
-> MODIFY gt_list_subs TRANSPORTING sel_flag.
Endloop.
I think the below code shud work
LOOP AT gt_order_sub_data.
Read table gt_list_subs with key < specify the fields >
if sy-subrc = 0
gt_list_subs-sel_flag = 'X'.
MODIFY gt_list_subs TRANSPORTING sel_flag.
endif.
ENDLOOP.
Instead of Read table you can use LOOP AT gt_list_subs also
OR
only MODIFY gt_list_subs index sy-tabix TRANSPORTING sel_flag .
‎2008 Apr 29 8:20 AM
Hi,
The thing is you are looping on another table and modifying another table. If you have to modify another table then either loop on it or use MODIFY TABLE ...
Reward points if usefull.
‎2008 Apr 29 8:29 AM
Khusro Habib,
Thanks for pointing out tht. I have to be more attentive before posting the qns.:)
Thanks,
Neslin.
‎2008 Apr 29 8:29 AM
Hi,
you are trying to modify a different table in the loop. if you want to modify a different table other than the table which you are looping try reading the internal table first basing on the loop table and then use modify statement with index.
Regards,
Aravind M