Posted on Mar. 11, 2010 at 11.43 AM - Kuala Lumpur, Malaysia
In my recent project, there is requirement to update external (custom) identification to business partner in SAP CRM even if the IDOC replication from SAP ECC is not fully posted (status 52).
By the default, when the IDOC is not fully posted (status NOT 53 in the receiver end), then all the other exits belong to the same SAP LUW will be cancelled off. The problem over here is that, SAP standard IDOC (message type HRMD_ABA) commit the updates part by part. First, it will create the employee (created in SAP ECC) as a central person in CRM. Second, it will do certain validations like whether the name and address of the business partner to be created is unique, etc. Only after it pass the validations, the business partner is created based on the central person. Third, it will create necessary organizational data, and establish its relation to business partner. In each above mentioned part, there will be a separate database commit, as such it can happen that business partner is created but it's not linked to the organization unit, etc.
Ideally, we should bundle the exit LUW into SAP standard LUW to make sure that database integrity is always in tact. In so doing, whenever business partner is created then the external (custom) identification is also updated to it. However, SAP standard FM BAPI_IDENTIFICATION_ADD or BUPA_IDENTIFICATION_ADD requires the business partner to be created first before any external (custom) identification can be updated to it. As such, even if we can find any exit in SAP business partner creation transaction, it does not help to solve the issue.
There could be 2 solutions to this situation:
1. Bring the code to update external (custom) identification as close as possible to business partner creation. The exit will be triggered directly after the business partner created and prior to any updates or validations which may end with error and thus clear the SAP LUW buffer. If there is no SAP standard exit available to be implemented, then implicit enhancement can be considered in this case.
2. The second approach is to separate the exit LUW from SAP standard LUW. This way, whenever any error happen in the IDOC processing, it will not affect the exit LUW at all. This can be done by calling the custom RFC (remote enable) update function module by using addition 'STARTING NEW TASK'.
Life is beautiful! Let's make it meaningful and colorful!