2015 Nov 20 7:21 PM
Hi,
I had a requirement the other day to enhance a specific cycle in our SAP IS-H server, we are working on a healthcare project and we have to run a specific function whenever a service is added to a patient case which can be done from many transactions in the system so enhancing them all would not be efficient, also when i looked into an exit or a BADI that runs whenever a service is added/deleted/changed in a case i found none, so my solution was to enhance the update function module that writes the changes in the database table that stores case services so whenever a service is added i can modify the service data according to certain conditions before having the update module write the database entry, as this is my first time enhancing an update module i thought i might ask if there are any possible issues that could arise from that or if there is anything i should watch out for.
Hi,
I had a requirement the other day to enhance a specific cycle in our SAP IS-H server, we are working on a healthcare project and we have to run a specific function whenever a service is added to a patient case which can be done from many transactions in the system so enhancing them all would not be efficient, also when i looked into an exit or a BADI that runs whenever a service is added/deleted/changed in a case i found none, so my solution was to enhance the update function module that writes the changes in the database table that stores case services so whenever a service is added i can modify the service data according to certain conditions before having the update module write the database entry, as this is my first time enhancing an update module i thought i might ask if there are any possible issues that could arise from that or if there is anything i should watch out for.
2015 Nov 21 4:42 AM
Hi,
Instead of enhancing the standard FM, I would recommend you to copy the standard FM to a Z FM and do the necessary changes.
Regards,
Mounika
2015 Nov 21 8:15 AM
This is advice (known as cloning) is widely recognised as a profoundly bad idea. (There are even tools for identifying where it has been done in the past so it can be fixed). Two reasons:
First:
Second:
An enhancement (or even a modification) is a clearly identified piece of customer code. If done properly, it can be switched off and on with ease. During upgrades/patches, anything affecting this area will appear in SPAU and can be properly addressed.
For the OP - there's no special reason that Update function modules are more complex to modify than non-update FMs. You should keep any changes to a minimum and as encapsulated from the standard as possible. E.g. put all your code into a function module and call your function module as the first thing in the standard (via an implicit enhancement). There are some ABAP commands you can't use during update, but if you're just making DB operations on your Z table, that shouldn't be an issue.
However, you should also look for a user exit/BADI in the main transaction. There you might simply need to call your function module in the update task. Then it will run with all the other update function modules after a commit.
2015 Nov 21 8:40 AM
Hi,
Thank you for the clarification, at the moment i have my enhancement at the beginning of the update module but my last concern is that at some condition i am actually changing the value of one the fields passed to the update module and i am worried if there could be any inconsistencies with other SAP tables that may depend on the value of this field in this table.
e.g.
Is it possible that the system enters the value of this field in another table using another update module during the same update process because this will result the same field having 2 different values in the 2 tables and that could cause an issue?, i am asking because i am not familiar if SAP implements any checks that prevent these inconsistencies during the update process or not and i dont want to cause a big issue in production as this is going to be used alot.
2015 Nov 21 11:07 AM
All inconsistencies are checked before the commit work that triggers the update task. Therefore if you change something during the update task, there is a risk of inconsistency. You might think if the value is only used in one table, then that would be ok - but in future it might be in more.
Sometimes the risk is worth it. Other times not.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |