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

Insert include program in a main program dynamically

former_member188829
Active Contributor
0 Likes
2,680

Hi All,

I would like to add one 'Z' INCLUDE program in my 'Z' Executable Program. Is there any Standard Function module or Class and Method or any other option available?

Example:

Include Program name:ZINCLUDE (which is already existing in SAP)

Standard Program Name: ZEXECUTE (which is already existing in SAP)

Now, I want to insert include program ZINCLUDE in my executable program ZEXECUTE.Could you please sugget me on this?

Thanks,

Vishnu.

6 REPLIES 6
Read only

Former Member
0 Likes
1,909

Hi Visnu ,

Have u tried simply declaring zinclude in ur zexecute program .

Include zinclude just after data declarion .

hope yhis will help .

regards

ranjan

Read only

0 Likes
1,909

Hi Ranjan,

Thanks for your reply.

I do NOT want to do it manually. I need to do it through my program.

Thanks,

Vishnu

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,909

Not sure about your requirement.

You can have alook at [Insert report/Generate subroutine|http://help.sap.com/saphelp_nw04/helpdata/en/9f/db996e35c111d1829f0000e829fbfe/content.htm]

Read only

0 Likes
1,909

Hi Keshav,

Thanks for your reply, I will just look at the SAP help which you have provided and get back to you.

Thanks,

Vishnu.

Read only

0 Likes
1,909

Hi All,

Below is the samle program which i did for my requirement.

DATA:itab TYPE TABLE OF string,
     wa_tab LIKE LINE OF itab,
     lv_string TYPE string.
* Read the data from already existing Executable Program
READ REPORT 'YVISHNU_TEST127' INTO itab.
IF sy-subrc = 0.
* Append Include program to itab
  lv_string = 'INCLUDE ole2incl.'.
  wa_tab = lv_string.
  APPEND wa_tab TO itab.
  BREAK 50120c1941.
* Insert Main program by Including above Include program
  INSERT REPORT 'YVISHNU_TEST127' FROM itab.
ENDIF.

Thanks for your help.

Thanks,

Vishnu

Read only

Former Member
0 Likes
1,909

Hi

You Can create a insert program.

There append the include program into the code.

Regards

Ajit