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 File Concept Questions

Former Member
0 Likes
1,239

Hello All!

I am extremely new to ABAP development; most of my experience is in Windows Programming.

While building a Local Class Hierarchy in an INCLUDE file, I ran into a few "quirks". Hopefully, answers to these questions will help me understand the inter-op between REPORT files and INCLUDE Files much better as well.

**NOTE** I have searched through SAP Library, this forum (admittedly, I may have missed older threads) and Googled each topic for each of these issues and not found information that satisfactorily answered my questions. I'm hoping the experts here may shed some light on my questions.

My questions are in regard to the linking between a REPORT and an INCLUDE file. When I created the INCLUDE file, I started a new instance of SE38 and went through the option dialogs to establish the file as an INCLUDE. Then, UML in hand, I started coding. Since I am new to ABAP, I run Syntax checks regularly (Finally getting used to those periods!!!). Not suprisingly, I couldn't run a Syntax check on the include. I decided to start another instance of SE38 and open the REPORT file this INCLUDE is being built for (initially). I added the INCLUDE statement and ran a Syntax Check, Success! Ever since that point however, the quirks have been appearing.

For instance, I would like to define Text Elements local to the include file; however, when I bring up the Text Elements Screen (from the INCLUDE file), the Text Elements from the REPORT are loaded in. Is it possible to define Text Elements Local to an INCLUDE file? If not, are INCLUDE files really intended to be used by multiple REPORTs? It would seem not since it looks to be tightly coupled to the REPORT I have it included in; # this could lead to naming conflicts with Text Elements as well #.

I think I may have thought of a reason for the other quirk, but would like to run it by you all to see if I am on the mark. When I have the INCLUDE file open and attempt to activate it, if a syntax error is in the active version of the report due to the include file (i.e. Tables declared more then once), it will warn me before activating. I believe this is due to the fact that SAP will try make sure existing applications will not be harmed by changes to an include file. If this is true, then INCLUDE files must be fairly closely coupled with each REPORT they are included in. Is this correct?

Thank you for your time and consideration.

I look forward to the day I know enough to begin helping each of you as well.

Steven Coolbaugh

Edited by: Steven Coolbaugh on Jan 20, 2009 6:21 PM - Clarifying a Thought - # Delimited.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,172

Hi

U should considere the INCLUDE is just like a box can be inserted in a program (REPORT), the include can't exist without a report (the main program).

The include can be used to arrange the program: several thounsends of abap code lines can be in a program, if you split them in several includes, it'll be easier to read and manage the program.

It can group components of the same type (for example the data declaration, the routine definitions,....) into the same include, in this way it'll be easier to manage the program for the maintenaces in the future.

An include can be used by different programs, so if u need to use certain definations for many program, u can insert them in a include once and then call the include in all program u need: in this way if you update that include you'll update all program using that include.

So you'll need to insert the corrections in the include just once instead of to repeate it for every program.

Anyway all text elements used in include belongs to main program, not to the include, so u need to define it again for every program.

Max

Hello All!

I am extremely new to ABAP development; most of my experience is in Windows Programming.

While building a Local Class Hierarchy in an INCLUDE file, I ran into a few "quirks". Hopefully, answers to these questions will help me understand the inter-op between REPORT files and INCLUDE Files much better as well.

**NOTE** I have searched through SAP Library, this forum (admittedly, I may have missed older threads) and Googled each topic for each of these issues and not found information that satisfactorily answered my questions. I'm hoping the experts here may shed some light on my questions.

My questions are in regard to the linking between a REPORT and an INCLUDE file. When I created the INCLUDE file, I started a new instance of SE38 and went through the option dialogs to establish the file as an INCLUDE. Then, UML in hand, I started coding. Since I am new to ABAP, I run Syntax checks regularly (Finally getting used to those periods!!!). Not suprisingly, I couldn't run a Syntax check on the include. I decided to start another instance of SE38 and open the REPORT file this INCLUDE is being built for (initially). I added the INCLUDE statement and ran a Syntax Check, Success! Ever since that point however, the quirks have been appearing.

For instance, I would like to define Text Elements local to the include file; however, when I bring up the Text Elements Screen (from the INCLUDE file), the Text Elements from the REPORT are loaded in. Is it possible to define Text Elements Local to an INCLUDE file? If not, are INCLUDE files really intended to be used by multiple REPORTs? It would seem not since it looks to be tightly coupled to the REPORT I have it included in; # this could lead to naming conflicts with Text Elements as well #.

I think I may have thought of a reason for the other quirk, but would like to run it by you all to see if I am on the mark. When I have the INCLUDE file open and attempt to activate it, if a syntax error is in the active version of the report due to the include file (i.e. Tables declared more then once), it will warn me before activating. I believe this is due to the fact that SAP will try make sure existing applications will not be harmed by changes to an include file. If this is true, then INCLUDE files must be fairly closely coupled with each REPORT they are included in. Is this correct?

Thank you for your time and consideration.

I look forward to the day I know enough to begin helping each of you as well.

Steven Coolbaugh

Edited by: Steven Coolbaugh on Jan 20, 2009 6:21 PM - Clarifying a Thought - # Delimited.

3 REPLIES 3
Read only

Former Member
0 Likes
1,172

Sometimes tightly coupled, but not necessarily so. You can do a 'where used list' on any include. You will find that many are used in only one program, while others appear many times.

Rob

Read only

Former Member
0 Likes
1,173

Hi

U should considere the INCLUDE is just like a box can be inserted in a program (REPORT), the include can't exist without a report (the main program).

The include can be used to arrange the program: several thounsends of abap code lines can be in a program, if you split them in several includes, it'll be easier to read and manage the program.

It can group components of the same type (for example the data declaration, the routine definitions,....) into the same include, in this way it'll be easier to manage the program for the maintenaces in the future.

An include can be used by different programs, so if u need to use certain definations for many program, u can insert them in a include once and then call the include in all program u need: in this way if you update that include you'll update all program using that include.

So you'll need to insert the corrections in the include just once instead of to repeate it for every program.

Anyway all text elements used in include belongs to main program, not to the include, so u need to define it again for every program.

Max

Read only

0 Likes
1,172

Thank you for your responses.

I had not found documentation that Text Elements are "owned" by the Main program. That will be very helpful in the future. I suppose if I want a class to display literal text, it would be better for the class to return a code indicating what text it wants, with the main program using a Case statement to pick the Text element. Once again, thank you.

Steven Coolbaugh