Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to unload a program at runtime?

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

ThomasZloch
Active Contributor

That function group does not have any global data (maybe functions called within have...). What is the exact error message you're getting?

Thomas

12 REPLIES 12

Former Member
0 Kudos

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

0 Kudos

Hi Darren,

I tried this out but it didn't work. With destination "NONE" I get the same updating errors.

Peter

ThomasZloch
Active Contributor

That function group does not have any global data (maybe functions called within have...). What is the exact error message you're getting?

Thomas

0 Kudos

Hi Thomas,

the error message is "Update was terminated". The adress data of the business partner is left inconsistent.

Peter

0 Kudos

hmm, there must be more information available in ST22 or SM13 on why that termination occurred.

Thomas

0 Kudos

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)

0 Kudos

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

0 Kudos

Thank you Thomas,

could be that this note is related to the problem although the symptons seem to be different.

Peter

0 Kudos

Also see if SM21 has any information.

Rob

0 Kudos

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

0 Kudos

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

0 Kudos

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