cancel
Showing results for 
Search instead for 
Did you mean: 

Select With Internal Table

mark_fryu
Participant
View Entire Topic
turkaj
Active Participant
0 Kudos

Hi,

The following coding should work. However, if you are in S/4HANA, then CDS views are recommended.

    SELECT vbeln
      INTO TABLE @DATA(lt_odv)
        FROM vbak .

    "Important to check, otherwise everything will be read.
    IF lt_odv IS NOT INITIAL.
      SELECT kunnr, land1
        INTO TABLE @DATA(lt_vbpa)
          FROM vbpa
            FOR ALL ENTRIES IN @LT_odv
              WHERE vbeln = @LT_odv-vbeln.
    ENDIF.

lt_odv is not a database table but an internal table. Hence the error message.