Skip to Content

Determine Internal Table Type using inline declaration

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. 
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Dec 12, 2016 at 12:02 PM

    Up to now, the answer is no.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 12, 2016 at 05:00 PM

    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.
    
    Add comment
    10|10000 characters needed characters exceeded

  • Dec 12, 2016 at 12:26 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded