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

Select field substring

Former Member
0 Likes
5,117

Hi,

how can i select a substring of a field ang group by the result in SAP?:

SELECT left(zbnky, 4) as bank, sum ( rbetr) as sumrbetr INTO TABLE gt_data

FROM Reguh

GROUP BY bank.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,874

xavi dont make it such a wired code..

just select required fields from reguh to your internal table.. then do the calculations...

5 REPLIES 5
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
2,874

I don't think this SELECT construct is possible in Open SQL.

You have to select data into internal table & process the records ...

Edited by: Suhas Saha on Jun 10, 2010 3:31 PM

Read only

Former Member
0 Likes
2,874

Hi xavi,

just define BANK as C, length 4 in gt_data.

reagrds

rea

Edited by: Ramy El-Arnaouty on Jun 10, 2010 4:43 PM

Read only

Former Member
0 Likes
2,874

This is something very wierd kind of question.This kind of select query I guess wont work for any Languages.

Please follow the correct syntax for select statement and if you want to sum it up do the same by taking prpoer LOOP statements.

Sany..

Read only

0 Likes
2,874

There are no weird questions, only weird people .

Of course, these kind of select is possible in other SQL languages, like PL-SQL or Transact-SQL, for example.

That's the reason why i asked this question.

Read only

Former Member
0 Likes
2,875

xavi dont make it such a wired code..

just select required fields from reguh to your internal table.. then do the calculations...