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

Why cant I use include structure in type or data declaration?

Former Member
0 Likes
409

I just read in one of the SAP standards documents that we should avoid using

Incorrect:

Data: BEGIN OF S_MATERIAL.

INCLUDE STRUCTURE MARA.

Data: END OF S_MATERIAL.

Instead the recommended option is as follows

Recommended:

DATA: S_MATERIAL TYPE MARA. Even if the structure has other components, it can be written as

Data: BEGIN OF S_MATERIAL,

ZMARA TYPE MARA,

S_AFSMAT TYPE J_3AMAD,

component2,

END OF S_MATERIAL.

Why is it so? Can anybody please explain?

Thanks for reading.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
342

Data: BEGIN OF S_MATERIAL.

INCLUDE STRUCTURE MARA.

Data: END OF S_MATERIAL.

Answer: Dumps you whole structure of MARA in your program.

Recommended:

DATA: S_MATERIAL TYPE MARA. Even if the structure has other components, it can be written as

Answer: References the whole MARA structure during run mode and good for performance.

1 REPLY 1
Read only

Former Member
0 Likes
343

Data: BEGIN OF S_MATERIAL.

INCLUDE STRUCTURE MARA.

Data: END OF S_MATERIAL.

Answer: Dumps you whole structure of MARA in your program.

Recommended:

DATA: S_MATERIAL TYPE MARA. Even if the structure has other components, it can be written as

Answer: References the whole MARA structure during run mode and good for performance.