Skip to Content
0
Feb 16, 2022 at 03:21 PM

MOVE-CORRESPONDUNG to fill a 1 column table - simpler data definition?

105 Views Last edit Feb 16, 2022 at 03:22 PM 2 rev

I have a table with many columns, and I want to fill a table with exactly 1 column from it.

If I define my 1-column table like this:

    TYPES: BEGIN OF lty_ordid,
             ordid TYPE /scmb/odm_ordid,
           END OF lty_ordid.
    DATA: lt_ordid TYPE TABLE OF lty_ordid.

Both if those work fine:

    MOVE-CORRESPONDING mt_big_table TO lt_ordid.
    lt_ordid = CORRESPONDING #( mt_big_table ).

But I dislike that I need 4 lines of code for the declaration, so my question is, what is a simpler way?

(Just using

DATA: lt_ordid TYPE TABLE OF /scmb/odm_ordid.

doesn't work, as the column then is not named "ordid" )