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: 

Perform in Include in User exit

former_member204025
Participant
0 Kudos

Hi guys!

I'm working in a user exit, and I have to repeat some part of the same code, depending of some values, and I would like to put it in a Perform... When I create a perform, It does in a new Include, I active the new include with the form, but when I come back to my original Include -The uSer exit's include- is says that there is a mistake and I'm not able to activate the Include... could you please explain to me what is the mistake? It says that there is not EndFunction.

Thanks!

Gaby

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You can go for Macro instead of subroutine if the repetitive code is simple enough.

The macro definition DEFINE .... END-OF-DEFINITION can be just before your repetitive code starts.

Only downside is that you wont be able to debug statements within the macro.

11 REPLIES 11

SuhaSaha
Advisor
Advisor
0 Kudos

Try adding the include statement at the beginning of your user-exit include i.e.;

INCLUDE z_my_incl.

0 Kudos

Hi!

I did it.. but is not working yet

Thanks!

Gaby

Former Member
0 Kudos

You can go for Macro instead of subroutine if the repetitive code is simple enough.

The macro definition DEFINE .... END-OF-DEFINITION can be just before your repetitive code starts.

Only downside is that you wont be able to debug statements within the macro.

0 Kudos

Hi Manish!

What I should do, is show an ALV depending of the validation, so, I have to repeat the call functions, and the sentences in order to prepare the fieldcat and layout, in order to show the alv, that's why I need a perform. Is the same thing? I've never used before a define - End of Definition.

Please let me know.

Thanks!

Gaby

0 Kudos

try to create your perform inside the same include or userexit,instead of new include .

Thanks!

0 Kudos

Hi Boby!

I've tried, but doesn't allow me do to that, only shows me a new Include.

Thanks,

Gaby

0 Kudos

Try to copy paste your form routine from New include to ur existing include where the perform resides at the bottom .

0 Kudos

Hi Boby... I did it... I see the same problem about End Function

0 Kudos

You cannot insert FM / Method / Subroutine / Module inside other FM / Method / Subroutine / Module i.e. nesting in not allowed for them .

If your User exit include is part of any of them , then you can not create any Subroutine in that user exit include .

Regards,

Tushar

phanir_mullapudi
Active Participant
0 Kudos

Try to create a class with a Public method with your logic & call it. letme know.

Thanks,

Phani

Former Member
0 Kudos

Hi,

In the attributes section of the user exit you should be able to find out the function group for this user exit. Every user exit function group has a include ZXV****ZZZ where we can put our custom subroutines or forms.

If you function group is ***, then inside include ZX**ZZZ, you can add your subroutine in another include Z***F01.

You should then be able to the subroutine (Form) in your user exit.

Thanks,

Ganesh.