2008 Sep 30 1:03 PM
Hi experts,
maybe you can help solve the following problem:
I have a customer program that is calling a sap standard function module several times. The function module is BAPI_BUPA_ADDRESS_ADD. The BAPI works fine when calling it once but I get errors when repeating the call.
I assume that the error is caused by the fact, that the data of the respective function group is no longer initial after the first call. Of course this would be a programming error. My assumption is approved by a workaround: When I call the function module in a separate work process with "starting new task" I observe no errors.
Now I wonder if there is a better workaround because starting a new task for each call has the disadvantage of making each call asynchronous - moreover we create many work processes. For example is there a way to unload or refresh a function group at runtime so that the second call is like the first?
Thanks
Peter
2008 Sep 30 1:10 PM
That function group does not have any global data (maybe functions called within have...). What is the exact error message you're getting?
Thomas
Hi experts,
maybe you can help solve the following problem:
I have a customer program that is calling a sap standard function module several times. The function module is BAPI_BUPA_ADDRESS_ADD. The BAPI works fine when calling it once but I get errors when repeating the call.
I assume that the error is caused by the fact, that the data of the respective function group is no longer initial after the first call. Of course this would be a programming error. My assumption is approved by a workaround: When I call the function module in a separate work process with "starting new task" I observe no errors.
Now I wonder if there is a better workaround because starting a new task for each call has the disadvantage of making each call asynchronous - moreover we create many work processes. For example is there a way to unload or refresh a function group at runtime so that the second call is like the first?
Thanks
Peter
2008 Sep 30 1:05 PM
Hi,
Not that I am aware of, I usually use the destination 'NONE' addition on the function call to run the code in a separate unit synchronously.
Darren
2008 Sep 30 1:15 PM
Hi Darren,
I tried this out but it didn't work. With destination "NONE" I get the same updating errors.
Peter
2008 Sep 30 1:10 PM
That function group does not have any global data (maybe functions called within have...). What is the exact error message you're getting?
Thomas
2008 Sep 30 1:20 PM
Hi Thomas,
the error message is "Update was terminated". The adress data of the business partner is left inconsistent.
Peter
2008 Sep 30 1:25 PM
hmm, there must be more information available in ST22 or SM13 on why that termination occurred.
Thomas
2008 Sep 30 1:31 PM
Hi Thomas,
there is no entry in ST22 but in SM13 I find
BUPA_ADR_WRITE_DOCUMENT
Execution Mode: V2
Update Return Code: Error (no retry)
2008 Sep 30 1:43 PM
Time to make use of the SAP Service Marketplace. I did this for you by searching for BUPA_ADR_WRITE_DOCUMENT and found this [SAP Note 1256410|https://websmp230.sap-ag.de/sap(bD1kZSZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1256410]. See if this helps.
Thomas
2008 Sep 30 2:04 PM
Thank you Thomas,
could be that this note is related to the problem although the symptons seem to be different.
Peter
2008 Sep 30 2:13 PM
2008 Sep 30 2:27 PM
Hi Rob,
in SM21 I find additional information:
"Transfer table would lead to a duplicate record in CDPOS/CDPOS_UID"
I think it is evident now, that the problem is the same as reported in sap note 1256410.
Thank you very much - I learned something here.
Peter
2008 Oct 01 8:25 AM
Hi Thomas,
after importing the patch of sap note 1256410 the error "update was terminated", caused by function module BUPA_ADR_WRITE_DOCUMENT due to duplicate entries in table CDPOS, did not appear anymore.
However calling the function module BAPI_BUPA_ADDRESS_ADD several times destroys the address data of the business partner because the BAPI does not refresh the local address memory. I found out that this can be done with function module BUP_MEMORY_ADDRESS_INIT.
Thus actually two problems were involved here.
Peter
2008 Oct 01 8:38 AM
OK, thanks for letting us know what worked finally, I wish everybody would do that (and not just bump up old threads with an enlighting "answered"...)
Cheers
Thomas