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 warning for this statement

Former Member
0 Likes
2,419

Sequential read access possible for a sorted table

lt_action_fld is a sorted table.

DELETE lt_action_fld WHERE status = '0'.

can anybody tell me how to improve it?

Best regards,

Blake Le

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,382

hiiii

first sort your table with 'status' field...& use like

delete from (table Name) where condition.

regards

twinkal

6 REPLIES 6
Read only

Former Member
0 Likes
1,382

what is warning..is it of Sy-subrc check after delete statement..then put this check after delete statement

Read only

0 Likes
1,382

hi, Madam,

I don't think so , I believe it's a warning from read table statement and the internal table attribute.

Best regards,

Best regards,

Read only

former_member195383
Active Contributor
0 Likes
1,382

make sure that lt_action_fld is sorted by status field..

that will improve the performance..

Read only

Former Member
0 Likes
1,382

Hello Blake,

Try this:

READ TABLE lt_action_fld WITH KEY STATUS = '0' BINARY SEARCH.

wf_index = sy-tabix.

loop at lt_action_fld from wf_index.

if lt_action_fld-status ne '0'.

exit.

endif.

delete lt_action_fld index wf_index.

endloop.

Let us know, if this helps.

Rgds,

Raghu.

Read only

Former Member
0 Likes
1,383

hiiii

first sort your table with 'status' field...& use like

delete from (table Name) where condition.

regards

twinkal

Read only

Former Member
0 Likes
1,382

Hi Blake,

Try if this works. Put your delete statement in

IF SY-SUBRC = 0.

DELETE

ENDIF.

Regards,

Sai