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

Former Member
0 Likes
1,054

HI ,

1. its a scenario like this . i am fetching all the data in an internal table . i want to restrict the material number whose thirteenth number is 3 . how can i put the where condition .

2. one more thing is i have the data in an internal table . i want to delete the records for which material numbers starts with three .

please help me on this .

regards,

magesh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,033

1. read table itab with key matnr = 13. or read table itab with key index = 13. [for internal table having a work area also]

itab-matnr =3.

modify itab index sy-tabix.

2.delete itab where itab-matnr = '3%' or '3_' [for internal tbale having same work area]

delete wa from itab where wa-matnr = '3%' or '3_' for internal table with explicit work area]

10 REPLIES 10
Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
1,033

Hi

For ur

1: u can use matnr+13(18) = '3'

then perform ur operation.

2. matnr+0(18) = '3'

perform ur operation.

Regards,

Sreeram

Read only

Bema
Active Participant
0 Likes
1,033

2. Delete itab where matnr like '3%'.

Read only

Former Member
0 Likes
1,033

Hi,

What u can do in both the cases is take the data in the internal table. then put the following code :

1. loop at itab.

if itab-matnr(13) = '3'.

delete itab index sy-tabix.

endif.

endloop.

2. loop at itab.

if itab-matnr(1) = '3'.

delete itab index sy-tabix.

endif.

endloop.

Hope this helps u.

Regards,

Himanshu

Read only

Former Member
0 Likes
1,033

Hi

1) delete itab where matnr+12(1) ne '3'.

2) delete itab where matnr(1) eq '3'.

Thanks

Sandeep

Read only

Former Member
0 Likes
1,033

'_' is an individual wildcard character, % is a wildcard.

1. where matnr like '----


3%'

2. delete where matnr like '3%'.

Read only

uwe_schieferstein
Active Contributor
0 Likes
1,033

Hello Magesh

If you want to select via SAPGUI (dialog) you have to enter '+++++++++++3*' (12x '') into the selection field. '+' means exactly one character.

If you want to select directly from the DB table then you have to translate this into:

'____________3%' (12x '_' ).

Regards

Uwe

Read only

Former Member
0 Likes
1,033

Hi

Do Like this...

1. itab-matnr+12(1) = '3'

Do your operation.

2. matnr+0(1) = '3'

Do your operation.

Reward All Helpfull Answers.....

Read only

Former Member
0 Likes
1,033

1. its a scenario like this . i am fetching all the data in an internal table . i want to restrict the material number whose thirteenth number is 3 . how can i put the where condition .

2. one more thing is i have the data in an internal table . i want to delete the records for which material numbers starts with three .

please help me on this .

regards,

magesh

1. read table itab with key matnr = 13. or read table itab with key index = 13. [for internal table having a work area also]

itab-matnr =3.

modify itab index sy-tabix.

2.delete itab where itab-matnr = '3%' or '3_'

Read only

Former Member
0 Likes
1,034

1. read table itab with key matnr = 13. or read table itab with key index = 13. [for internal table having a work area also]

itab-matnr =3.

modify itab index sy-tabix.

2.delete itab where itab-matnr = '3%' or '3_' [for internal tbale having same work area]

delete wa from itab where wa-matnr = '3%' or '3_' for internal table with explicit work area]

Read only

Former Member
0 Likes
1,033

hii magesh,

use this code

delete itab where matnr+12(1) ne '3'.

delete itab where matnr(1) eq '3'.

reward if useful

vikaas