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

Help sql substring column

Former Member
0 Likes
808

Hi All,

I'm tying to execute this query

selecy matnr (sonum,1,10) as zsonum1 (sonum,11,16) as zsinum2 gesme

INTO CORRESPONDING FIELDS OF TABLE wt_stabr

from linv.

In other words I wish to split the sql field sonum (16) into two fields of my internal table (zsonum1 (10) and zsonum2 (6).

I can't execute the query because I have a sintax error about the comma.

Any help will be well appreciated.

Thanks in advance for your kind support.

Luigi

1 ACCEPTED SOLUTION
Read only

OttoGold
Active Contributor
0 Likes
652

hello, what would be the benefit of doing that in the SELECT statement? You can do that easily in the following ABAP code. I would never ask this question, because I know that I cannot do any complex mathematical operations with ABAP which would be much easier to implement and nobody has ever done that:)) I am sorry to tell you, this is 99,5% not possible and will not be possible in the future of SAP:)))

Regards Otto

4 REPLIES 4
Read only

Former Member
0 Likes
652

Hi All,

I wish to launch this query

SELECT substr(sonum,1,10) as ZSONUM1 substr(sonum,11,16) as ZSONUM2

FROM linv.

Is it possible?

Any help will be well appreciated.

Thanks.

Luigi

Read only

Former Member
0 Likes
652

Hello,

I dont think there is any such provision in ABAP to split the column value directly in the select query. The only option is to select the fields as they are and do the spliting and manipulations manually after the select query.

Vikranth

Read only

OttoGold
Active Contributor
0 Likes
653

hello, what would be the benefit of doing that in the SELECT statement? You can do that easily in the following ABAP code. I would never ask this question, because I know that I cannot do any complex mathematical operations with ABAP which would be much easier to implement and nobody has ever done that:)) I am sorry to tell you, this is 99,5% not possible and will not be possible in the future of SAP:)))

Regards Otto

Read only

Former Member
0 Likes
652

This message was moderated.