08-27-2013 11:40 AM
Hi All,
I am calling BAPI_MATERIAL_SAVE_DATA inside my BTE 1250 FM sample_inetrface_00001250 , to update Z-fields in amterial master (MVKE-Zfield). But the issue I am facing is that BAPI_MATERIAL_SAVE_DATA agains triggeres the BTE , and this goes on and on. Is there any way to avoid the BAPI call second time from the BTE or is the basic design itself flawed?
This development is an inbound IDOC process code , from which the BTE is triggered and I have to add validation and update material master inside the BTE. Kindly help.
BR,
Shankar.
08-27-2013 1:18 PM
You should add some check in the triggered FM like CHECK I_MARA_NEW NE I_MARA_OLD or similar check ?
Regards,
Raymond
08-27-2013 1:18 PM
You should add some check in the triggered FM like CHECK I_MARA_NEW NE I_MARA_OLD or similar check ?
Regards,
Raymond
08-27-2013 2:53 PM
Thanks Raymond . I have put in the check for I_MVKE_OLD-ZFIELD <> I_MVKE_NEW-ZFIELD and it is working for a normal scenario. I am now checking for all my unit test cases.
BR,
Shankar.
08-28-2013 1:11 PM
Hi All,
From the indbound IDOC process code , the FM 'IDOC_WRITE_AND_START_INBOUND' is called which triggers the BTE 1250 FM 'sample_interface_00001250' the first time. Inside this BTE FM , I am calling BAPI_MATERIAL_SAVE_DATA to update material master MVKE-Zfield. This BAPI again triggers the BTE and the BTE again the BAPI and this goes on. Now if I place a check on I_MARA_NEW <> I_MARA_OLD, the BTE FM does not gets processed at all the first time it is called from FM 'IDOC_WRITE_AND_START_INBOUND'. Is my design itself wrong ?
Also just for my knowledge sake, can someone let me know how does the FM 'IDOC_WRITE_AND_START_INBOUND' trigger the BTE 1250 , since this BTE is only for material master update ? I went through the stack flow and obserevd that the FM 'BAPI_MATERIAL_SAVEREPLICA' is triggered by this FM . How does this happen and where is the configuration mainatained for this?
BR,
Shankar.
08-28-2013 10:26 PM
Hi Shankar,
What is the Process Code your using to process the Inbound IDOC?
- BTE Event 1250 will only once when Material Data is posting after all the validation. If the custom FM which is linked to the EVENT 1250 is triggering then check the where used list and correct it.
If you still not able to fix it. Let me know the IDOC and Process code details to help you on this.
08-29-2013 9:02 AM
Hi Saravanan,
First time my BTE 1250 FM gets triggered from the FM 'IDOC_WRITE_AND_START_INBOUND' . Then inside this BTE FM , I am calling BAPI_MATERIAL_SAVEDATA to update other materials which are fetched based on some Z field in I_MARA_NEW of the original material for which the BTE was triggered the first time. Now this BAPI material save data is again triggering the BTE and the BTE again the BAPI etc.
I guess BAPI_MAERIAL_SAVE_DATA should not be called inside the BTE FM. That itself is wrong. PLs let me know your opinion.
BR,
Shankar.
08-29-2013 8:17 PM
Shankar,
I think you should not call BAPI in BTE function module. Check the User Exit in IDoc process code to populate the value to custom field. Also tell me the process code and IDoc your using to help you better.
Regards,
Saravanan M
09-02-2013 8:59 AM
Hi Saravanan,
Its a Z Basic type and Z process code and and not copied from any standard process code. The initial triggering point of the BTE is from FM 'IDOC_WRITE_AND_START_INBOUND'. PLs let me know your thoughts.
BR,
Shankar.