Application Development 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: 

Enhancing Function Group

former_member196023
Active Participant
0 Kudos
597

Hi Experts,

I've enhanced one function module at end by adding post-exit enhancement. Here I've added perform statement which calls a form routine written in Z-Include. This Z-Include I've added in main program of the function group with INCLUDE Statement using post-exit enhancement.

It's getting executed perfactly fine.

Now if I do syntax check only in Z-Include, it shows me syntax error saying that form routine is already exists.

But activation of the code of the same Z-Include is not giving any problem.

Is this normal behaviour?

Thanks,

Haresh

9 REPLIES 9

former_member222709
Contributor
0 Kudos
281

Hi Haresh,

This is indeed normal behaviour with reference to Function Modules. Hence, you might find posts that mention you use 'Activate Anyway' in case of a Function Group. Individual Function Modules as well as Includes do give syntax errors when you try to Activate them independently, but, once activated, you will not find the syntax errors.

This behaviour is observed because Function Modules are global within the Function Group. This is the basic difference mentioned while comparing sub-routines with Function Modules.

Hope this helps.

Regards,

Pranav.

0 Kudos
281

Thanks for taking time.

My question is somewhat different.

While activating individual z-include or standard include is not giving any syntax error. But

1. Checking syntax in standard include => doesn't give any syntax error.

2. Checking syntax in z-include => gives syntax error saying form routine is already been declared.

What do you say for this?

Thanks,

Haresh

0 Kudos
281

Thanks for taking time.

My question is somewhat different.

While activating individual z-include or standard include is not giving any syntax error. But

1. Checking syntax in standard include => doesn't give any syntax error.

2. Checking syntax in z-include => gives syntax error saying form routine is already been declared.

What do you say for this?

Thanks,

Haresh

0 Kudos
281

Hi Haresh,

I believe you have defined a sub-routine within your Z-Include or used some variables having the same names as in the Function Group. So, when you do a syntax check of the Z Include you get the error that it is already defined. But, while activating the Function Group, the system, identifies the variable defined in the Function Group as a Global Variable whereas in the Z Include it is identified as a local variable.

I think you are curious about the exact reason, which I'm unable to explain.

Regards,

Pranav.

0 Kudos
281

Hi,

As per what you said, I believe that the FORM .. ENDFORM statement for your subroutine exists inside your Z-include which is defined in your main program.

There could be a possible chance that this FORM...ENDFORM statement exists more than once in your program. See to it that this statement exists once in your Z-include. Also, check that this statement does not exist anywhere else in your function group as well as other function modules inside this function group.

Try searching your entire program using the name of your subroutine.

Also, function module will get activated using Activate Anyway.

Regards,

Danish.

0 Kudos
281

Hi,

If your writing include between function module,go to Function group->inactive objects Activate the function group.

This might help you.

Thank and Regards.

0 Kudos
281

It's not giving error for any variables, but it gives error for routine already declared. Anyways, let's hope to get this answered by some other. Thanks a lot for your efforts.

0 Kudos
281

Hi,

There is no routine exist with the same name in entire function group.

Moreover, if I activate the z-include or function group, it is not giving any syntax error. So there is no need to go for activate anyway.

Just wanted to know the strange behaviour for the error in case of syntax check in z-include.

Thanks,

Haresh

0 Kudos
281

Nope, there is no inactive objects in entire function group.