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: 
Read only

Include in Structure - Use Field directly

casualCoder
Participant
0 Likes
2,343

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
Read only

Dominik_Tylczynski
SAP Champion
SAP Champion
2,276

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

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
Read only

Dominik_Tylczynski
SAP Champion
SAP Champion
2,277

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

Read only

Dominik_Tylczynski
SAP Champion
SAP Champion
0 Likes
2,276

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.

Read only

Sandra_Rossi
Active Contributor
0 Likes
2,276

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