on 01-25-2008 8:21 AM
Hi Experts,
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
Regards,
Paramjit
Hi Paramjit,
The problems that you are experiencing are probably caused by the fact that the save-event of the SD partner is triggered after the event that you're using to send the additional data to CRM.
This means that whatever you do, you can never be sure that your update is send after the creation bdoc of the business partner, nor can you create dependencies between both bdocs.
So I would propose the following:
- event CRM0_200 is the last one before the data is sent to CRM: use it to capture the plant (by reading it from the database) and add it to the bapictms structures (new Z segment) of the business partner update. This way, the data is sent to CRM along with the data to create the business partner.
- use event smoutil2 (or 3: one of them is the correct one) to extract the information from the BAPI-tables in CRM and create a new bdoc, which you queue after the one that is created by the CRM system. That way you know that the relationship is processed after the business partner creation.
Regards,
Michael.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Micheal,
Thanks for your help. I have done exactly same what you have suggested but now I am facing the problem that when I enqueuing my own (new) bdoc in process smoutil3 then actual BUPA_MAIN bdoc will not trigger instead my bdoc trigger but that to have in intermediate state. Because it takes DDIC classic and regular part as BUPA_MAIN bdoc.
Please guide me how to queue my bdoc in process so that bdoc BUPA_MAIN should also trigger before my bdoc.
Regards
Paramjit
Hi Michael,
The code that I am using in smoutil3 as follows
( Zmbdoc_ddp is my bdoc structure and zddp_ext is extension part )
DATA message TYPE zmbdoc_ddp000 VALUE IS INITIAL.
FIELD-SYMBOLS <bdoc> TYPE zmbdoc_ddp000.
DDIC type part
DATA message_ext TYPE zddp_ext VALUE IS INITIAL.
FIELD-SYMBOLS <ddic> TYPE zddp_ext.
segment data
DATA segment_line TYPE LINE OF zmbdoc_ddp000-zddp_root.
DATA ext_line TYPE LINE OF zddp_ext-zddp_root.
DATA transfer_structure TYPE transfer_structure_t.
DATA lv_task TYPE c.
DATA itab LIKE transfer_structure OCCURS 0 WITH HEADER LINE.
DATA ls_zddp TYPE zddp.
DATA: lv_header TYPE smw3_bdoc,
lt_header TYPE SMW3_FHD.
*----
CODING -
CREATE REFERENCES
Create a reference for all
BDoc part, regardless if they are filled or not!
CREATE DATA ref_message LIKE message.
ASSIGN ref_message->* TO <bdoc>.
<bdoc> = message.
CREATE DATA ref_message_ext LIKE message_ext.
ASSIGN ref_message_ext->* TO <ddic>.
Moving all data container of bapmatics into mBDoc
LOOP AT ti_bapimtcs WHERE tabname = 'ZDDP'.
fill classical mBDoc part
MOVE ti_bapimtcs-data TO ls_zddp.
MOVE ls_zddp-kunnr TO transfer_structure-p1.
MOVE ls_zddp-vwerk_new TO transfer_structure-p2.
MOVE ls_zddp-vwerk_old TO transfer_structure-p3.
Handle TASK value
CASE e_bapicrmdh2-dwnloadtyp.
WHEN 'I'.
lv_task = 'I'.
WHEN 'D'.
lv_task = e_bapicrmdh2-delta_op.
ENDCASE.
Fill the extension of the mBDoc
ext_line-data-kunnr = transfer_structure-p1.
ext_line-data-vwerk_new = transfer_structure-p2.
ext_line-data-vwerk_old = transfer_structure-p3.
IF lv_task <> c_insert.
ext_line-datax-kunnr = 'X'.
ext_line-datax-vwerk_new = 'X'.
ext_line-datax-vwerk_old = 'X'.
ENDIF.
ext_line-control-task = lv_task. " e_bapicrmdh2-delta_op.
APPEND ext_line TO <ddic>-zddp_root.
ENDLOOP.
CALL METHOD cl_smw_mflow=>set_header_fields
EXPORTING
in_bdoc_type = 'ZMBDOC_DDP'
IMPORTING
out_header = header.
Regards,
Paramjit
Hi Paramjit,
You could try to seperate the code to call the additional bdoc in a seperate LUW.
Use the qRFC framework to create an inbound queue with the same name as the one that you're processing and create your new bdoc in there. That way, the standard bdoc will be processed before the system starts with the new queue-entry.
checkout:
http://help.sap.com/saphelp_crm60/helpdata/en/f0/225c3c60065627e10000000a114084/frameset.htm
Regards,
Michael.
Hi Param,
I have a similar requirement. Can you help me providing the complete step by step procedure to be followed. This would be of great help to me.
Thanks
Shwetha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please refer notes and see if this helps 872533
regards,
Muralidhar Prasad Chatna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you sure you want to download them with your own BDoc? I would try the following:
Download the plants with DNL_PLANT as a business partner into the BP role BBP003 (?). The relationship from BP to plant in R/3 should be maintained as a partner role, which is mapped against a partner function in CRM with the same name. The partner function has then a relationship category assigned which contains the ZPLANT relationship. And then everything should work fine and without programming ...
But according to your original problem: You need to find out the event time in R/3 when the BUPA_MAIN is triggered and schedule the calling time of the creation of your BAPIMTCS structure accordingly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Paramjit
Thanks for the answer and clarification. Regarding your question: No, the middleware is designed in a way that you have no influence in delaying BDocs. However, there are some options:
1. Of course you can go an debug and modify deep inside the code (without any SAP support, and I never heard that this has been done successful), but as the side effects are pretty heavy and the effort quite high this is definitely a no go in my eyes.
2. You can write a report reprocessing your BDocs that run on the error. While this is only removing symptoms,and the errors still arise, it is a way better and supported solution
3. Ideally as mentioned above you need in R/3 to influence the time you send the data to CRM: As this is done via BTE's, you have to find out the point of time the standard data is sent and the schedule the sending of your data accordingly. In CRM then you would not need to do anything with the current code.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.