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: 

Remove leading zeros in ABAP select statement

PraveenC
Discoverer
0 Kudos

Hi,

I have a below select statement in ABAP

SELECT SINGLE A,C
            FROM lt_tab INTO @DATA(tab1) WHERE B <> C.

But the Column C is having ALPHA conversion with Leading 0's. Hence, Select statement is not working as expected. Could you please help me how we can Remove leading zeros in ABAP select statement at where condition.

 

Regards,

Praveen.

2 REPLIES 2

raymond_giuseppi
Active Contributor
0 Kudos

Did you try to use sql string functions in the where clause?

  • Regular Expression LIKE_REGEXPR
  • Function TRIM that removes all trailing blanks and trailing characters that match a specified character.

Sandra_Rossi
Active Contributor
0 Kudos

SELECT is working as expected (it never considers the conversion routines, including ALPHA), but you expect to find a way to simulate the ALPHA conversion routine via an SQL function. As you may know, the available SQL functions highly depend on the ABAP version you are using, so you should indicate your ABAP version.