‎2011 Apr 12 1:25 AM
Hi
I need to modify one method on standard class. I know this question must be already answered in the forum, but i do not find this , i found how to add a new method but not how to modify a method.
I know i must go SE24: Class->Enhance->Give mi Z name implementation ; but then how insert my code into standard method ?
Does somebody can help me about how can i modify a standard method please.
Thanks & Regards
Frank
‎2011 Apr 12 6:00 AM
Hi,
You need to use implicit enhancement point to modify behavior of that method. Display that method in SE80, activate enhancement framework (Ctrl+F4) and display implicit enhancement points Edit -> Enhancement Operations -> Show Implicit Enhancement Options. You will see a line with quotes for each implicit enhancement point. For a class method you will have he start and end of method. You can use start of the method to overwrite code. Just don't forget to call exit to avoid execution of original code.
Cheers
‎2011 Apr 12 5:59 AM
>
> Does somebody can help me about how can i modify a standard method please.
Hello Frank,
To "modify" a standard method you have to use ex/implicit enhancement techniques.
You can "overwrite" the method implementation by using "overwrite method". Menu path is as follows:
Edit u2192 Enhancement Operations u2192 Add Overwrite Method
Further read on: [Enhancements to Global Classes and Interfaces|http://help.sap.com/saphelp_nw04s/helpdata/en/58/4fb541d3d52d31e10000000a155106/content.htm]
Hope this helps.
BR,
Suhas
‎2011 Apr 12 6:00 AM
Hi,
You need to use implicit enhancement point to modify behavior of that method. Display that method in SE80, activate enhancement framework (Ctrl+F4) and display implicit enhancement points Edit -> Enhancement Operations -> Show Implicit Enhancement Options. You will see a line with quotes for each implicit enhancement point. For a class method you will have he start and end of method. You can use start of the method to overwrite code. Just don't forget to call exit to avoid execution of original code.
Cheers
‎2011 Apr 12 7:04 PM
Thanks Suhas , Martin
I saw the enhancement implicit points in my standard method (one point at begin method and other point at end of method)
and i added my code at end of method and it works.
I really don't understand about 'do not forget call exit to avoid call the original class'; when i added my code in method it askme for a enhancement Z implementaction name , but i'm modifying the standard class so even i still remaining calling the standard class the method has my modyfications. Am i right ?
Thanks
Frank
‎2011 Apr 12 7:57 PM
Hello Frank,
Martin mentioned you "'do not forget call exit to avoid call the original class';" because if you use the begining of the method enhancement options for your Z implementation you don't need to execute the SAP standard code after your custom code execution. That is the reason he mentioned don't forget to call exit after your custom code.
Next question answer is "Yes".
Your new custom Z implementation will be called when the SAP standard method execution comes to that point.
Let me know if you have any questions.
Thanks,
Greetson
‎2011 Apr 13 2:00 AM
Ok i know now wich was the point.
Thanks Greetson
Regards
Frank