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

Perform in Include in User exit

former_member204025
Participant
0 Likes
4,628

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
Read only

Former Member
0 Likes
3,516

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.

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

11 REPLIES 11
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
3,516

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

INCLUDE z_my_incl.

Read only

0 Likes
3,516

Hi!

I did it.. but is not working yet

Thanks!

Gaby

Read only

Former Member
0 Likes
3,517

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.

Read only

0 Likes
3,516

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

Read only

0 Likes
3,516

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

Thanks!

Read only

0 Likes
3,516

Hi Boby!

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

Thanks,

Gaby

Read only

0 Likes
3,516

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

Read only

0 Likes
3,516

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

Read only

0 Likes
3,516

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

Read only

phanir_mullapudi
Active Participant
0 Likes
3,516

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

Thanks,

Phani

Read only

Former Member
0 Likes
3,516

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.