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

Code inspector error message please help

Former Member
0 Likes
1,579

Hi All i have used delete statement as shown below

DELETE t_output WHERE remain_invoice NOT IN s_invo[].

t_output is my internal table .

Error message in code inspector is :Sequential read access for a standard table

What should i do ?

5 REPLIES 5
Read only

Sm1tje
Active Contributor
0 Likes
988

are you deleting data from internal table or database table?

For internal table use addition DELETE TABLE....

Read only

Former Member
0 Likes
988

hi,

i think you should not do this.

try .

loop at t_output.

vtabix = sy-tabix.

read table s_invo with key low = t_output-remain_invoice .

if sy-subrc ne 0.

delete t_output index vtabix.

endif.

endloop.

this wont lead any performance issue.

Read only

0 Likes
988

I think its better to avoid delete statements inside the loop

instead of using delete statement inside the loop

use

delete table itab where condition

or

if u have to use loop at any cost

modify internal table with flag=X

and then delete all records from the itab at one shot using above statement

Regards

Vikas C

Read only

0 Likes
988

Hi Manisha,

We should not do delete inside loop.

It will degrade performance.

Regards

Sandipan

Read only

Former Member
0 Likes
988

There's 2 more and I'd really appreciate your inputs.

 1.) LOOP AT lt_plaf
    ASSIGNING FIELD-SYMBOL(<fs_plaf>).


    READ TABLE lt_zmrp
      INTO DATA(ls_zmrp)
      WITH KEY cno_order = <fs_plaf>-plnum+3(7).


    IF sy-subrc NE 0.
      MOVE abap_true TO <fs_plaf>-xdel .
    ENDIF.


  ENDLOOP.


  DELETE lt_plaf
    WHERE xdel EQ abap_true.
2.)   SELECT ordid
    FROM /bmw/ts_1143_log AS a
   WHERE ordid IN @s_ordid
     AND order_comp_flag EQ @space
     AND
  EXISTS ( SELECT *
             FROM zmrp
            WHERE cno_order  EQ a~ordid
              AND cid_status IN @s_status
              AND cno_assyl  IN @s_assyl )
    INTO TABLE @gt_log.


  IF sy-subrc EQ 0.


    SORT gt_log
      BY ordid.


    DELETE ADJACENT DUPLICATES FROM gt_log
      COMPARING ordid ##CI_SORTED.


  ENDIF.