Problem with BAPI_PO_CHANGE when called within ME_PURCHDOC_POSTED BADI Implementation

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

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

Similar Messages

  • XSLT Mapping - problem with prefixes when calling template

    Hi all,
    I am having a problem with using an XSLT mapping in XI to combine various fields from 2 input messages of different structures into a single output message.  I understand that XI puts a wrapper around the 2 input messages so the structure of the XML I am mapping is:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns2:Messages xmlns:ns2="http://sap.com/xi/XI/SplitAndMerge">
    <ns2:Message1>
    <ns:(root of first message)>
    </ns:(root of first message)>
    </ns2:Message1>
    <ns2:Message2>
    <ns:(root of second message)>
    </ns: (root of second message)>
    </ns2:Message2>
    </ns2:Messages>
    Currently my XSL looks like the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="http://example.co.uk/example" xmlns:ns2="http://sap.com/xi/XI/SplitAndMerge" xmlns:javamap="java:systemDate.CurrentDate" version="2.0">
    <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
    <xsl:param name="inputparam"/>
    <xsl:template match="ns2:Messages">
    ...<xsl:calltemplate name="FormattingTemplate"/>
    </xsl:template>
    <xsl:template name="FormattingTemplate">
    </xsl:template>
    </xsl:stylesheet>
    When I test the mapping it works fine until it calls the FormattingTemplate.  Then it throws out a "transformer exception" error saying the prefix 'ns2' is not mapped to a namespace.
    If anyone could tell me where I am going wrong I would be very grateful.
    Thanks,
    Mike

    Hi Udo,
    Thanks for your reply.
    When testing the stylesheet locally with XMLSpy, it works fine, but I have just noticed that it adds information in the root tag of the target message as follows:
    <(root of target message) xmlns:javamap="java:systemDate.CurrentDate" xmlns:ns="http://example.co.uk/example" xmlns:ns2="http://sap.com/xi/XI/SplitAndMerge">
    I checked the root tag of the target message in XI and it does not automatically add this information. Thus I added it in my stylesheet so the information above is projected in the target message, but the same error message appears when the call template function is called.  Do you know if I need to somehow add a namespace to templates other than the main one? If so, do you know how I go about doing that?
    Thanks,
    Mike

  • Problem with sqlplus when called from forms

    Dear friends,
    I have the following problem, we are using forms 10g and database 10g,we are using client_host command to call sqlplus from form and the query which is being run by sqlplus is supposed to take an input from the client and return results. there is no problem in that. but the problem is the sqlplus window opens only in minimized mode and the users wants it open in maximized mode by default.
    this is the code i am using to do this
    pat:='sqlplusw -s'||:global.text||'@i:\sqls\codewise.sql'
    client_host(pat);
    please help me
    prawin

    I'm not sure allowing end users access to a sqlplus session is such a good idea. A savvy user having a bad hair day and becoming disgruntled could wreak havoc on your database if he/she has the right permissions. Besides, I've heard rumors that Forms is really good at accepting user input, querying the database, and displaying the results :P

  • Strange problem with LabPython when calling datetime.strptime()

    Here's my code.
    Whenever this is run, I get the following error:
    Error 1050 occurred at PYTHON Execute Script__ogtk.vi->Writer.vi:<type 'exceptions.TypeError'>, attribute of type 'NoneType' is not callable
     The code works perfectly in python. Any ideas of how to get around this problem?
    Attachments:
    snippet problem.png ‏23 KB

    Hello,
    As noted by nyc, LabPython is not supported by National Instruments.
    To help you, I give you a piece of advice :
    If you want to integrate in LabVIEW a script in Python which has been developed by you, I suggest you to try to replace all the VI by  the Python 2.2 Script node
    If you want to share the library "python.27.dll", I suggest you to try to reverse the first and the second VI (first, use Python New Session.VI and then use
    Python Set Servers Path.VI)
    This link could help you:
    http://labpython.sourceforge.net/palette.html
    Best regards,
    Guillaume D

  • Having problem with siri on calling someone

    Hi.. i'm having a problem with siri when calling someone..it says " i can't call using that number "
    Im from Mauritius, our mobile number having been migrated into 8-digits since 1 month. I'd turn off siri, reset setting.. its the same!
    whats wrong with that?

    i"m from Mauritius also having the same problem when calling someone using siri.
    i think its because, of the 8 digits number.

  • I got problem with volume of calls...its on max and i still can hear person on other side really bad...i got 4s

    i got problem with volume of calls...its on max and i still can hear person on other side really bad...i got 4s

    Did you fix the problem? I have the same problem and it has been pain in the neck.

  • WDA app not launched with SSO when called from portal

    Hi,
    we have configured our systems so that our portal (NW Portal 7.0) is issuing logon tickets and ERP6.0 is receiving them in the backend for single sign-on.
    When launching a SAP GUI for Windows transaction (System admin->Support->SAP Application) to test if the SSO is set up correctly, all goes well and I'm able to call e.g. SU01 with logon tickets from the portal.
    My problem is that when calling a Web Dynpro for ABAP application in the same backend system from the same portal, I get an error "SSO logon not possible; logon tickets not activated on the server" and need to login manually when starting the application.
    When looking at the WDA app URL, I see http://<backend server>.<domain1>.com/... and the portal is sitting on http://<portal server>.<domain2>.com. Could it be a problem if the backend system is in another domain? And if yes, how come the SAP GUI for Windows launch then works (related to an http connection and domain relaxing?)? How to go forward and make it work all right?
    Best regards,
    Mikko

    Hi Navarro,
    Merry Xmas:)
    >>We did the same test with the demo app from you (MS)
    http://msdn.microsoft.com/en-us/library/windows/apps/hh202967(v=vs.105).aspxand it still don't work. (remember to setup
    fast app resume)
    Yes, I can reproduce your issue using the official sample.
    I think this issue is caused by the mechanism of Fast app resume, please refer to the following reference:
    #Fast app resume for Windows Phone 8
    http://msdn.microsoft.com/en-us/library/windows/apps/jj735579(v=vs.105).aspx
    Quote:
    With Fast Resume, when an app is resumed, the system creates a new page instance for the target of the launch point and this page is placed on top of the app’s existing backstack.
    This official sample can also help us to understand how it works:
    https://code.msdn.microsoft.com/windowsapps/Fast-app-resume-backstack-f16baaa6
    We could find that the Application.Launching event will not be triggered if we used Fast app resume, this will affect responding Toast's parameter(Deep Link).
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Having a problem with dates when I send my numbers doc to excel. dates are all out and that they have to cut and paste individual entries onto their spreadsheet. Any idea how I can prevent this

    having a problem with dates when I send my numbers doc to excel. dates are all out and that they have to cut and paste individual entries onto their spreadsheet. Any idea how I can prevent this.
    I'm using Lion on an MBP and Numbers is the latest version

    May you give more details about what is wrong with your dates ?
    M…oSoft products aren't allowed on my machines but I use LibreOffice which is a clone of Office.
    When I export from Numbers to Excel and open the result with LibreOffice, the dates are correctly treated.
    To be precise, dates after 01/01/1904 are correctly treated. dates before 01/01/1904 are exported as strings but, as it's flagged during the export process, it's not surprising.
    Yvan KOENIG (VALLAURIS, France) mardi 3 janvier 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : http://public.me.com/koenigyvan
    Please : Search for questions similar to your own before submitting them to the community
    For iWork's applications dedicated to iOS, go to :
    https://discussions.apple.com/community/app_store/iwork_for_ios

  • I have a problem with itunes when I sync the saved music and want to sync my iphone 5 ios 7.0.6 no longer passes the music thing is that just stays on "waiting for sync" and not worry please help are more than 400 songs that do not want to hear who are wi

    I have a problem with itunes when I sync the saved music and want to sync my iphone 5 ios 7.0.6 no longer passes the music thing is that just stays on "waiting for sync" and not worry please help are more than 400 songs that do not want to hear who are wi

    Plawexki wrote:
    ...  do you know if the contacts, photos, messages etc will be wiped?
    Yes... Everything will be Wiped and Replaced with what is currently on Your Mac.
    SYNCING with iTunes
    See here  >  http://support.apple.com/kb/HT1386
    From Here  >  http://www.apple.com/support/iphone/syncing/
    You may find this information of interest...
    Have a read here...
    https://discussions.apple.com/message/18409815?ac_cid=ha
    And See Here...
    How to Use Multiple iDevices with One Computer

  • Problems with navigation when deploy application on WebLogic 10.3

    Hi! I have problems with navigation when I deploy my application on Weblogic server 10.3. In my application I have two pages. One page where I can see the records. In this page I have button Create with action to secound jspx page. When I press this button then the first form (where I could see all records) is empty - the create operation worked, but navigation to second page not. Navigation rules is in adf task flow. In default server all works correct. Where is the problem?
    Maybe when I deploy my application I need specialy deploy adf task flow or somewhere write something? If so, then can you explain me where? Any suggestions what to do.
    Best regards!

    I have in log:
    2009.26.3 20:12:52 oracle.adfinternal.controller.faces.lifecycle.JSFLifecycleImp
    l setLifecycleContextBuilder
    WARNING: ADFc: Replacing the ADF Page Lifecycle implementation with 'oracle.adfi
    nternal.controller.application.model.JSFDataBindingLifecycleContextBuilder'.
    2009.26.3 20:12:52 oracle.adfinternal.controller.util.model.AdfmInterface initia
    lize
    INFO: ADFc: BindingContext is present, using ADFm APIs for DataControlFrames.
    2009.26.3 20:12:52 oracle.adfinternal.controller.metadata.provider.MdsMetadataRe
    sourceProvider <init>
    INFO: ADFc: Controller caching of MDS metadata resources ENABLED.
    2009.26.3 20:12:52 oracle.adf.controller.internal.metadata.MetadataService$Boots
    trap add
    INFO: ADFc: Loading bootstrap metadata from '/WEB-INF/adfc-config.xml'.
    2009.26.3 20:12:54 oracle.adf.share.security.providers.jps.CSFCredentialStore fe
    tchCredential
    WARNING: Unable to locate the credential for key AUGI in D:\bea\user_projects\do
    mains\base_domain\config\oracle.
    2009.26.3 20:12:54 oracle.adf.share.jndi.ReferenceStoreHelper throwPartialResult
    Exception
    WARNING: Incomplete connection information
    Edited by: Debuger on Mar 26, 2009 11:18 AM

  • When attempting to use Lightroom external editor program to edit a photo in Photoshop Elements 10, the photo does not open / appear on photoshop elements screen.  I don't have any problem with this when using Photoshop Elements 6 or Photoshop CS.  I'm usi

    When attempting to use Lightroom external editor program to edit a photo in Photoshop Elements 10, the photo does not open / appear on photoshop elements screen.  I don't have any problem with this when using Photoshop Elements 6 or Photoshop CS.  I'm using a Mac with Mountain Lion OS.  Any solutions?

    Adobe now hides the editor - what looks like it is not - you want the editor hidden in the support folder - see http://forums.adobe.com/message/3955558#3955558 for details
    LN

  • Hi, recently purchased macbook 13", I have problem with sound when connect to my LG Smart tv with sound system. When i change sounds effect on my sound system also LG its all go quiet didn't have this problem with my laptop. Any advise ?

    Hi, recently purchased macbook 13", I have problem with sound when connect to my LG Smart tv with sound system. When i change sounds effect on my sound system also LG its all go quiet didn't have this problem with my laptop. Any advise ?

    Some progess I see. To be honest, i would not waste your time with trying to connect using wireless.
    You are likely to get poor connections and dropping out.
    If its working using a cable, then there is no need to bother with giving me the network settings, bu see how it goes, because sometimes giving the TV a static IP address can give better results.
    There is an example of a couple of powerline adapters on the diagram below. Just ignore the network switch unless you want to connect other devices which are near to the TV.
    http://forumhelp.dyndns.info/networking/powerline3.jpg
    I will monitor the subject line of this thread, should you want to post any more information.
    There are some useful help pages here, for BT Broadband customers only, on my personal website.
    BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones.

  • I have a problem with Safari: when it opens and I go on google, it opens a page that says: PLEASE UPDATE INTERNET EXPLORERE.   What should I do?

    I have a problem with Safari: when it opens and I go on google, it opens a page that says: please update internet explorer!
    What should I do?

    It's a scam. Have a look at this thread:
    https://discussions.apple.com/thread/6058094?tstart=0

  • Problem with SDO_relate when using polygons with holes.

    I'm having a problem with sdo_relate. I'm trying to extract all elements from a point table (bdtq_batim_p) that are inside a specific polygon from another table (SDA_MUNIC_SS). The spatial index for both table have been rebuilt and the data from both table is valid.
    When I do a count on the query, I know the answer should be 1422 elements (Counted in ArcGIS). However, sdo_relate gives a smaller number of elements in the result set.
    The query :
    SELECT count(distinct t.identifiant) FROM bdtq_batim_p t, SDA_MUNIC_SS s WHERE s.mus_co_geo = '48015' and sdo_relate( t.SHAPE,s.SHAPE,'mask=anyinteract querytype=window') = 'TRUE'
    returns 282 elements. The query with mask=inside, SDO_Anyinteract() and SDO_inside() all give the same result.
    I did a test with the following query and the result is 1422 (which is the good result).
    SELECT count(distinct t.identifiant) FROM bdtq_batim_p t, SDA_MUNIC_SS s WHERE s.mus_co_geo = '48015' and SDO_WITHIN_DISTANCE( t.SHAPE,s.SHAPE,'distance=0') = 'TRUE';
    It's important to note that the polygone (from SDA_MUNIC_SS) that is used for this query have holes in it. I have the same problem with all the polygons from the SDA_MUNIC_SS table that have holes in it. For the polygon without holes, the results are the same for the 2 queries.
    My question are :
    Why are the result from the two queries different? A query with a buffer of 0 should always return the same result as a query with Anyinteract.
    Is there a known problem with SDO_RELATE when using a polygon with holes in it?
    Do you have any idea how to solve my problem.

    Since i don't have much control on the version of Oracle and Patches that we use in the system, we used a workaround that detects the polygons with holes and uses the SDO_WITHIN_DISTANCE( t.SHAPE,s.SHAPE,'distance=0') = 'TRUE' operator in those case. We saw a slight decline in performance but it now returns the right results. When the system will be patched, we'll come back to the original version and see if the problem is solved.

  • I have a problem with IDVD when I have completed a movie and set it up with menus etc I cannot operate the burn button so I cannot make a DVD.

    I have a problem with IDVD when I have completed a movie and set it up with menus etc I cannot operate the burn button so I cannot make a DVD.

    Hi
    Can You
    Go up to File Menu in iDVD - and here down to
    Save as a DiskImage
    If this works - You can burn Your DVD in another way via Disk Util tool
    Yours Bengt W

Maybe you are looking for

  • Earmarked funds - Express document "Update was terminated" error

    Hi, When i create a contract(RECN), a earmarked funds document getting created and it updates the table KBLK with single primary key BELNR. I see in the Tcode OK60, the number range assinged is '05' - 0200000000 to 0299999999. KBLK table has entries

  • Problem in displaying row vale as column name

    Hello Experts, Please help me,its very urgent.... i want to dispaly a column value as a column name. i have two column into selete statement and i want to dispaly one column value as a column name and other column value as a single row. My query is :

  • How do i download images from nokia 6350 w/o memory card?

    I'm trying to download images taken with the Nokia 6350 camera to iPhoto using a USB cable. The phone does not have a memory card. I plug the cable in and select 'Data Storage' from the connectivity menu and then get a message ' Insert memory card to

  • How to create change pointers for IT6 when custom table Z777A changes?

    Situation: We are using custom table Z777A (copied T777A and added fields) to store building locations. Employee's IT6 subtype 92 retrieves valid work address building locations from table Z777A. Problem: Whenever there are updates to Z777A, we need

  • I need a script edited so it will enter the intiger a specified number.

    This is a number generating script created by Michel Lemieux and posted here: http://www.quark.com/service/forums/viewtopic.php?t=4176 I need this script to ask for data that would specify the number of times each number should be added to the file.