Monday, December 18, 2017

Short Form for Structured Row Types

When internal table is constructed using constructor expression like VALUE and the row type is of structured type, a short form can be used to specify line_spec.

It is useful when most columns of lines to be inserted are same and only some differ.

DATA lt_vbeln TYPE RANGE OF vbeln.

"normal form

lt_vbeln = VALUE #( ( sign = 'I' option = 'EQ' low = '11' )

                    ( sign = 'I' option = 'EQ' low = '22' )

                    ( sign = 'I' option = 'EQ' low = '33' ) ).

"short form

lt_vbeln = VALUE #( BASE lt_vbeln

                    sign = 'I' option = 'EQ' ( low = '44' )

                                             ( low = '55' )

                                             ( low = '66' ) ).

No comments: