‎2014 May 27 7:14 AM
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
‎2014 May 27 10:52 AM
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
‎2014 May 27 7:18 AM
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:
‎2014 May 27 7:23 AM
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
‎2014 May 27 7:25 AM
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.
‎2014 May 27 7:26 AM
Well if you created an Include program, you have to include it in its main program ?
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
‎2014 May 27 7:31 AM
‎2014 May 27 7:43 AM
‎2014 May 27 7:46 AM
For executable programs, report statement is required in the beginning.
‎2014 May 27 8:00 AM
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
‎2014 May 27 10:52 AM
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