Quantcast
Channel: SCN : Popular Discussions - ABAP和Java开发 (ABAP & Java Development)
Viewing all articles
Browse latest Browse all 4604

Problem with BAPI_PO_CHANGE when called within ME_PURCHDOC_POSTED BADI Implementation

$
0
0

Hi All,

 

We have a situation where PR to PO conversion needs to happen through a custom program which submits ME59N in batches. During this conversion, it's a business requirement to update the PO's GS Partner function based on the manufacturer in the first item's inforecord.

 

In order to do this, we have implemented the badi "ME_PURCHDOC_POSTED". The only method within this is "POSTED"

 

In order to update the PO, I use "BAPI_PO_CHANGE" inside this badi with IN BACKGROUND TASK addition. The reason behind this is that this BADI is called before the commit that creates the PO happens. And by calling the BAPI_PO_CHANGE in a background task, I ensure that it's run after the commit has happened.

 

This approach works extremely well, but fails in certain scenarios when executed for large PR to PO conversion where certain PRs exceed 300 line items.

 

Since the background task call cannot be debugged, I used the enjoy bapi_po_change exit EXIT_SAPL2012_004 to dump the return table to a custom table or the application log, to check what has happened.

 

In the instances that this has failed, the return table's content was -> function "change purchase order" performed in test

 

I assure you I have NOT used the test flag. I even applied a couple of SAP notes that mention this issue, but still had no success. I am waiting for a proper response from OSS at the moment but this is a real headscratcher.

 

Also importantly at this point, the PO was successfully created.So the partner function change should happen without issues  :'(


Have any of you come across this issue before ? What steps have you taken to overcome this issue ?

 

Regards,
Tharindu


Viewing all articles
Browse latest Browse all 4604

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>