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

Substitute for SUBSTRING?

Former Member
0 Likes
965

Hi,

here's a seemingly very simple question - but then, the "egg of Columbus" was easy and everyone could do it - afterwards 😉

So - I simply need to enter a WHERE condition into a SELECT command which queries the first character in a string (in my case, in the field TABNAME in DD02T, I don't want any tables beginning with '/').

Everywhere I look I read the correct syntax is [fieldname]+(length) - so I would write >> WHERE TABNAME+0(1) <> '/' << - right? Well, probably not, for that does not work. Neither does it when I use the proper OpenSQL syntax > DD02T~TABNAME <

Can anybody help me here?

Thanks a lot!

Best regards,

Sapperdapper

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
793

Have you tried

WHERE cond NOT LIKE '/%'.

Cheers,

Shambu

4 REPLIES 4
Read only

Former Member
0 Likes
794

Have you tried

WHERE cond NOT LIKE '/%'.

Cheers,

Shambu

Read only

0 Likes
793

Hi Shambu,

for the >cond< in your example, would I write TABNAME (the actual fieldname)?

To answer, no I haven't tried because I didn't know ABAP could use the % as a wildcard.

Thanks a lot!

Regards,

Sapperdapper

Read only

0 Likes
793

Yes, Cond will be TABNAME for your case.

Read only

0 Likes
793

Perfect!

The limitation on texts in just one language brings me much more of a reduction as it seems - the limitation on DDLANGUAGE = 'DE' reduces from 1,8mio to approx. 124k and this from 124k to 123k, but that is just as well.

I guess that way or in a similar way I could also exclude tabnames that have an _ somewhere? I doubt that these tables would ever be used by the average SAP user...

Thanks a lot!

Best regards,

Sapperdapper