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 structure

Former Member
0 Likes
914

Hi ,

Can anyone give any knowledge about these type of structures ? :

"include structure *$a>"...generally found in old version of SAP.

Helpful answers would be promptly rewarded.

Thanks and regrds

Sudipta Das

Edited by: Durairaj Athavan Raja on Jun 30, 2008 12:24 PM to fix subject line

3 REPLIES 3
Read only

Former Member
0 Likes
794

If I got what your asking right,

the include structure statement creates the same structure the object you are referring to in the variable you are declaring.

Example:

Consider you have the following structure in your program:

DATA: BEGIN OF struct1,
             f1 TYPE c,
             f2 TYPE i,
             f3 TYPE d,
          END OF struct1.

Now let's imagine you needed another one, comprised of the very same f1, f2 and f3 fields above, plus two other fields:

DATA: BEGIN OF struct2,
             f1 TYPE c,
             f2 TYPE i,
             f3 TYPE d,
             f4 TYPE c,
             f5 TYPE c,
          END OF struct2.

The same would be accomplished if you coded

DATA: BEGIN OF struct2,
              include structure struct1. 
DATA:    f4 TYPE c,
             f5 type c,             
             END OF struct2.

It applies to internal tables as well.

Avraham

Read only

Former Member
0 Likes
794

Hi,

DATA: BEGIN OF struct,

include structure struct1.

End of struct.

we can use this in internal tables.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
794

It includes fields of another structure in the dictionary structure, adding a suffix to the field names, in your example $A : MATNR becomes MATNR$A.

Regards