Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Include in Structure - Use Field directly

casualCoder
Participant
0 Kudos
728

Hi,

I have included a locally defined Structure in another one.

  TYPES: BEGIN OF ty_record,
           v_begda(10),
           v_endda(10),
       END OF ty_record.

  TYPES: BEGIN OF ty_final_struc,
           INCLUDE TYPE ty_record,
           fsc     TYPE atwrt,
         END OF ty_final_struc.

TYPES: BEGIN OF ty_record,

v_begda(10),

v_endda(10),

END OF ty_record.

TYPES: BEGIN OF ty_final_struc,

INCLUDE TYPE ty_record,

fsc TYPE atwrt,

END OF ty_final_struc.

Is it possible to dissolve the Include so I can directly access the Fields?

Now, I can only access them like this:

 my_struc-include-v_begda = ''.

my_struc-include-v_begda = ''.

Background:

I want to move a filled Table to another one with more Fields in it, but with this Include Structure I cannot use MOVE-CORRESPONDING.

1 ACCEPTED SOLUTION

DominikTylczyn
SAP Champion
SAP Champion
661

Hello 2cc6e3524cb643fb927edcf872d70427

TYPES: BEGIN OF ty_final_struc.
         INCLUDE TYPE ty_record.
TYPES:
         fsc TYPE atwrt,
       END OF ty_final_struc.

Best regards

Dominik Tylczynski

3 REPLIES 3

DominikTylczyn
SAP Champion
SAP Champion
662

Hello 2cc6e3524cb643fb927edcf872d70427

TYPES: BEGIN OF ty_final_struc.
         INCLUDE TYPE ty_record.
TYPES:
         fsc TYPE atwrt,
       END OF ty_final_struc.

Best regards

Dominik Tylczynski

DominikTylczyn
SAP Champion
SAP Champion
0 Kudos
661

raymond.giuseppi If you replace 'INCLUDE TYPE' with a 'STRUCTURE', you'll get

  TYPES: BEGIN OF ty_record,
           v_begda(10),
           v_endda(10),
       END OF ty_record.

  TYPES: BEGIN OF ty_final_struc,
           STRUCTURE ty_record,
           fsc     TYPE atwrt,
         END OF ty_final_struc.

That won't even compile.

Sandra_Rossi
Active Contributor
0 Kudos
661

I'm pretty sure you've got an example in the ABAP Documentation for "INCLUDE TYPE".