Getting BAPI_ALM_ORDER_MAINTAIN work for updating operations!

Dear users,
I am having a tough time in getting the BAPI_ALM_ORDER_MAINTAIN for updating my operations.
The requirement is to update the Material Group, Vendor and a few fields on the First operation of the Order. I have written a piece of code ( extracted bits and pieces from previous threads raised on the same issue).
The issue I have is, it only updates the Operation if a RELEASE is included in the method, and needless to say, it can happen only once. If I remove the RELEASE from methods table, then it gives a success message that the BAPI has worked, but nothing gets reflected on the Order. And as a bonus (?!!) I get an 'Update terminated' message in my SAP BUsiness workplace with an error SAPSQL_ARRAY_INSERT_DUPREC, when I try to open the Order.
Please find the code below in the next post.
Can you please suggest if there is a way to update ONLY the operation?
Thanks,
Vijay

  l_method_line-refnumber = '000001'.
  l_method_line-objecttype = 'HEADER'.
  l_method_line-method = 'CHANGE'.
  l_method_line-objectkey = p_aufnr.
  APPEND l_method_line TO l_methods.
  l_method_line-method = 'RELEASE'.
  APPEND l_method_line TO l_methods.
  l_method_line-objecttype = 'OPERATION'.
  l_method_line-method = 'CHANGE'.
  CONCATENATE p_aufnr '0010' INTO l_method_line-objectkey.
  APPEND l_method_line TO l_methods.
  l_method_line-method = 'SAVE'.
  l_method_line-objecttype = space.
  APPEND l_method_line TO l_methods.
  MOVE p_aufnr TO l_header_line-orderid.
  MOVE sy-datum TO l_header_line-start_date.
  MOVE '7' TO l_header_line-priority.
  APPEND l_header_line TO l_header.
  MOVE 'X' TO l_header_up_line-start_date.
  MOVE 'X' TO l_header_up_line-priority.
  APPEND l_header_up_line TO l_header_up.
  MOVE '0010' TO l_operation_line-activity.
  l_operation_line-MATL_GROUP = '9051'.
  l_operation_line-usr01 = 'Test 1'.
  APPEND l_operation_line TO l_operation.
  MOVE 'X' TO l_operation_line_up-MATL_GROUP.
  MOVE 'X' TO l_operation_line_up-usr01.
  APPEND l_operation_line_up TO l_operation_up.
* Update order
  CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
    TABLES
      it_methods             = l_methods
     it_header              = l_header
     it_header_up           = l_header_up
*   IT_HEADER_SRV          =
*   IT_HEADER_SRV_UP       =
*     it_userstatus          = l_userstatus
*   IT_PARTNER             =
*   IT_PARTNER_UP          =
   it_operation           = l_operation
   it_operation_up        = l_operation_up
*   IT_RELATION            =
*   IT_RELATION_UP         =
*   IT_COMPONENT           =
*   IT_COMPONENT_UP        =
*   IT_TEXT                =
*   IT_TEXT_LINES          =
*   EXTENSION_IN           =
     return                 =  l_return
*   ET_NUMBERS             =
    LOOP AT l_return INTO l_return_line.
      WRITE:/ l_return_line-type,
              l_return_line-id,
              l_return_line-number,
              l_return_line-message.
    ENDLOOP.

Similar Messages

  • Problem in Wfetch client for Update operations

    Hi,
    I am using the Wfetch client for the 'Update' operation of an RFC Gateway consumption model . But it seems to always give this error : 'HTTP/1.0 400 Bad Request\r\n'
    I have passed only those fields that have been exposed in the GW Data model. Is there anything else that needs to be taken care of ?
    The read and query operations are executed successfully though.
    Thanks,
    Shubhada

    Hi Shubhada,
    Just recheck two things in Wfetch with below details.
    1. Check the path. It should be below formate for update operation
    Verb : Put
    Path:  /sap/opu/sdata/sap/<CONSUM_MODEL>/<data_model>Collection(value='  ',scheme_id='<DATA_MODEL>',scheme_agency_id='  ')?sap-client=< >&$format=xml
    Above formate you can take from Read operation which you already executed successfully.
    2. Check the XML formate on right handside in Wfetch it should be header & body with below details.
    Xml Formate:
    x-requested-with: XMLHttpRequest\r\n
    \r\n
    <?xml version="1.0" encoding="utf-8" standalone="yes"?>\r\n
      <entry xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">\r\n
          <content type="application/xml">\r\n
            <m:properties>\r\n
       <d:value> </d:value> \r\n
      <d:scheme_id> </d:scheme_id> \r\n
      <d:scheme_agency_id> </d:scheme_agency_id> \r\n
    Just copy from read operation Read operation which you already executed successfully. And update the fields what you required.
    </m:properties>\r\n
          </content>\r\n
    </entry>\r\n
    Hope you this will help above information.
    Thanks & Regards,
    Mahesh Devershetty

  • I am getting error message  for updating my I pad

    I am getting error message  for updating my I pad

    And what is the error message ? Are you on iTunes 10.5+ on your computer ? If you are getting a network timeout message then try temporarily turning off all your firewall and antivirus software until the download has completed.

  • My ow doesn't work for updating apps but does for buying music at ITunes Store.  Why?

    My Apple password works for buying songs on iTunes but not for updating apps that I purchased through Apple.  Why.

    is the driver for your network card up to date?  that could be a reason it will not work with the more up to date HH3
    If want more assistance from the forum members please can you post the adsl stats from your router may need to 'show detail' to get all stats (if hub enter 192.168.1.254 in your browser and navigate to adsl or use a-z, if netgear enter 192.168.0.1) and run btspeedtester (MAC users may have problems) http://speedtester.bt.com or http://bt.custhelp.com/app/answers/detail/a_id/9354/c/346,4740,5520 and post the results .
    are you connected directly to the NTE5 master or test socket or to somewhere else? Is the master the only phone socket in your home?
    Have you tried the quiet line test? - dial 17070 option 2 - should hear nothing - best done with a corded phone. if cordless phone you may hear a 'dull hum' which is normal
    Someone may then be able to offer help/assistance/suggestions to your problem
    If you like a post, or want to say thanks for a helpful answer, please click on the Ratings star on the left-hand side of the post.
    If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’.

  • Wont get past "Checking For Updates " for initial startup.

    Hey. So I just bought a Blackberry Playbook and I can not get past the "Checking For Updates" screen on the initial startup. It checks for updates and then says
    "Retry Activation
    Blackberry Tablet OS
    Version 1.0.2.2078
    Your tablet could not be activated because of error (1001)
    Tap Retry or Turn Off to try again later"
    I have dine both of those and neither work. I am really excited I bought this because I used to have a Blackberry Pearl. I want to use this tablet but the more I struggle the more I want to throw it out the window. Please help!! 

    Try starting in "Safe Mode" (hold shift at startup)
    http://docs.info.apple.com/article.html?artnum=107393
    If your computer starts up, repair permissions, verify disk (both in Applications/Utilities/Disk Utility)
    If you are able to get to apple.com, download the "Combo" update and avoid the "Software Update..." (use that to see what is needed and get them from the apple.com site) re-apply the update and restart.
    I'd start there. Post any results.
    Good Luck

  • PM Order: get PRT list for an operation

    Hi expert,
    I need to get the PRT list for an operation for a PM order (in particolar I need the documents related to a specific operation).
    Do you know if exist a FM?
    Any suggest?
    Thanks
    Salvatore

    This is my solution:
    PARAMETERS: p_aufpl LIKE affh-aufpl.
    DATA: it_affh TYPE STANDARD TABLE OF affh WITH HEADER LINE.
    DATA: it_affhd TYPE STANDARD TABLE OF affhd WITH HEADER LINE.
    DATA: aufpl_tab TYPE STANDARD TABLE OF aufpl_pre WITH HEADER LINE.
    SELECT * FROM affh INTO CORRESPONDING FIELDS OF TABLE it_affh
    WHERE aufpl = p_aufpl.
    LOOP AT it_affh.
    *  MOVE-CORRESPONDING it_affh TO it_affhd.
    **  APPEND it_affhd.
      MOVE-CORRESPONDING it_affh TO aufpl_tab.
      APPEND aufpl_tab.
    ENDLOOP.
    CALL FUNCTION 'CF_BT_CO_AFFH_PRE_READ_FROM_DB'
         TABLES
              aufpl_tab = aufpl_tab
    *            ORD_TAB   = AUFNR_TAB
         EXCEPTIONS
              OTHERS    = 1.
    CALL FUNCTION 'CF_BT_CO_AFFHD_TAB_GET'
    *                EXPORTING
    *                  i_aufpl                 = p_aufpl
    *                  I_APLZL                 =
    *                  I_NO_DELETED            = ' '
    *                  I_NO_PHYS_DELETED       = ' '
    *                  I_FLG_STATX             = 'X'
    TABLES
       affhd_tab               = it_affhd
    *                EXCEPTIONS
    *                  NOT_FOUND               = 1
    *                  OTHERS                  = 2
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    WRITE: 'fine'.
    LOOP AT it_affhd.
      WRITE: / it_affhd-doknr.
    ENDLOOP.

  • Lost Administrative Password and Have to update my flash player. How Can I get around this for updates?

    Sure needing help here. I've lost my administrative password on my mac and have to update my adobe flash player. I've researched several, seemingly (to me) complicated ways around this. Does anyone have an easy solution.  Really need this back up and running! Thanks in advance.

    This password prompt is presented by your operating system, and is intended to keep you from accidentally installing software.
    If this is your personal machine and you don't need a password to log into the computer when it first starts up, you can probably leave the password blank and click OK to get past this prompt.  If this is your personal machine and your normal password isn't working, check to make sure that CAPS LOCK is off, and type the password carefully.
    If this is your work machine and it's asking for an Administrator password, well, you'll need to have a conversation with your friendly IT person.
    If you're still stumped, you may need to reset the password on your Mac:
    http://support.apple.com/kb/PH18653
    http://support.apple.com/kb/PH14325
    http://support.apple.com/en-us/HT201240

  • Why does my password for the app store work for updates but not for new purchases

    Very frustrated. I've been trying to download Evernote for days now and it keeps telling me my password is incorrect. I use the same password to update apps on my phone and it works fine.
    Using the 4S
    Any ideas why?
    Thanks
    Michael

    Solved. Talked to support and went into settings/store and signed out. Powered down and restarted and logged back in through settings/store and the app store then recognized my password.

  • My music is so disorganized i need to get it working for me but how?

    my music all works fine but it goes in order by the Album name then the artist but i have a lot of Albums that include many different artists and they show up in my library as they are in different albums....it is really annoying when i want to listen to a Album click on the song in the album and it says that is the only song in the album when i now there is more then that in that album....it only does this to CD's i rip into my computer the music i buy from itunes does not do this.....i have tried going to view and changing the album settings but it just does not want to change.... how can i get it to do what i want? to put all the songs in the album they belong too....

    I too am also having the same problem with viewing songs by album. I'm sure there is a simple explanation to solve this problem, but after surfing the help menus and discussion pages, I can't seem to find the answer. With my problem, this example will illustrate my fustration. My favorite CD is "In the City" by Kevin Rudolf. When I go to play the album on my iPod Nano, which I just purchased, the album is shown in 'chunks' instead of one album itself. The cd has a total of 12 songs in it, but when I go to the menu on the iPod to select the album "In the City" there are a total of 5 of these albums, each with 1 to 4 songs in each. This is rather annoying in how I would just like to listen to my favorite album in one go, in the proper order as per on the cd, and I can't do this. I'm sure the problem is very simple to fix, and I look forward to using the brand new iPod nano which I have purchased. But sadly if I cannot fix this problem, then I will return the product and all the accessories purchased with it for a different competitors product. Keep in mind, this album is not the only one that is in my selection of music that does this. There are many albums that are sliced up. So fixing this one album in example, will hopefully fix them all.

  • HT4972 I can't get siri to get to work i updated yesterday and it still dosen't work

    Well i tried to update throw my laptop but after 2 goes i updated throw my ipad 2 and it work fine and after i done it had a look around and that and then i tried to get Siri on but after a few goes it didn't work

    Thanks i that it was on 2&amp;3 ipad but just before yours  help i was reading something about it and it said its just on the 3 one thanks any way

  • My codes don't work for updates

    I had problems with my computer it got a virus ad i had to get a new hard drive I deactivated Adobe before having it worked on and reloaded it fine but now it will not load the updates. Can you help please?
    Thanks Joe

    pre cc updates:  http://www.adobe.com/downloads/updates/
    cc updates:  http://prodesigntools.com/adobe-cc-updates-direct-links-windows.html

  • Update dont work for update

    Sorry for my english,
    Update dont work whene you have updateted wersion 1.
    how it coms???
    Marc

    Hello,
    You can try to check your Stream by applying the following troubleshooting guide:
    [http://download.oracle.com/docs/cd/B19306_01/server.102/b14229/strms_trouble.htm]
    But as Dan said, a Production database should always be updated to the latest patchset (so here in
    10.2.0.4) after checking it on your Test database.
    Not only it can correct many bugs but, if you have to open a SR to MOS, you'll have a better support
    (sometimes, if they think it's a bug they can ask you to apply the patchset too).
    Hope it can help,
    Best regards,
    Jean-Valentin

  • How can I get iCal working for me? Is Server the way??? Really need help he

    Hi,
    I made an earlier post, but nobody wanted to reply Here goes again.
    New photography business. My wife uses a MacPro tower, I use a MacBook Pro, and we have a spare Powerbook sitting doing nothing.
    1. We want to access and edit the same iCal calendar.
    2. We want to be able to put it online - but not critical as yet.
    3. We want to sync 2 iPhones.
    So, if money were not the issue, what is the ideal solution? Is it putting Leopard Server on one of the machines? (would the old PowerBook do the job in the background?)
    Is CalDAV the way to go, something I know absolutely nothing about? I suppose I am so confused about which direction to head in I am hoping someone will point me.
    I will happily get Server if that is better, but is it?
    Looking forward to an enlightening reply.
    Hugh

    If money were no object, then an Xserve with it's bundled Mac OS X Server unlimited would be the way to go. But, in the server genre, an intel-powered Mac mini with Mac OS X Server 10 client is far more cost effective. In combination with SoftRaid, a matching external FireWire or USB-2 external drive in mirrored mode, a spare power adapter, and spare 2.5 and 3.5 bare drives matching these creates an almost bulletproof but inexpensive server setup.
    You might even find the Xserve solution particularly compelling as a storage device for your digital still photographs. It's possible to run Mac OS X Server on your PoweBook in all likelihood, but I would not recommend it.
    On the other hand, BusySync running on your PowerBook would provide all of the 'calendar service' you might possibly need for shared and published calendars. The developers of BusySync are smart and responsive, and it's a great piece of software.

  • It would appear that there is no longer any support for Acrobat Pro 9 for Mac. I keep getting a notice for updates but when I elect to do so, I get the message that I need to reinstall the program from the original program disks- which I no longer have.

    I’m debating whether to can the app, or just ignore, or turn off the updater. Suggestions?

    If you are at version 9.5.5 that was the end of the line for Acrobat 9.x.  You are correct that Acrobat 9 is no longer supported.  Adobe is only supporting Acrobat X and Acrobat XI at this time.
    If you need to reinstall Acrobat 9 though you can still download the installer bits here:  Download Adobe CS5 Free Trials – All Direct Links without Akamai | ProDesignTools
    Make sure to follow the directions carefully and sign into the Adobe Trials page first with your Adobe ID.

  • ADD_SUBSET_PROPAGATION_RULES dont work for update command!

    DECLARE
    v_src_db VARCHAR2(120);
    BEGIN
    SELECT global_name INTO v_src_db FROM global_name;
    DBMS_STREAMS_ADM.ADD_SUBSET_PROPAGATION_RULES(
    table_name => 'ICIS.TRANS_TABLE',
    dml_condition => 'des =''MIS'' and flag=0',
    streams_name => 'STREAMS_PROPAGATION',
    source_queue_name => 'STRMADMIN.STREAMS_CAPTURE_Q',
    destination_queue_name => 'STRMADMIN.STREAMS_APPLY_Q@aqhos',
    source_database => v_src_db,
    queue_to_queue => true);
    END;
    i have this rule for propagating data,but only when i INSERT/DELETE data with this dml_condition data is propagated and if i UPDATE data to meet this condition data wil not propagate to destination?????
    why?????

    Hello,
    You can try to check your Stream by applying the following troubleshooting guide:
    [http://download.oracle.com/docs/cd/B19306_01/server.102/b14229/strms_trouble.htm]
    But as Dan said, a Production database should always be updated to the latest patchset (so here in
    10.2.0.4) after checking it on your Test database.
    Not only it can correct many bugs but, if you have to open a SR to MOS, you'll have a better support
    (sometimes, if they think it's a bug they can ask you to apply the patchset too).
    Hope it can help,
    Best regards,
    Jean-Valentin

Maybe you are looking for