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

dhirendra_pandit
Active Participant
0 Likes
947

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

Former Member
0 Likes
896

Try like this

wa_test-include-first = something.

Regards

4 REPLIES 4
Read only

Former Member
0 Likes
897

Try like this

wa_test-include-first = something.

Regards

Read only

0 Likes
896

Hi,

It should be accessed this way:

 wa_test-dd-first = something.

BR/Yogesh

Read only

former_member222860
Active Contributor
0 Likes
896

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.

Read only

Former Member
0 Likes
896

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.