2009 Jan 29 11:45 AM
Hi.,
I am having one internal table with more than 50 Records.
FIELD1 is one of the field in that internal table,
It may contains contents like AAA, BBB, CCC, DDD or EEE.
So here I want to delete Internal table entries where that FILED1 eq BBB and FIELD1 eq CCC.
So we can write this as:
delete itab where FIELD1 = 'BBB'.
delete itab where FIELD1 = 'CCC'.How can I solve this with one statement?
---Naveen Inuganti.
Hi.,
I am having one internal table with more than 50 Records.
FIELD1 is one of the field in that internal table,
It may contains contents like AAA, BBB, CCC, DDD or EEE.
So here I want to delete Internal table entries where that FILED1 eq BBB and FIELD1 eq CCC.
So we can write this as:
delete itab where FIELD1 = 'BBB'.
delete itab where FIELD1 = 'CCC'.How can I solve this with one statement?
---Naveen Inuganti.
2009 Jan 29 11:47 AM
HI,
You can write
delete itab where FIELD1 in ( 'BBB' ,'CCC' ). .
regards,
Lokesh.
2009 Jan 29 11:51 AM
2009 Jan 29 11:51 AM
2009 Jan 29 11:53 AM
Answer:
delete itab where fld2 eq 'AAA' or fld2 eq 'CCC'.
Thanks,
Naveen.I
2009 Jan 29 11:56 AM
Hi Naveen,
Do it this way:
delete itab where FIELD1 = 'BBB' or FIELD1 = 'CCC'.With luck,
Pritam.
2009 Jan 29 11:56 AM
Hi,
You can specify DELETE seats_tab where CARRID = 'AZ' or CARRID = 'DL'.
You cna check in same line.
tables: sflight.
select-options: p_carrid for sflight-carrid,
p_connid for sflight-connid.
DATA: BEGIN OF seats,
carrid TYPE sflight-carrid,
connid TYPE sflight-connid,
fldate TYPE sflight-fldate,
seatsocc TYPE sflight-seatsocc,
seatsmax TYPE sflight-seatsmax,
seatsfree TYPE sflight-seatsocc,
END OF seats.
DATA seats_tab LIKE STANDARD TABLE OF seats.
SELECT carrid connid fldate seatsocc seatsmax
FROM sflight
INTO TABLE seats_tab
WHERE carrid in p_carrid AND
connid in p_connid.
LOOP AT seats_tab INTO seats.
seats-seatsfree = seats-seatsmax - seats-seatsocc.
MODIFY seats_tab INDEX sy-tabix FROM seats.
ENDLOOP.
SORT seats_tab BY carrid.
DELETE seats_tab where CARRID = 'AZ' or CARRID = 'DL'.
if sy-subrc = 0.
endif.
Regards,
Sunil