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

How to call a Include type Report Program in Executable Program. ?

former_member203894
Participant
0 Likes
9,539

Hi experts,

I have created a Include type report program and I want to run this include program in other report program. Which abap statement should i use ?

Thanks

Saurabh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
4,282

Hi Saurabh,

We can make use of programs of Type - Include(I) in other type of ABAP Programs.

These Include programs cannot be executed directly but can be used as a part of the main program i.e Executable program - Type E.

So after creating your main program of type executable program then use the below line

REPORT ZM_SAMPLE_PROGRAM.

INCLUDE INC_PRG_NAME.


Now the code as availablein INC_PRG_NAME becomes part of the  main program ZM_SAMPLE_PROGRAM.le

Also you can make use of this Include program in other executable/include programs too...

Regards,

Rafi

9 REPLIES 9
Read only

Former Member
0 Likes
4,282

Why do you need to create Include type report program? It should always be created with Executable type.

Then u can use SUBMIT statement to call report from other programs:

Read only

former_member196651
Contributor
0 Likes
4,282

Hi Saurabh,

You can include an Include Type program in other program by using the INCLUDE addition. But I don't understand your usage. Why you had created a report program as Include Type? If your requirement was to execute a report program from another program, you can use the SUBMIT.

Regards,

Abijith

Read only

Former Member
0 Likes
4,282

Include INCL_PRGM.

But this will only include the lines of code in this include program in the current report.

To execute something in the program, example a subroutine in the include,  you have to explicitly use the perform statement in the current program.

Otherwise, the include program will not be executed.

To execute the entire program, change it from an include to executable program and use submit statement.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
4,282

Well if you created an Include program, you have to include it in its main program ?


Use an include program for the modularization of exactly one master program. It must not be integrat...

Was your actual requirement the creation of a subroutine pool, so you will be able to execute some PERFORM formname IN PROGRAM poolname or PERFORM formname(poolname) ?

Regards,
Raymond

Read only

Former Member
0 Likes
4,282

Write INCLUDE <Include program Name>.

Read only

0 Likes
4,282

HI Sandeep,

It is giving me error.

Saurabh

Read only

0 Likes
4,282

For executable programs, report statement is required in the beginning.

Read only

0 Likes
4,282

To execute any program program should begin with either report or program but in include program these keywords are not required. Create include program by using program type I then call that include program in executable program. When you will create program with type Executable program or Module pool you will automatically report or program keyword on top. there type

INCLUDE <lNCLUDE PROGRAM NAME>.

Regards

Read only

Former Member
0 Likes
4,283

Hi Saurabh,

We can make use of programs of Type - Include(I) in other type of ABAP Programs.

These Include programs cannot be executed directly but can be used as a part of the main program i.e Executable program - Type E.

So after creating your main program of type executable program then use the below line

REPORT ZM_SAMPLE_PROGRAM.

INCLUDE INC_PRG_NAME.


Now the code as availablein INC_PRG_NAME becomes part of the  main program ZM_SAMPLE_PROGRAM.le

Also you can make use of this Include program in other executable/include programs too...

Regards,

Rafi