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 in itab

Former Member
0 Likes
635

hallow

I wont to now if I have a table

With 5 Colman and I wont to search the Colman and see if I have a record that I don’t wont , delete the record form my internal table delete the row

How can I do that

Ex.

score_itab

Score*weight*tttt**fff

1******22*******2***7

2 ******23******2***4

3 ******24*******2 ***5

4 ******25******2***4

the astrick is just for the ex.

If I wont to delete from my internal table score that have number 3 and wight 24 just that (<b>i wont to keep the num 2 and 5 in ttt and fff)</b>

How can I do that , I wont to do a search on my and loop and

if wa_itab_score ='3'

delete wa_itab_score and wa_itab_weight

<b>i dont wont to buield new colman

regards</b>

<b></b>

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
599

DELETE score_itab WHERE score eq '3' AND weight eq '24'.

You better put 3 and 24 inside variables -;)

Greetings,

Blag.

hallow

I wont to now if I have a table

With 5 Colman and I wont to search the Colman and see if I have a record that I don’t wont , delete the record form my internal table delete the row

How can I do that

Ex.

score_itab

Score*weight*tttt**fff

1******22*******2***7

2 ******23******2***4

3 ******24*******2 ***5

4 ******25******2***4

the astrick is just for the ex.

If I wont to delete from my internal table score that have number 3 and wight 24 just that (<b>i wont to keep the num 2 and 5 in ttt and fff)</b>

How can I do that , I wont to do a search on my and loop and

if wa_itab_score ='3'

delete wa_itab_score and wa_itab_weight

<b>i dont wont to buield new colman

regards</b>

<b></b>

4 REPLIES 4
Read only

Former Member
0 Likes
599

Hello Antonio,

DO like this


DELETE TABLE score_itab where not num in ( '2', '5') and 
                                                   not weight in ( '24'....)  
      

Hope this will solve ur problem.

Regards,

Vasanth

Read only

Former Member
0 Likes
600

DELETE score_itab WHERE score eq '3' AND weight eq '24'.

You better put 3 and 24 inside variables -;)

Greetings,

Blag.

Read only

Former Member
0 Likes
599

hi dear

U r question is very good

loop at <itaB> INTO <WA>

CHECK WA-SCORE = 3 AND WA-WEIGHT = 24

CLEAR: WA-SCORE , WA-WEIGHT .

MODIFY ITAB BY WA TRANSPORTING SCORE WEIGHT.

ENDLOOP.

**Please reward suitable points***

With Regards

Navin Khedikar

Read only

Former Member
0 Likes
599

Score*weight*tttt**fff

1******22*******2***7

2 ******23******2***4

3 ******24*******2 ***5

4 ******25******2***4

You can't modify the table if Score and Weight are primary keys.

So store the entire record in a field string

then delete the record from the table

Now change Number(Score and Weight) to initials i.e to blanks(so Make these fields as character type)

Then Number and Weight are spaces i.e; no dat -> deleted

reward if useful