2010 Jun 25 1:46 PM
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
2010 Jun 25 1:55 PM
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.
2010 Jun 25 1:48 PM
Try adding the include statement at the beginning of your user-exit include i.e.;
INCLUDE z_my_incl.
2010 Jun 25 1:49 PM
2010 Jun 25 1:55 PM
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.
2010 Jun 25 2:03 PM
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
2010 Jun 25 2:05 PM
try to create your perform inside the same include or userexit,instead of new include .
Thanks!
2010 Jun 25 2:07 PM
Hi Boby!
I've tried, but doesn't allow me do to that, only shows me a new Include.
Thanks,
Gaby
2010 Jun 25 2:17 PM
Try to copy paste your form routine from New include to ur existing include where the perform resides at the bottom .
2010 Jun 25 3:19 PM
Hi Boby... I did it... I see the same problem about End Function
2010 Jun 25 4:22 PM
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
2010 Jun 25 5:52 PM
Try to create a class with a Public method with your logic & call it. letme know.
Thanks,
Phani
2010 Jun 25 8:22 PM
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.