Application Development 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 type in another structure

dhirendra_pandit
Active Participant
0 Kudos

Hi,

i am declaring on structure like

begin of struct dd,

first type c,

second type c,

end of struct dd.

and i want to use this structure into second on like this

begin of struct2,

icon type icon-id,

include type dd,

end of struct2.

It shows no errors but the problem is to access the second structure like this

data : wa_test type struct2.

wa_test-first = something.

it shows the error message "can't find field first in sructure".

Can you please specify how to assign the value into include fields.

Regards

Dhirendra

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Try like this

wa_test-include-first = something.

Regards

4 REPLIES 4

Former Member
0 Kudos

Try like this

wa_test-include-first = something.

Regards

0 Kudos

Hi,

It should be accessed this way:

 wa_test-dd-first = something.

BR/Yogesh

former_member222860
Active Contributor
0 Kudos

Use this

data:begin of dd,
      first(10) type c,
      second(10) type c,
    end of dd.

data:begin of struct2,
      icon type icon-id.
      include structure dd.
data: end of struct2.

data: begin of wa_test occurs 0.
        include structure struct2.
data:  end of wa_test.

wa_test-first = 'something'.
append wa_test.

loop at wa_test.
  write:/ wa_test-first.
endloop.

Former Member
0 Kudos

Hi,

if we want to access the fields of first which are included in second structure, we have use.

try this...

wa_struct2-dd-first = something.

Thanks.