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

Function Group and Subroutines

Former Member
0 Likes
1,452

Hi all,

I have two Function Groups.

I have a subroutine defined in one Function Group and want to use same subroutine in another Function Group.

Is there any way to do it, <u><b>without redefining same Subroutine in another Function Group?</b></u>

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
986

You can use a subroutine defined in another program using

Perform <subroutine name>(Program name).

For this you get the include name which is having the subroutine and give it in the braces.

Hope this helps.

9 REPLIES 9
Read only

Former Member
0 Likes
987

You can use a subroutine defined in another program using

Perform <subroutine name>(Program name).

For this you get the include name which is having the subroutine and give it in the braces.

Hope this helps.

Read only

0 Likes
986

Gives dump, I have Include Program.

I used like Subroutine name( include name)

Message was edited by: shital phadake

Read only

0 Likes
986

Hi,

can u paste the Dump information and your code.

Please try including the include name in the Global data defination of the Function module.

Thanks.

Read only

0 Likes
986

Try this syntax.

The program name prog is the main program for the function group you have created already.

PERFORM form IN PROGRAM prog.

Read only

anversha_s
Active Contributor
0 Likes
986

hi shital,

it is possible to use like that.

rgds

anver

Read only

Former Member
0 Likes
986

You can call the subroutine <Subroutine>(Program)

but you can't call like <Subroutine>(Include)

If you have the subroutine in include just include that in your program and you can direcly call the subroutine.

EX:

include <Include Name>

Perform <Subroutine Name>

...............

Read only

Former Member
0 Likes
986

Hi,

either define subroutines in include

and inlude in function group

include ztest.

perform abc .

perfrom add.

Function group ZFG

include ztest.

Function group ZFG1

include ztest.

<b> or</b>

perform test(prog1).

Regards

amole

Read only

0 Likes
986

This Dump is because you called the subroutine refering to the include name, you have to refer to the main program name, the basic program of the function group.

Alexandre

Read only

Former Member
0 Likes
986

Hi Shital,

If your problem is solved, reward helpful answers and close the post.

Thanks.