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

delete a line if string not there

Former Member
0 Likes
734

Hi friends,

this is not working. I dont know why ?

All what I need to do is deleting lines from itab

if string1 is not appearing in string2.

e.g. delete wa_zehs_prokat_tab because

string2 doesn't have R99 .

string1 = 'R99'
string2 = 'R39/26 R39/27 R39/28 R60 R62'.

LOOP AT it_ZEHS_PROKAT_RES INTO wa_zehs_prokat_tab.
loop at s_rstze.
if  s_rstze-low CA  wa_zehs_prokat_tab-RSATZ.
* do nothing
else.
DELETE TABLE it_ZEHS_PROKAT_RES FROM wa_zehs_prokat_tab.
endif.
endloop.
endloop.

Thanks

sas

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
686

Try SEARCH.


SEARCH STRING2 FOR STRING1.
IF SY-SUBRC = 4.
** not found, delete
ENDIF.  

Regards,

Naimesh Patel

Try SEARCH.


SEARCH STRING2 FOR STRING1.
IF SY-SUBRC = 4.
** not found, delete
ENDIF.  

Regards,

Naimesh Patel

2 REPLIES 2
Read only

naimesh_patel
Active Contributor
0 Likes
687

Try SEARCH.


SEARCH STRING2 FOR STRING1.
IF SY-SUBRC = 4.
** not found, delete
ENDIF.  

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
686

can you please let me know how you solved the issue ? Please share with me ....!!