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: 

What are the benefits of using includes in a structure?

mykola_tokariev2
Explorer
0 Kudos

Hello everyone,
my question is quit simple. I want to know, what are the benefits of using includes in a structure. For example this structure:

1 ACCEPTED SOLUTION

DominikTylczyn
Active Contributor

Hello mykola.tokariev2

I'd say the biggest advantage is re-usability. You can define one structure and include it into several tables or other structures. Also you can use the structure to define interfaces of form routines, function modules, classes.

Best regards

Dominik Tylczynski

5 REPLIES 5

DominikTylczyn
Active Contributor

Hello mykola.tokariev2

I'd say the biggest advantage is re-usability. You can define one structure and include it into several tables or other structures. Also you can use the structure to define interfaces of form routines, function modules, classes.

Best regards

Dominik Tylczynski

Hello 3a9e4ce873a94034b33dc62b0ce600ee

it is omething like a collection, witch I can reuse in other place, right?

0 Kudos

Hello mykola.tokariev2

Yes, you could see a structure as a collection of fields with their definition that you can reuse in other places.

Cheer

Dominik Tylczynski

former_member1716
Active Contributor

Hello mykola.tokariev2,

As rightly answered above they can be re-used at multiple instances. Usually an include is constructed for grouping out all required/related fields together. Being a data object they have a wide range of re-usability, few scenarios are mentioned below.

1) Used for enhancing standard SAP tables, once a include structure is created it can be used in multiple tables as part of enhancements if needed.

2) You can use them for declaring data objects in your program.

3) You can use them as interface data types in FMs, FORMS,etc

Regards!

nomssi
Active Contributor

You can also assign a GROUP to the include. With this, you have the flexibility to access the whole include as a single entity using the group name without any MOVE-CORRESPONDING logic, or directly access the single components.

Actually you can also do in code. Check the documentation for INCLUDE TYPE :

https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abapinclude_type.htm