Skip to Content
1

Determine Internal Table Type using inline declaration

Dec 12, 2016 at 11:56 AM

90

avatar image

Hi Experts,

Is it possible to determine the type of internal table while we declare inline internal table in select statement. By default it is coming as standard internal table.

Ex

Select field1, field2 from DBtable into table @data(itab).

**/- I need itab to be sorted internal table. I know that sorted, hashed table needs to be/can be further qualified with unique/non-unique sorted keys. But anyways of achieving the same using inline declaration as of 7.40 or 7.5 or any future plans to bring the same. 
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Horst Keller
Dec 12, 2016 at 12:02 PM
2

Up to now, the answer is no.

Share
10 |10000 characters needed characters left characters exceeded
Philip Davy Dec 12, 2016 at 12:26 PM
0

Horst Keller,

I really appreciate your quick answer. You people did a great job by introducing great features in ABAP and your timely response for the ABAP 7.40/50 related queries is highly commendable. :) :)

PS: Ever had any internal discussion/thought about the query which I raised. Because sometimes it looks strange that you can have inline declaration for standard table but not for others.

Share
10 |10000 characters needed characters left characters exceeded
Horst Keller
Dec 12, 2016 at 05:00 PM
0

Ever had any internal discussion/thought about the query which I raised.

Of course, but there's so much to do.

A very dirty workaround:

IF 'X' = 'Y'.
  SELECT SINGLE ... 
         FROM ... 
         WHERE 'X' = 'Y'
         INTO @DATA(wa).
ENDIF.

DATA itab LIKE ... TABLE OF wa WITH ...

SELECT ...
       INTO TABLE @itab.
Share
10 |10000 characters needed characters left characters exceeded