I am doing one object in middleware replication of delivery plant from R/3 to CRM. As you know there is relationship for ship_to and default delivery plant in R/3 but this is not present in CRM. For solving that problem we have created relationship category 'ZPLANT' in CRM and replicate the delivery plants in CRM as BP. So we are able to create the relationship manually in CRM.
But our client wants delta load for replication means whenever default delivery plant enters in ship_to in R/3 then that should create relationship in CRM between ship_to and delivery plant with relationship category 'ZPLANT'.
To solve this, I have created New MBDOC and all other function module like mapping fm, validation fm etc. required for MW steps R/3 as well as CRM. To initiate the delta load, I have used user exit DE_EIOUT (process event) for running my download fm to create BAPIMTCS structure and call mBDOC.
Now problem for me is that this download is working perfectly when I am adding, changing or deleting delivery plant in ship_to.
But it is giving problem when delivery plant is being added while creation of ship_to. Means my BDOC runs before BUPA_MAIN creation of ship_to in CRM and show error 'BP (ship_to) does not exists in system'.
Please help me what should I do so that my BDOC will run after BUPA_MAIN.
Is there any functionality of delaying the BDOC for few seconds?
Though it is a very long story and I feel sorry for that. I will appreciate your effort for helping me