Reputation: 5554
I have almost 4 months learning/working in SAP. I've done several reports and enhancements all along this time but recently I began to work in a requirement which is related to Mobile Data Entry or RF and it basically consists to add the EAN and some other data to the dynpro 2502.
I made a copy of the dynpro 2502 in program SAPLLMOB into SAPLXLRF 9502, related the user exit MWMRF502 and programmed the basic functionality of it but it is not working as I expected because this exit is very limited and it only lets me import and export a small group of data and is difficult to perform exactly as the standard.
I've been searching all over internet and a lot of people make their own implementations and other just simply change the standard. I don't know how to make my own implementation cause I don't understand all the process within and the alternative of changing the standard code would be better for performance and time spent in development but as I quoted I would have to change the standard code and that's something I would like to do only if there's no other option.
But the question is ¿Is it OK to change the standard? ¿How often is the the standard code changed in SAP implementations? ¿What would be the better alternative?
Thanks in advance.
Upvotes: 2
Views: 8650
Reputation: 13628
[TL;DR] Implement user exits, never do a copy of standard except if extremely simple, do modifications of standard if not too complex, else create from scratch. Do database changes only via BAPI or Batch Input.
This answer is based on my experience in the software SAP R/3, SAP ERP, SAP ECC and S/4HANA (not considering the Public Cloud and Clean Core approaches).
My opinion relies on considerations discussed by SAP in the following notes (the access is limited to the clients with a maintenance contract):
SPAU
), the modifications made on the standard can be automatically or semi-automatically reapplied on upgrade, while it's fully manual for a program copy.The big advantage of modifications over copies is that they are automatically detected during an upgrade and there's a tool to merge the modifications, while copies are completely ignored and there is no tool to detect them.
The modification key is not an obstacle to do a modification of standard:
Of course, user exits should be preferred over copies and modifications as far as possible.
The user exits are usually documented in the transaction code SPRO
.
If in doubt, the "major" user exit technologies may also be identified by developers during the execution of the program to be enhanced:
CALL CUSTOMER-FUNCTION
.SE18
and SE19
)
CL_EXITHANDLER=>GET_INSTANCE
.GET BADI
and CALL BADI
.FIBF
, BERE
and BERP
): add a Breakpoint at the start of the function modules BF_FUNCTIONS_FIND
and PC_FUNCTION_FIND
.Note that the debugger may not stop by default at breakpoints inside background processes, Update Tasks, etc. Workarounds: run background processes in foreground (search SM37
and JDBG
), activate the Update Debug setting. Some debug workarounds are very specific and can't be all discussed here.
The Enhancement Framework is to be considered as a modification of standard because the clients may change the standard behavior in an uncontrolled way (i.e. which may lead to database inconsistencies). The user exits are less prone to this type of consequence.
Upvotes: 0
Reputation: 69663
Your options are, from most to least desirable:
PERFORM formname IN PROGRAM originalprogram
. The main problem with this method is that after a new release, your program might no longer behave as expected. You will have to look at the new version of the program and see if there are any changes you need to port to your version. And there is nothing in the SAP standard that assists you with this maintenance task. So you are responsible to keep a list of all your copies of standard programs.Upvotes: -1
Reputation: 3687
You are asking the right sort of questions and it is good that you are not just plowing ahead without thinking about the consequences of what you are doing. Keep researching!
As far as changing the SAP standard goes, you generally do not want to copy an object to change it. For screens SAP quite often creates a user-exit with a sub-screen that can be modified by the customer. For Web-Dynpro you can use enhancement points and/or bADI's to extend the functionality.
Try to look for one of the following:
There are a lot of documentation on sdn.sap.com as well as within the SAP help regarding the topics above.
If none of are available, you may have no other choice but to modify (repair) the SAP standard objects. In order to be able to change the SAP standard you need to register the object(s) that you have to change on SAP OSS and get a repair key that the system needs to allow you to make changes. Always ensure that the SAP Modification Assistant is switched on when making changes, this will make your life a lot easier when you patch or upgrade your system.
If at all possible try to find an experienced ABAP programmer to help you with this.
Also see this question regarding changing SAP standard code:
Edit: Thomas Weiss on SDN has a helpful blog series on the enhancement and switch framework.
Upvotes: 3
Reputation: 2942
Always make sure that there's absolutely no other way to implement the functionality you need. If you're sure about that, then either write your own implementation from scratch, or simply change SAP's code. Just don't copy SAP's programs to the customer namespace, because I can guarantee you that that'll turn into a maintenance nightmare. You'll have to decide yourself whether the size of the change is worth the time building your own implementation, or changing SAP's.
If you decide to change SAP's code, keep in mind that all changes will pop up for review when the system is upgraded, which will take time to evaluate and adjust to the new SAP code.
Upvotes: 4