Unable to update sales order unsing the BAPI 'BAPI_SALESORDER_CHANGE'

Hi All,
I am unable to update the payment method field for some sales orders using the bapi 'BAPI_SALESORDER_CHANGE'. I am getting the reason in the table RETURN as 'Field 'ZLSCH' cannot be changed, VBAPKOM 000050  ready for input'.
Could anyone throw some light on it.
Thanks a ton.
Regards,
Santosh Kotra.

Hi
Without reversing invoice we can't update price and this is standard bevaior which is logical too. For your scenario I am wondering why would you want to change price for a line item or order which is alrady invoiced and posted to FI. What difference would it make to change price in sale order when this has already been posted in FI?
Thank$

Similar Messages

  • Unable to update Sales order item level prices after invoice is created

    Dear All ,
    I have the following issue .
    When the sales order was created Z001 price was populated based on the condition record and  the order was in complete status  Then we created delivery and  invoice , the invoice had the same price as that of sales orders.
    Due to some code change related to pricing condition type - Z001 the prices in the sales order is changed to "ZERO" , when the sales order is opened in VA02 .
    We now corrected the code related to condition type - Z001  and now need to get back the on the line items . I wanted to Update prices by clicking on icon " Update" in the line item condition tab . I am not able to do it as the update icon is grayed out.
    Can any one help me with ideas for  fixing this issue  or any SAP utility  program .
    Looking forward to your help .
    Thanks and regards
    Veera

    Hi
    Without reversing invoice we can't update price and this is standard bevaior which is logical too. For your scenario I am wondering why would you want to change price for a line item or order which is alrady invoiced and posted to FI. What difference would it make to change price in sale order when this has already been posted in FI?
    Thank$

  • Update sales Order at the time of Delivery creation

    When the Delivery gets picked and Post Goods issued , the Delivery quantity for example instead of 48,000 LBS may be little less say 47,345 LB.  We need to update this number in the order quantity which will originally have 48,000 LBS.
    Can we do this through Delivery Userexit? Will Sales order structures be avaialable at that point in time? Which one? How ?
    Is this the best way or is there any other better way to handl this?

    No this is complete Delivery. Its just that the product cannot be exactly whats asked for in the sales order and we have to reflect the true value after it is weighed at the time of post goods issue

  • Creating the Sales Order using the bapi BAPI_SALESORDER_CREATEFROMDAT2

    Hi,
    My problem is , i have created one module pool program for accelerating the Sales Order creation.
    I am using the bapi BAPI_SALESORDER_CREATEFROMDAT2 for sales order creation. After executing the program
    bapi is given an errot that, incomplete sales order document is saved.
    Can any body tell me plz what are the necessary fields i need to take in the header and item level , so that the complete
    document will be saved through BAPI.
    <removed_by_moderator>
    Thanks
    Edited by: Julius Bussche on Jan 11, 2010 12:09 PM

    TABLES: VBAK,                             "Sales Document: Header Data
            VBAP.                             "Sales Document: Item Data
    *************************************WORK AREA DECELERATION************************
    DATA: BEGIN OF WA_HEADER,
            LI    TYPE I,                      "LINE TYPE
            AUART TYPE VBAK-AUART,             "Sales Document Type
            VKORG TYPE VBAK-VKORG,             "Sales Organization
            VTWEG TYPE VBAK-VTWEG,             "Distribution Channel
            SPART TYPE VBAK-SPART,             "Division
            KUNNR TYPE BAPIPARNR-PARTN_NUMB,   "Customer number
          END OF WA_HEADER.
    DATA: BEGIN OF WA_ITEM,
            LI     TYPE I,
            MATNR  TYPE VBAP-MATNR,            "MATERIAL NUMBER
            ZMENG  TYPE VBAP-ZMENG,           "QUANTITY
          END OF WA_ITEM.
    ***********************************INTERNAL TABLE DECELERATION***************************************
    DATA: IT_HEADER      LIKE TABLE OF WA_HEADER WITH HEADER LINE.                   "IT FOR HEADER
    DATA: IT_ITEM        LIKE TABLE OF WA_ITEM WITH HEADER LINE.                     "IT FOR ITEM
    DATA: IT             LIKE VBAK OCCURS 0 WITH HEADER LINE.
    ***************************SALES ORDER INTERNAL TABLE DECELERATION********************************
    DATA:
          HEADER  TYPE TABLE OF BAPISDHEAD WITH HEADER LINE,        "SALES HEADER DATA
          ITEMS   TYPE TABLE OF BAPIITEMIN WITH HEADER LINE,         "SALES ITEM DATA
          PARTNERS TYPE TABLE OF BAPIPARTNR WITH HEADER LINE.      "SALLES PARTNERS
    ***********************************DYNAMIC FIEL PATH GETTING DECELERATION************************
    DATA : HL_FIELD_NAME TYPE DYNPREAD-FIELDNAME VALUE 'G_P_SPATH',              "SCREEN FIELD NAME
           HL_FILE_NAME  TYPE IBIPPARMS-PATH VALUE 'G_P_SPATH',                  "Local file for upload/download
           IL_FIELD_NAME TYPE DYNPREAD-FIELDNAME VALUE 'G_P_EPATH',              "SCREEN FIELD NAME
           IL_FILE_NAME  TYPE IBIPPARMS-PATH VALUE 'G_P_EPATH',                  "Local file for upload/download
           FL_FIELD_NAME TYPE DYNPREAD-FIELDNAME VALUE 'G_P_EPATH',              "SCREEN FIELD NAME
           FL_FILE_NAME  TYPE IBIPPARMS-PATH VALUE 'G_P_EPATH'.                  "Local file for upload/download
    DATA : CTR TYPE I .
    DATA : CTR2 TYPE STRING.
    DATA : CTR1 TYPE STRING.
    Sales document number
    DATA : L_VBELN LIKE BAPIVBELN-VBELN.
    SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE T1.
    SELECTION-SCREEN : SKIP.
    PARAMETER        : P_HPATH TYPE STRING.
    PARAMETER        : P_IPATH TYPE STRING.
    SELECTION-SCREEN : SKIP.
    SELECTION-SCREEN : END OF BLOCK B1.
    SELECTION-SCREEN : BEGIN OF BLOCK B2 WITH FRAME TITLE T2.
    SELECTION-SCREEN : SKIP.
    SELECTION-SCREEN : BEGIN OF LINE.
    SELECTION-SCREEN : PUSHBUTTON 10(14) UPLOAD USER-COMMAND CLICK1.
    SELECTION-SCREEN : END OF LINE.
    SELECTION-SCREEN   END OF BLOCK B2.
    ******************************************INITIALIZATION.***************************************************
    INITIALIZATION.
      T1       = 'Putchase Order Source File Path'.
      T2       = 'Push Button'.
      UPLOAD   = 'Upload'.
    *******************************************AT SELECTION SCREE EVENT********************************************
    AT SELECTION-SCREEN.
      CASE SY-UCOMM.
        WHEN 'CLICK1'.
          IF P_HPATH IS INITIAL AND P_IPATH IS INITIAL.      "CHECKING BTHE THE TEXT BOX
            MESSAGE I009.
          ELSE.
            PERFORM SELECT.                                  "CALLING THE SELECT SUBROUTINE
          ENDIF.
        WHEN OTHERS.
          MESSAGE 'PRESS FORM BUTTON' TYPE 'I'.      "WHEN EXECUTE BUTTON IS PRESSED
      ENDCASE.
    ***********************************GETTING HEADER FIEL PATH*******************************************
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_HPATH.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME  = SYST-CPROG
          DYNPRO_NUMBER = SYST-DYNNR
          FIELD_NAME    = HL_FIELD_NAME
        IMPORTING
          FILE_NAME     = HL_FILE_NAME.
      P_HPATH = HL_FILE_NAME.
    ***********************************GETTING ITEM FIEL PATH*******************************************
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_IPATH.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME  = SYST-CPROG
          DYNPRO_NUMBER = SYST-DYNNR
          FIELD_NAME    = IL_FIELD_NAME
        IMPORTING
          FILE_NAME     = IL_FILE_NAME.
      P_IPATH = IL_FILE_NAME.
    START-OF-SELECTION.
    *&      Form  SELECT
          text
    -->  p1        text
    <--  p2        text
    FORM SELECT .
      CALL FUNCTION 'GUI_UPLOAD'             " function resposible to get the local flat
          EXPORTING                          " and upload it in a internal table
            FILENAME            = P_HPATH
            FILETYPE            = 'ASC'
            HAS_FIELD_SEPARATOR = '#'
          TABLES
            DATA_TAB            = IT_HEADER.
      CALL FUNCTION 'GUI_UPLOAD'             " function resposible to get the local flat
          EXPORTING                          " and upload it in a internal table
            FILENAME            = P_IPATH
            FILETYPE            = 'ASC'
            HAS_FIELD_SEPARATOR = '#'
          TABLES
            DATA_TAB            = IT_ITEM.
      LOOP AT IT_HEADER.
        Initialize Header values
        HEADER-DOC_TYPE     =  IT_HEADER-AUART.
        HEADER-SALES_ORG    =  IT_HEADER-VKORG.
        HEADER-DISTR_CHAN   =  IT_HEADER-VTWEG.
        HEADER-DIVISION     =  IT_HEADER-SPART.
        APPEND HEADER.
        PARTNERS-PARTN_ROLE = 'WE'.
        PARTNERS-PARTN_NUMB = IT_HEADER-KUNNR.
        APPEND PARTNERS.
        CTR = 10.
        LOOP AT IT_ITEM WHERE LI = IT_HEADER-LI.
          CTR2 = CTR.
          CONCATENATE '0000' CTR2 INTO CTR1.
    ***Initialize Item values
         ITEMS-ITM_NUMBER   = IT_ITEM-ITEM.
          ITEMS-ITM_NUMBER   = CTR1.
          ITEMS-MATERIAL     = IT_ITEM-MATNR.
          ITEMS-REQ_QTY   = IT_ITEM-ZMENG.
          APPEND ITEMS.
          CTR = CTR + 10.
        ENDLOOP.
        CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT1'
          EXPORTING
            ORDER_HEADER_IN = HEADER                      "SALES HEADER DATA
          IMPORTING
            SALESDOCUMENT   = L_VBELN                        "RETRIEVED SALES DOCUMENT NUMBER
          TABLES
            ORDER_ITEMS_IN  = ITEMS                       "SALES ITEM LEVEL DATA
            ORDER_PARTNERS  = PARTNERS.                    "SAKES PARTNERS
        APPEND L_VBELN TO IT.
        COMMIT WORK AND WAIT.
        CLEAR : HEADER , ITEMS[] ,PARTNERS,CTR,CTR1,CTR2.
        REFRESH : ITEMS.
      ENDLOOP.
      IF IT[] IS NOT INITIAL.
        LOOP AT IT.
          WRITE: / 'SALES ORDER', IT-VBELN , 'CREATED'.
        ENDLOOP.
        LEAVE TO LIST-PROCESSING.
        SET PF-STATUS SPACE.
      ELSE.
        MESSAGE I044.
      ENDIF .
    ENDFORM.                    " SELECT

  • How to update Sales Order status using  BAPI_SALESORDER_CHANGE

    Hi,
    I want to update Sales Order status using BAPI_SALESORDER_CHANGE, this BAPI is called from middle ware, but there is no parameter to pass the status value to this function, please help me how to update sales order status using BAPI only.
    Thanks
    RK

    Hi,
    Can u give me details of what status u would like to update in sales order.
    If we are able to update the status from VA02, Then BAPI will assist for the same.
    Regards.

  • Sales order creation using BAPI in LSMW

    Hi ABAPers,
    I am trying to create Sales orders using the BAPI SALESORDER_CREATEFROMDAT2.
    I am supplying the item target quantity in sale units to the field
    E1BPSDITM-- TARGET_QTY. my documents are getting posted but when i go to VA03 to display my documents, the quantity is showing up as 0 for all items. and the document is incomplete.
    please any suggestions on this.
    Regards,
    Raj

    HI Raj M 
    jus refer the following link it has step by step procedure
    http://sapbrain.com/TUTORIALS/TECHNICAL/LSMW_tutorial.html

  • Updating Sales Order Retrospectively with PGI figure

    Hi
    Does anyone know if there is a way of retrospectively updating sales order with the value that has actually been POST GOODS ISSUED
    Thanks
    Tony

    What do you mean by Value? does the Value of the item change during PGI?
    If you mean to say, quantity, then yes, After PGI, go back to your order and change the order qty = PGI qty.
    Regards
    Sai

  • Searching for Sales Order for the given Customer PO Number Pattern in BAPI

    Hi,
         I have developed a BAPI which retrieves all the Sales Orders for a given Customer (Sold-To). The Following are the Input Parameters given in the Function Module (RFC).
    Customer Number (Mandatory)
    From Date (Optional)
    To Date (Optional)
    Sales Order Number(Optional)
    Customer PO Number(Optional)
    Now, when the Customer PO Number is populated, it will come as a Pattern, say 9ab* and I need to retrieve all the Sales Orders with PO Number starting with 9ab.
    When I am trying to retrieve, it is giving different set of output based on the Case specified in the Customer PO Number Pattern. Lets say, if I give 9ab, I get 200 Records but if I give 9AB, I get only 5 to 6 Records.
    As I have understood from the Standard Transaction VA03, it has a Search Help VMVAA which retrieves all the Sales Orders for the given PO Number pattern irrespective of the Case, that is Lower Case, Upper Case or Mix of Upper and Lower Case.
    I can see the Code in the Search Help Exit but couldn't find useful piece of code which I can implement in my BAPI to simulate the same.
    Can somebody help me on this?
    Thanks,
    Venkat.

    Hi Sudhir,
             I think you did not understand what my problem is. What I mean to say is, for Customer X, the PO Number could be 9abc and for Customer Y, the PO Number Could be 9ABC.
           So, according to your logic, if I translate it to Upper Case, it will give the Sales Order details of Customer Y to Customer X.
          And more over, SAP stores the PO Number as it is entered in the Sales Order Screen (VA01).
        What if the Customer PO Number for Customer X is 9aBcDeFgH? and the PO Number for Customer Y is 9AbCdEf?
       Hope you've understood my question.
    Thanks,
    Venkat.

  • Function Module or BAPI to update Sale Order Quantity (VBAP-kwmeng)

    Hi,
    I have a requirement to use a Function Module or BAPI to update Sale Order Quantity (VBAP-kwmeng), which one (Function Module or BAPI) should I use? is there any sample codes?
    Thanks a lot!!

    Hi,
    *& Report  ZTEST
    REPORT  ztest.
    DATA : wa_header TYPE bapisdh1x,
                i_item TYPE TABLE OF bapisditm WITH HEADER LINE,
                i_itemx TYPE TABLE OF bapisditmx WITH HEADER LINE,
                i_return TYPE TABLE OF bapiret2.
               wa_header-updateflag = 'U'.
               i_item-itm_number = '000010'.
               i_item-target_qty = '4'.
               APPEND i_item.
              i_itemx-itm_number = '000010'.
              i_itemx-updateflag = 'U'.
              i_itemx-target_qty = 'X'.
              APPEND i_itemx.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
      EXPORTING
        salesdocument               = '1234567890'
        order_header_inx            = wa_header
      TABLES
        return                            = i_return
        order_item_in                 = i_item
        order_item_inx               = i_itemx
    Hope this will help you.
    Regards,
    Anand.

  • Update sales order qty through BAPI_SALESORDER_CREATEFROMDAT2

    HI
    Can anybody help me out.  I have the requirement for creating sales order through BAPI_SALESORDER_CREATEFROMDAT2. The sales order is created but with 0 quantity.
    I am using fields RNDDLV_QTY and TARGET_QTY and REQ_QTY in schedule lines & also setting the update indicator to 'X'  in the corresponding itemx structures.
    In fact it used to work earlier and has stopped now. I am also checking if there could be any change in configuration but don't think this should be the reason.
    Can someone guide me as to which quantity fields of the BAPI are the right ones to update sales order qty?
    thanks

    Hi,
    You are using the correct fields i.e. TARGET_QTY and REQ_QTY. Just check if you are passing the same Item Number in both the tables.
    Hope it helps...
    Lokesh

  • Error message when updating Sales Orders

    Hi Experts
    Following an issue over the weekend when I was forced to perform a  hard reset we are now experiencing error message when trying to update some sales orders. 
    This entry already exists in the following tables " ADO1 (ODBC - 2035) [Message 131 - 183]
    it is not happening on all orders - i think only ones which were on the system prior to the reset.
    We also use webtools and the B1SyncService seems to be causing the SAP B1 system to become unusable - following each attempt to sync there is an error in the event log:
    Event Type:     Error
    Event Source:     B1SynchService
    Event Category:     None
    Event ID:     0
    Date:          29/06/2009
    Time:          13:42:38
    User:          N/A
    Computer:     SQL01
    Description:
    A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)
       at netpoint.api.data.DataFunctions.ExecuteScalar(String SQL, String connectionstring)
       at NetPoint.SynchSBO.SBOObjects.SBOUtility.SetCompany(Company TheCompany, SecurityTicket securityTicket)
       at NetPoint.SynchSBO.Synch.SetCompany()
       at NetPoint.SynchSBO.Synch..ctor(SecurityTicket ticket)
       at NetPoint.SynchSBO.Synch..ctor(SecurityTicket ticket, Int32 pricinginterval)
       at NetPoint.SynchService.NPSynchService.Synch(String profile, Mutex mutex)
       at NetPoint.SynchService.NPSynchService.Main(String[] args)
    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
    For now I have had to stop the SyncService to prevent B1 from becoming unusable (users are unable to start any AR module), but even after I have stopped the syncservice I still have the error when updating sales orders.
    Regards
    Jon

    Dear Johnny,
    the error reported sounds like a DB Corruption. I would advise you to log a message to SAP Support including all the details in order to obtain the error message. It is also a good idea and it will speed up the process if you include some print screens showing exactly the error message.
    Hope my reply helps you to solve the issue.
    Regards,
    Wesley Honorato

  • Any standard process to update Sales Order in SAP via XI / Idoc ?

    Hello,
    Currently one of our end customer is creating Sales Order in Oracle system. Once the Order is created there, they send the Order information to our XI system via flat file. XI system processes the flat file and then it calls order creation function using rfc / BAPI - BAPI_SALESORDER_CREATEFROMDAT2. This works just fine.
    But now the customer wants an ability to update sales order, cancel certain line or even cancel the whole order in their Orcale system. And once that happens, they want the same thing to happen in SAP via some kind of interface automatically in the background.
    So my question is :
    what is the best way to do it ?
    Is it possible to do via idoc ? The reason I am asking it via idoc is because it sounds that's the most standard way of doing it in SAP.
    What idocs can I use ?
    Has any one implemented such interface ? And if so, can you share some info ?
    Any response is highly appreciate.
    thanks,
    Dipankar

    I woudl suggest you check ORDERS05 IDOC type (ORDCHG message type).
    FM - idoc_input_ordchg

  • Problem updating sales order partner addresses

    Hi all,
    iam trying to update addresses on sales order if there is any update on on the delivery.
    I update the VBPA-ADRNR and create the same ADRC-ADRNR.
    but when iam updating VBAP-VBELN for order using BAPI_SALESORDER_CHANGE there is a new ADRNR being created in VBPA as opposed to using the ADRNR i pass to the BAPI which is the delivery ADRNR.
    Can someone help me resove this...
    and one more small question..
    what do i pass to the paramter addr_handle in the fm ADDR_NUMBER_GET..

    i need to insert/update a record in adrc as soon as an address is updated in VBPA-VBELN of delivery.
    for this want to use ADDR_NUMBER_GET , ADDR_UPDATE/ADDR_INSERT.
    and after this process i am updating sales orders.
    but iam filling the tables u mentioned...the problem is teh new adrnr the bapi is generating instead of the one iam passing it in ADDRNUMBER(new ADRNR) in PARTNERCHANGES table and also iam passing ADDRLINK(old adrnr) field in PARTNERADDRESSES table.

  • Post Goods Issue - Tracing backward to update Sales Order & Delivery Docs

    I have a requirement as follows. I need to do a Sales Document change and a delivery document change prior to  goods Issue being done. The situation is to prevent SAP's normal back order processing from kicking off. I am quite confused about which method to use to achieve this. Wether BAPI &/or BDC &/or User Exit ???
    Please help you will be rewarded with points....

    Hello Srinivas
    The business requires that like order line items be consolidated to one line item prior to the order going to the warehouse for picking. this will aid in picking at the warehouse as well as result in the customer invoice not reflecting more than one line item for the same material. In the case where the customer has truly ordered more than a case, i.e. 1 case 2 eaches. The documents in SAP should still reflect 2 line items.
    The business also states that there be a 1 to 1 relationship between sales order and delv note. This means any unconfirmed line items must be closed out after del. note is created for the sales order. The closing out of the sales order will stop SAP from automatically creating a backorder once the unconfirmed line items become available in inventory.
    The business also requires that all partial line items in the delv. due to stock not available at the time of picking (those line items need to be updated) with the pick qty. And the line items which were not picked need to be automatically cancelled out. In addition the order line item must be rejected with a reason code for the line item which were not picked.
    We have a daily IDOC interface which creates shipments and updates delivery qty.
    I hope that clarifies the business. Pls let me know.
    Regards

  • Update Sale Order Header Text through Enhancement

    Hi Experts,
             I Have a requirement to update the sale order Header Text , when the sale order is opened in VA02 and saved.
    Here in I tried using edit_text, it updates sale order header text  directly in DB during run time even before the save action is completed.
    But I need to just fill the header text and that has to be saved during the save action only.
    I tried coding the same in the user exit (userexit_save_document) but this user exit gets triggered only when there is some changes made to the document when opened in VA02 & Saved.
    Is there any  user exist to pass sale Order Header text and save when save button is clicked irrespective of the document been changed or not.
    Thanks in advance
    Sathish

    Hi Brad Bohn,
        My actual requirement is to trigger an Idoc when the user goes to VA02 transaction and clicks save.
    IDoc gets triggered only when there is some changes to that document, that is through NAST table entry based on the output configurations in NACE transaction.
    Now that the user wants to trigger an IDoc even if there is no change (ie. to reprocess the IDoc) when he just opens a sale order in VA02 and click save.
    It is not possible to trigger an IDoc through configurations when there is no actual change in VA02 and saved.
    So it has to be forcefully sent by making some additions to the Order through coding, so I choose that Text box to fill some additional data and save .
    Kindly Let me Know any thing could be done for this scenario.
    Thanks in advance
    Sathish

Maybe you are looking for

  • Multidimensional Reporting

    Dear experts, I want to join an existing data model containing the following 2 data flows: 1) Content Flow from DataSource 1_CO_PAxx to Cube 0COPA_C01 (via Content InfoSource) 2) Customed Flow with Billing-Data to Cube from 2LIS_13_VDITM (via InfoSou

  • Not able to link Vendor and Customer

    I have created a vendor (V) and customer (C) without linking. Now when I edit the customer to associate vendor to it - when i add the vendor in 'Vendor' field and when saving it is giving error saying Vendor V is not linked to Customer C. This is hap

  • F110 for Accounts receivable

    Points available. <b>Is the F110 payment only used for outgoing payments? Can it  be used to process incoming payments from customers? If yes, how do we go about setting the config? Is it similar to the config used in FBZP?</b> Thanks in advance!

  • INSTALLING ACTIVEX ON MY MAC OS X PANTHER

    PLEASE HELP. In order for me to be granted access to ATT's DSL service I must first register for a permanent user id and password electronically. The problem is that their website requires ActiveX capabilities and I don't have it on any of my browser

  • I was in a rush and threw my iphone down on the passenger seat

    I was in a rush and threw my iphone down on the passenger seat & was then i was gone around 30mins without even thinking about it sitting in direct sunlight & it had a fully charged battery, my problem is that it now wont even turn on, ive tried char