Application Development 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: 

deleting a field if it contains a alphabet letters.

Former Member
0 Kudos

Hi ,

i am having an internal table with a field. That field contains digits alone, aphabets alone, and values with decimal places.

I want to check if that field contains any alphabet letters i want to delete that.

can anyone explain me with an example.

I tried

itab-field CA 'abcdefghijklmnopqrstuvwxyz'.

delete itab index sy-tabix.

But it is not deleting. It is checking for the whole alphabets. I want to delete if it contacins anyone of the alphabet from a to z.

Please help me on this.

regards,

Phyrose.

4 REPLIES 4

Former Member
0 Kudos

use sy-abcde

loop at itab.

if itab-field CA sy-abcde.

delete itab index sy-tabix.

endif.

endloop.

former_member186143
Active Contributor
0 Kudos

look at command regex for finding patterns

see

https://forums.sdn.sap.com/click.jspa?searchID=6000474&messageID=4059829

kind regards

arthur

Message was edited by:

A. de Smidt

JozsefSzikszai
Active Contributor
0 Kudos

hi Camila,

pls. try:

IFitab-field CN '0123456789.'.

==>delete is done here

ENDIF.

this is the opposite (pls. note that dot stands for the decimal point, canbe coma as well)

on the other hand I think what you wrote you have to change to capitals:

CA 'ABCD....etc.

hope this helps

ec

Former Member
0 Kudos

create a range for A to Z alphabets...

(both small and capital)

in ITAB loop....

check if that itab field containg any aplhabet in this range...

then delete the record from itab...