BAPI_SALESORDER_CHANGE using this i want to change the Delivery Block

Hi ABAP Gurus,
i am working on a urgent requirement of changing the Delivery Block of sales order VA02. I am trying to do this using FM            BAPI_SALESORDER_CHANGE .
Please see the following code which i am giving for the time being.
it_headerx-updateflag = 'U'.
append it_headerx.
it_bapischdl-itm_number = '00010'.
it_bapischdl-req_dlv_bl = '01'.
APPEND it_bapischdl.
it_bapischdlx-itm_number = 'X'.
it_bapischdlx-req_dlv_bl = 'X'.
APPEND it_bapischdlx.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
  EXPORTING
    salesdocument               = '0000000560'
   order_header_in             = it_header
    order_header_inx            = it_headerx
  SIMULATION                  =
  BEHAVE_WHEN_ERROR           = ' '
  INT_NUMBER_ASSIGNMENT       = ' '
  LOGIC_SWITCH                =
  NO_STATUS_BUF_INIT          = ' '
  TABLES
    return                      = it_return
  ORDER_ITEM_IN               =
  ORDER_ITEM_INX              =
  PARTNERS                    =
  PARTNERCHANGES              =
  PARTNERADDRESSES            =
  ORDER_CFGS_REF              =
  ORDER_CFGS_INST             =
  ORDER_CFGS_PART_OF          =
  ORDER_CFGS_VALUE            =
  ORDER_CFGS_BLOB             =
  ORDER_CFGS_VK               =
  ORDER_CFGS_REFINST          =
   schedule_lines              = it_bapischdl
   schedule_linesx             = it_bapischdlx
  ORDER_TEXT                  =
  ORDER_KEYS                  =
  CONDITIONS_IN               =
  CONDITIONS_INX              =
  EXTENSIONIN                 =
But the Delivery block is not changing from Credit limit to Pending Allocation
But i am getting the following messages in the it_return table
1     S     V4     233     ORDER_HEADER_IN has been processed successfully
2     S     V1     041     No data was changed
I am waiting for your suggestions
Thanks in Advance

Hi Prashanthi,
Check whether delivery number is already created or not for that  order.
If deliver already  existthen u can not create delivery block on that.
and also check whther r u calling bapi commit after this.
Regards,
Siva

Similar Messages

  • I have a 17" Mac Book Pro and a 13" Mac Book Pro...both use the same Apple ID. My wife now wants to change the Apple ID on the 13" to her Apple ID.  How do I do this and not loose the information on that computer?

    I have a 17" Mac Book Pro and a 13" Mac Book Pro...both use the same Apple ID. My wife uses the 13" and now wants to change the Apple ID on the 13" to her Apple ID.  How do I do this and not loose the information on that computer?

    Hello Teddy53149 and welcome to Apple Support Communities,
    Follow this procedure:
    Change your OS X account name and home directory name - Apple Support
    As they recommend and as always when you're messing with administrator accounts back everything up first.

  • I have a power mac g4 with mac os 10.4. 11 , I want to change the hard-drive ,what program  can I used  to transfer one hard-drive  to another  hard- drive  on this mac pc.

    I have a power mac g4 with mac os 10.4. 11 , I want to change the hard-drive
    ,what program  can I used  to transfer one hard-drive  data to another  hard- drive  on this mac pc.

    The Disk Utility, Carbon Copy Cloner, SuperDuper, or similar software. For best results, place the second drive inside the computer or in a FireWire enclosure and boot the computer from it before removing the internal drive.
    (66989)

  • I want to change the cantry because I used us voucher and now the remanding only 0.05 and now I want use my Saudi credit card but give massage I have to finish the balance and nothing I can by by this amount I need to remove the balance to change the city

    I want to change the cantry because I used us voucher and now the remanding only 0.05 and now I want use my Saudi credit card but give massage I have to finish the balance and nothing I can by by this amount I need to remove the balance to change the city

    Click here and ask the iTunes Store staff to zero your account balance.
    (105215)

  • BAPI_SALESORDER_CHANGE - Want to change the Ship-to-party at header level

    Hi
    I want to change the Ship-to-party at header level in the Sales Order created. I tried using the BAPI BAPI_SALESORDER_CHANGE  as shown below.
    When I run the program I get the log as Sales Order 45 saved succesfully. However, I don't find the SO changed. Apart from this I get an Express Message saying the Updation failure. Not sure of what'z wrong here.
    Pls help
    thanks
    girish
    REPORT  ZBAPI_SALESORD_CHANGE.
    data : zBAPISDHD       type BAPISDH1,
           zSALESDOCUMENT  type BAPIVBELN-VBELN.
    data : zORDER_ITEMS_IN     like /AFS/BAPISDITM occurs 0 with header line,
           zORDER_SCHEDULES_IN like /AFS/BAPISDSCHD occurs 0 with header line,
           zORDER_PARTNERS like BAPIPARNR      occurs 0 with header line,
           zRETURN         like BAPIRET2 occurs 0 with header line,
           so_no           type BAPIVBELN-VBELN,
           zORDER_HEADER_INX    TYPE BAPISDH1X,
           zPARTNERCHANGES like  BAPIPARNRC occurs 0 with header line.
    clear : zBAPISDHD.
    so_no = '0000000045'.
    data : l_comp_qty like zORDER_ITEMS_IN-COMP_QUANT.
    l_comp_qty = 10.
    zBAPISDHD-SALES_ORG = 'BP01'.
    zBAPISDHD-DISTR_CHAN = '02'.
    zBAPISDHD-DIVISION = '01'.
    zORDER_HEADER_INX-UPDATEFLAG = 'U'.
    zORDER_HEADER_INX-SALES_ORG  = 'X'.
    zORDER_HEADER_INX-DISTR_CHAN = 'X'.
    zORDER_HEADER_INX-DIVISION = 'X'.
    Ship to pary
    zORDER_PARTNERS-PARTN_ROLE = 'WE'.
    zORDER_PARTNERS-PARTN_NUMB = 'BPAFS0007'.
    append zORDER_PARTNERS.
    zPARTNERCHANGES-DOCUMENT = '45'.
    zPARTNERCHANGES-ITM_NUMBER = '10'.
    zPARTNERCHANGES-UPDATEFLAG = 'U'.
    zPARTNERCHANGES-PARTN_ROLE = 'WE'.
    zPARTNERCHANGES-P_NUMB_OLD = 'BPAFS0001'.
    zPARTNERCHANGES-P_NUMB_NEW = 'BPAFS0007'.
    append zPARTNERCHANGES.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
      EXPORTING
        SALESDOCUMENT               = so_no
        ORDER_HEADER_IN             = zBAPISDHD
        ORDER_HEADER_INX            = zORDER_HEADER_INX
      SIMULATION                  =
      BEHAVE_WHEN_ERROR           = ' '
      INT_NUMBER_ASSIGNMENT       = ' '
      LOGIC_SWITCH                =
      NO_STATUS_BUF_INIT          = ' '
      TABLES
        RETURN                      = zRETURN
      ORDER_ITEM_IN               =
      ORDER_ITEM_INX              =
        PARTNERS                    = zORDER_PARTNERS
        PARTNERCHANGES              = zPARTNERCHANGES.
      PARTNERADDRESSES            =
      ORDER_CFGS_REF              =
      ORDER_CFGS_INST             =
      ORDER_CFGS_PART_OF          =
      ORDER_CFGS_VALUE            =
      ORDER_CFGS_BLOB             =
      ORDER_CFGS_VK               =
      ORDER_CFGS_REFINST          =
      SCHEDULE_LINES              =
      SCHEDULE_LINESX             =
      ORDER_TEXT                  =
      ORDER_KEYS                  =
      CONDITIONS_IN               =
      CONDITIONS_INX              =
      EXTENSIONIN                 =
    data : s_BAPIRET2 like  BAPIRET2.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    exporting
    wait = 'X'
    importing
    return = s_bapiret2.

    Thanks Prashanth. It worked !!!!!!!!!!!!!
    Now I am facing another type of problem. The requirement is to change the Sales Order Item Quantity. I basically planned to update the quantity of Schedule Item which needs to be changed. When I run the below code, it works and says the Sales Order changed succesfully. However I get an express message saying the Database update failure. I don't get any sort of technical information.
    Appreciate if you could help me finding the error.
    Thanks
    regards
    girish
    Note --> I am trying to change the Quantity for 2 line item in SO '56' to 40 Units.
    REPORT  ZBAPI_SALESORD_CHANGE.
    data : zBAPISDHD       type /AFS/BAPISDHD,
           zORDER_HEADER_INX    TYPE /AFS/BAPISDHDX,
           zSALESDOCUMENT  type BAPIVBELN-VBELN.
    data : zORDER_ITEMS_IN     like /AFS/BAPISDITM   occurs 0 with header line,
           zORDER_ITEM_INX     like /AFS/BAPISDITMX  occurs 0 with header line,
           zORDER_SCHEDULES_IN like /AFS/BAPISDSCHD  occurs 0 with header line,
           ZSCHEDULE_LINESX    LIKE /AFS/BAPISDSCHDX occurs 0 with header line,
           zORDER_PARTNERS like BAPIPARNR      occurs 0 with header line,
           zRETURN         like BAPIRET2 occurs 0 with header line,
           so_no           type BAPIVBELN-VBELN,
           zPARTNERCHANGES like  BAPIPARNRC occurs 0 with header line.
    data : l_comp_qty like zORDER_ITEMS_IN-COMP_QUANT.
    data : g_qty like /AFS/BAPISDSCHD-REQ_QTY.
    g_qty = 40.
    l_comp_qty = 40.
    clear : zBAPISDHD.
    so_no = '0000000056'.
    zBAPISDHD-REFOBJTYPE = '/AFS/ORDER'.
    zBAPISDHD-SALES_ORG = 'BP01'.
    zBAPISDHD-DISTR_CHAN = '02'.
    zBAPISDHD-DIVISION = '01'.
    zBAPISDHD-PMNTTRMS = '0001'.
    zORDER_HEADER_INX-UPDATEFLAG = 'U'.
    zORDER_HEADER_INX-SALES_ORG  = 'X'.
    zORDER_HEADER_INX-DISTR_CHAN = 'X'.
    zORDER_HEADER_INX-DIVISION = 'X'.
    zORDER_HEADER_INX-PMNTTRMS = 'X'.
    **********ITEM ***************************************
    zORDER_ITEMS_IN-ITM_NUMBER = '00020'.
    zORDER_ITEMS_IN-MATERIAL = 'F1202'.
    zORDER_ITEMS_IN-PLANT = 'BP01'.
    zORDER_ITEMS_IN-ITEM_CATEG = 'TAS'.
    zORDER_ITEMS_IN-SHIP_POINT = 'BP01'.
    zORDER_ITEMS_IN-COMP_QUANT = l_comp_qty.
    zORDER_ITEMS_IN-TARGET_QTY = l_comp_qty.
    zORDER_ITEMS_IN-TARGET_QU = 'ST'.
    append zORDER_ITEMS_IN.
    zORDER_ITEM_INX-ITM_NUMBER = '00020'.
    zORDER_ITEM_INX-UPDATEFLAG = 'U'.
    zORDER_ITEM_INX-MATERIAL = 'X'.
    zORDER_ITEM_INX-PLANT = 'X'.
    zORDER_ITEM_INX-ITEM_CATEG = 'X'.
    zORDER_ITEM_INX-SHIP_POINT = 'X'.
    zORDER_ITEM_INX-COMP_QUANT = 'X'.
    zORDER_ITEM_INX-TARGET_QTY = 'X'.
    zORDER_ITEM_INX-TARGET_QU = 'X'.
    append zORDER_ITEM_INX.
    *********SCHEDULE LINE******************************
    refresh zORDER_SCHEDULES_IN.
    clear zORDER_SCHEDULES_IN.
    zORDER_SCHEDULES_IN-ITM_NUMBER = '000020'.
    zORDER_SCHEDULES_IN-SCHED_LINE = '0001'.
    zORDER_SCHEDULES_IN-REQ_DATE = '20070525'.
    zORDER_SCHEDULES_IN-DATE_TYPE = '1'.
    zORDER_SCHEDULES_IN-SCHED_TYPE = 'CS'.
    zORDER_SCHEDULES_IN-GRID_VALUE = 'BLK2728'.
    zORDER_SCHEDULES_IN-REQ_CATEGORY = '1DE'.
    zORDER_SCHEDULES_IN-REFOBJTYPE = '/AFS/ORDER'.
    zORDER_SCHEDULES_IN-REQ_QTY = g_qty.
    append zORDER_SCHEDULES_IN.
    refresh ZSCHEDULE_LINESX.
    clear ZSCHEDULE_LINESX.
    ZSCHEDULE_LINESX-ITM_NUMBER = '000020'.
    ZSCHEDULE_LINESX-SCHED_LINE = '0001'.
    ZSCHEDULE_LINESX-UPDATEFLAG = 'U'.
    ZSCHEDULE_LINESX-REQ_DATE = 'X'.
    ZSCHEDULE_LINESX-DATE_TYPE = 'X'.
    ZSCHEDULE_LINESX-SCHED_TYPE = 'X'.
    ZSCHEDULE_LINESX-GRID_VALUE = 'X'.
    ZSCHEDULE_LINESX-REQ_CATEGORY = 'X'.
    ZSCHEDULE_LINESX-REFOBJTYPE = 'X'.
    ZSCHEDULE_LINESX-REQ_QTY = 'X'.
    append ZSCHEDULE_LINESX.
    CALL FUNCTION '/AFS/BAPI_SALESORD_CHANGE'
      EXPORTING
        SALESDOCUMENT               = so_no
        ORDER_HEADER_IN             = zBAPISDHD
        ORDER_HEADER_INX            = zORDER_HEADER_INX
      SIMULATION                  =
      BEHAVE_WHEN_ERROR           = ' '
      INT_NUMBER_ASSIGNMENT       = ' '
      LOGIC_SWITCH                =
      TABLES
        RETURN                      = zRETURN
        ORDER_ITEM_IN               = zORDER_ITEMS_IN
        ORDER_ITEM_INX              = zORDER_ITEM_INX
        ORDER_SCHEDULE_LINES        = zORDER_SCHEDULES_IN
        ORDER_SCHEDULE_LINESX       = ZSCHEDULE_LINESX.
      PARTNERS                    =
      PARTNERCHANGES              = zPARTNERCHANGES
      PARTNERADDRESSES            =
      ORDER_CFGS_REF              =
      ORDER_CFGS_INST             =
      ORDER_CFGS_PART_OF          =
      ORDER_CFGS_VALUE            =
      ORDER_CFGS_BLOB             =
      ORDER_CFGS_VK               =
      ORDER_CFGS_REFINST          =
      ORDER_TEXT                  =
      ORDER_KEYS                  =
      CONDITIONS_IN               =
      CONDITIONS_INX              =
      EXTENSIONIN                 =
    *CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
       SALESDOCUMENT               = so_no
       ORDER_HEADER_IN             = zBAPISDHD
       ORDER_HEADER_INX            = zORDER_HEADER_INX
    TABLES
       RETURN                      = zRETURN
       ORDER_ITEM_IN               = zORDER_ITEMS_IN
       ORDER_ITEM_INX              = zORDER_ITEM_INX
       PARTNERS                    = zORDER_PARTNERS
       PARTNERCHANGES              = zPARTNERCHANGES
      PARTNERADDRESSES            =
      ORDER_CFGS_REF              =
      ORDER_CFGS_INST             =
      ORDER_CFGS_PART_OF          =
      ORDER_CFGS_VALUE            =
      ORDER_CFGS_BLOB             =
      ORDER_CFGS_VK               =
      ORDER_CFGS_REFINST          =
      SCHEDULE_LINES               = zORDER_SCHEDULES_IN
      SCHEDULE_LINESX              = ZSCHEDULE_LINESX.
      ORDER_TEXT                  =
      ORDER_KEYS                  =
      CONDITIONS_IN               =
      CONDITIONS_INX              =
      EXTENSIONIN                 =
    data : s_BAPIRET2 like  BAPIRET2.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    importing
    return = s_bapiret2.

  • I have the new 2011 macbook pro, with lion preinstalled. I want to change the harddrive. I have backed up everything on time machine. when i put my new blank hard drive in will the lion screen startup.How do i get the lion dmg when i am already using lion

    I have the new 2011 macbook pro, with lion preinstalled. I want to change the harddrive. I have backed up everything on time machine. when i put my new blank hard drive in will the lion screen startup.How do i get the lion dmg when i am already using lion

    NicholasLiban -
       When you use the Lion restore as described, it does a fresh install on the hard drive that you can select at the beginning of the process.  This provides a complete install of the very latest version of Lion, including the recovery partition.  The drive that you choose for the installation destination winds up like what you would have on a brand new computer from Apple. 
       - Randy

  • HT4437 I have a Pioneer VSX-1012-K and i want to change the name of it on my iphone to something elce. Is there any way i can do this.

    I have a Pioneer VSX-1012-K airplay amp and I want to change the name of it when i am using AirPlay. Is there any way i can do this?

    If it is showing off line, either the battery is dead, the SIM has been removed or the iPhone has been restored. Report it to you carrier. Some offer blacklisting. You can also send a remote wipe to the phone via iCloud. There was also the option to send you an email if the phone is located when you were in Find My iPhone. Report it to law enforcement, change the passwords on all accounts that were on the device. Did you have a passcode on it?

  • OK so I just made a wireless network and using the apple box or whatever. And I want to change the network name. How do I do that?

    OK so I just made a wireless network and using the apple box or whatever. And I want to change the network name. How do I do that?

    Just want to confirm that I am also having this issue, The connection is fine, and it is in fact charging (@ 100%)
    Everything Rick has said is like an echo to what is happening to me.
    I have tried re-installing iTunes, and restarting the Bonjour service, sadly there is no change.
    earlier before i updated iTunes it recognised my iPod but said that I had to update iTunes in order for it to work.
    So i updated iTunes but now it's not even showing the device anywhere.
    In case this helps:
    OS: Windows 8.1
    iTunes version: 11.3.1.8
    Device: 5th generation iPod touch 16GB with ios 7

  • HT201363 I want to change the email address used as rescue email for my security questions. But I can't remember the answers to the security questions and I dont have access to the rescue email anymore. Please help.

    I want to change the email address used as rescue email for my security questions. But I can't remember the answers to the security questions and I dont have access to the rescue email anymore. Please help.

    -If you established a rescue email address, there will be a link on the "Passwords & Security" page of id.apple.com.  Clicking the link will send the reset to your rescue email address (NOTE:  This is not the same address as your Apple ID email)
    -If there is no link on the page, then you didn't establish a rescue email address.  Contact AppleCare at 800.694.7466 (If you are in the US), and ask for account security.  You will need to answer some questions to verify your identity, AND you will need access to a computer to generate a temporary support pin.
    -If you are not in the US, click http://support.apple.com/kb/HT5699 - Apple ID: Contacting Apple for help with Apple ID account security
    HTH

  • Want to change the skin of tab , where i need the Graident mix to be used .

    Hi
    1. want to change the skin of tab , where i need the Graident mix to be used ... is it possible ?
    2. how to use Cool Animations( Fading of Old Panel to New Panel) while switching to next tab.

    Click the heading of the left-most column of numbers in order to reveal the current Play Order. When sorted on this column you can drag tracks up or down the list.
    When using another heading for sorting you can right-click on the playlist name and click Copy to Play Order to set an initial order which you can then manually refine.
    tt2

  • I want to change the email that iCloud  uses to send security answers to and i don't know how.

    Hi, i just installed my mavericks and i was going through all my settings and keychains and everyting. Last month i deleted the email account that i think we use to send the answers of the security questions on and i forgot the answers. I want to change the email that iCloud  uses to send security answers to and i don't know how. Can it be done?

    You need to contact Apple. Click here, phone them, and ask for the Account Security team, or fill out and submit this form.
    (91794)

  • I want to change the page a new tab opens to. I am only getting "Yeppo" no matter what I do. I will permanently movve to Chrome if this cannot be fixed.

    I am able to set my homepage, but not the new tab. I want to change the new tab to my homepage. Right now, it only opens to Yeppo. If this cannot be fixed, I will be forced to permanently move to Google Chrome.

    Firefox is highly customizable, you can make Firefox 4 look and behave more like Firefox 3.6, for details see http://redherring2.wordpress.com/2011/01/17/firefox-4-restoring-firefox-3-ui
    The search option is at the top of this page, or for advanced search use https://support.mozilla.com/en-US/search?a=2

  • I want to change the name of paragraphs styles. Is this possible by script.

    I want to change the name of paragraphs styles. Is this possible by script.
    Thank you

    Hi Hasvi,
    May the below coding helps for your question:
    var myDocument = app.activeDocument
    var myPStyles = myDocument.paragraphStyles.everyItem().getElements()
    for(i=2; i<myPStyles.length; i++)
    myPStyles[i].name = "A_".concat(myPStyles[i].name);   //Please change as per your requirement
    //myPStyles[i].name = "BBBBBB_".concat(myPStyles[i].name);
    Please use the below URL for more details.
    http://forums.adobe.com/message/4909340#4909340
    If my answers helps you, please provide "Helpful" or "Correct Answer" for me.
    Thanks
    Siraj

  • I want to change the sharing and permissions of a large number of photos. How can I do this in bulk rather than one at a time?

    I want to change the sharing and permissions of a large number of photos. How can I do this in bulk rather than one at a time?

    Does this involve iPhoto in some way?

  • HT204053 I used one Apple ID to set up iCloud after iOS 6 was downloaded to my iPhone, now I want to change the Apple ID for iCloud on my iPhone but I'm unable to. How do you change the ID after it's been set up?

    I used one Apple ID to set up iCloud after iOS 6 was downloaded to my iPhone, now I want to change the Apple ID for iCloud on my iPhone but I'm unable to. How do you change the ID after it's been set up?

    See https://discussions.apple.com/message/19218571#19218571.

Maybe you are looking for

  • Itunes not working after 10.5 install. NOT plug in issue. . .

    this is on a 15" powerbook 1.5ghz 1 gb I dont know what else it is. I have done the plug in fix that has been listed already on here. nothing. itunes will not even get near opening. it will almost immediately give you the "application had to quit" me

  • Which os system is compatible with which Mac

    Could anybody produce a list of different Mac models with their compatible OS sytems? We can find on internet the system that comes with a new Mac but nothing about the ones we can upgrade to. Exemple : Let suppose I bought a MacBook Pro with Lion Ma

  • JScrollPane Question

    Hi, I am writing a simple java GUI application that feeds real-time data to surgeons during a brain surgery. I am using a JTextArea component inside a JScrollPane to display information. As the data get more than the window can display, the horizonta

  • Scheduling Webi reports from SAP Portal.

    is there a way to schedule webi reports from the SAP enterpirse portal. Toor.

  • External Webservice Respose Error.

    Hi While connecting to external system from my BPEL(JDeveloper 11.1.1.5) Process, I am getting the following error in response.Earlier I could able to get response properly from the same deployment,but not sure what went wrong. any help ?? Response f