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 module cannot find right subroutine in include

Former Member
0 Likes
1,702

Hi Guys,

in my function module there is a subroutine that is implemented in two different includes but with different number of parameters. How can i make my function module to choose the right one. It is jumping to the wrong one. The 2 includes are of course in the same function group.

Thanks

8 REPLIES 8
Read only

Former Member
0 Likes
1,369

You can rename the subroutines to avoid confusion.

Having 2 subroutines of same name but different parameters is not allowed, and I wonder why your program passed the syntax check.

Read only

0 Likes
1,369

Hi,

I have just copied a working programm and would like to make some changes. The two subroutines are in differents include. Everything worked fine in the old programm. I just need to activate this one and add more code to it.

HELP!!!!

Read only

former_member188827
Active Contributor
0 Likes
1,369

when you call perform, give include name as well.

   PERFORM subroutine_name(include_name).

Regards

Read only

Former Member
0 Likes
1,369

Maria,

It is better to give different performs names to avoid confusion. Later it might be difficult to identify issues.

Thanks.

Read only

Former Member
0 Likes
1,369

Hi,

You should not be able to compile such a FM because of the duplicate name. The only option should be to use the PERFORM subroutine_name(include_name) but I personally don't like it.

Regards,

David.

Read only

Former Member
0 Likes
1,369

Hi Maria,

I think it is not possible to have the same FORM name two times in the same program or function group. This should cause a syntax error, when all includes are active.

You have to rename the FORM names then.

Regards,

Klaus

Read only

venkateswaran_k
Active Contributor
0 Likes
1,369

I wonder how the Function module activation passes the syntax text.

1. Open it in SE80 and activate the whole module.  And check if the activation is successful or not.

2.  Secondly,  it is good to have a different subroutine name instead of single name.   ( I do not see an polymorphism in ABAP )

Regards,

Venkat

Read only

0 Likes
1,369

Hi all,

the code has been working like that for years and I prefer not to  change anything. What I did, was to copy what I needed locally for my own implementation. I will then transfer to the new function modules only not the includes(they are already in used) when my test is done. So what I need to know now for my local test is if

PERFORM subroutine_name(include_name) is the best alternative now. I dont want to change a working code that is used by many differents programs.