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

calling subrotine from include program

Former Member
0 Likes
5,267

Hi friends ,

I have written one subroutine(tr_stock) in the include(LYGRIFF01) program. this include is used in the function module.

now same subroutine functionlaty i want to use in the other program type E.

i have written the code as below but program is giving dump with the below error msg:

PERFORM tr_stock(LYGRIFF01)

TABLES lt_item

gi_return_s

USING gw_head.

error msg in dump: Program "LYGRIFF01" is type I and therefore cannot be generated.

how can i call the above subroutine in my program.

Thanks

Ramesh

3 REPLIES 3
Read only

Former Member
0 Likes
1,490

Hi ,

u can also call like this

PERFORM tr_stock in program LYGRIFF01

TABLES lt_item

gi_return_s

USING gw_head.

regards

Prabhu

Read only

Former Member
0 Likes
1,490

You have to call the main program, not the include program.


PERFORM tr_stock(LYGRIFF01) "<-----this should be main program
TABLES lt_item
gi_return_s
USING gw_head.

Find out the Include program's main program and use that in the perform.

PERFORM tr_stock(MAINPROGRAM)
TABLES lt_item
gi_return_s
USING gw_head.

Read only

Former Member
0 Likes
1,490

Hi,

this is main program..

REPORT ZPROGCALL.

include ZINCLUDE.

start-of-selection.

perform abcd IN PROGRAM ZINCLUDE.

this is include program...

form abcd.

write : 'include program'.

endform.

Hope Helpfull

Raghunath.S