BAPI 'BAPI_SALESORDER_CHANGE' - Change a field

Hi all!
I am doing an exercise which it's necessary to change just one field (PO number) in a sales order using the BAPI from the subject. After the execution of the BAPI, "return" table shows the following message:
E   |V2                  |051   |Terms of delivery FH are not defined.    <
E   |V4                  |219   |Sales document 0000001666 was not changed<
Here follows the code:
DATA: " for BAPI use
    v_vbeln LIKE vbak-vbeln, " order that i would like to change
    v_order_header_in LIKE bapisdh1,
    v_order_header_inx LIKE bapisdh1x,
    v_purch_no_c LIKE bapisdh1-purch_no_c, "
    v_return LIKE TABLE OF bapiret2.
INITIALIZATION.
  p_vbeln = 1666.
  v_order_header_inx-updateflag = 'U'.
  v_order_header_inx-purch_no_c = 'X'.
  CONCATENATE 'test_' v_purch_no_c INTO v_purch_no_c.
  v_order_header_in-purch_no_c = v_purch_no_c.
  v_order_header_inx-purch_no_c = 'X'.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
      salesdocument               = v_vbeln
      order_header_in             = v_order_header_in
      order_header_inx            = v_order_header_inx
    TABLES
      return                      = v_return.
If sy-subrc = 0.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
What does the error "Terms of delivery FH are not defined" mean? Did i forget to import an obligatory entry?
Thanks a lot!

Hi guys!
after a lot of tries i found what this error means. Let me explain what was the problem:
I was trying to update a single field at the sales order (po number), but l didn't see that this order had another field with a value ("FH") which was deleted and was get from another table.
So as you just specify in BAPI which fields you would like to change when in an update, problably the BAPI try to keep the rest of the fields without doing any kind of check. And this resulted in my problem with that error message.
Can i go ahead at this and ask if there is a way to make BAPI check the fields not specified at the import of the function?
Thanks a lot for everybody who tried to help me.

Similar Messages

  • Is there a function module or BAPI to change the field UVP03 in table VBUP

    When certain conditions are in place I need to change the value of VBUP-UVP03 (items reserve status 3) to a value of C).
    there must be a FM or bapi to do this - thanks.
    Scott

    We had to do this from a custom program that runs in a batch job.  It changes a field in VBAP using the BAPI_SALESORDER_CHANGE - that in turn will execute a user exit called userexit_set_status_vbup, that we added code to update the field vbup-uvp03.  it works.

  • Bapi to change "assignment" field on acct doc

    Hi,
    After the check run creates accounting docs, we want to update the "assignment" field on the accounting document (BSEG-ZUONR) with the check number.  Is there a BAPI I can use?  Or is this a job for a call transaction program?
    Thanks,
    Dennis

    Hi Dennis,
    I think the best way is to write custom BDC program to update BSEG-ZUONR. No BAPI/FM is available to update the assingment number (I could be wrong).
    Hope this will help.
    Regards,
    Ferry Lianto

  • Extending sales order change BAPI and updating custom fields

    Hi
    i added 3 new fields into VA01/02/03 screen.i added at the header level in the additional data tab B area and appended them in VBAK table.
    i want to change these values using sales order change BAPI.i added the fields in the structure VBAKKOZ,VBAKKOZX,BAPE_VBAK,BAPE_VBAKX.
    may i know what else i need to do?should i move them anywhere with in the code or does the bapi take those values automatically using EXTENSIONIN structure?
    also can some one send me code to actually check if bapi is changing my values?
    if poss tell me how should i populate values into BAPI.

    After adding field in structures VBAKKOZ,VBAKKOZX,BAPE_VBAK,BAPE_VBAKX, create pair of name-value pair extensiot structure and value.
    Fill values as follows :
    Data :   ls_parex  TYPE  bapiparex,
                lt_parex  TYPE STANDARD TABLE OF  bapiparex.
    ls_parex-structure = 'BAPE_VBAK'.
    ls_parex-valuepart1+0(10) = Sales order no
    ls_parex-valuepart1+10(XX) = somevalue.  <---- Value for custom field no 1
    ls_parex-valuepart1+XX(XX) = somevalue.  <---- Value for custom field no 2
    APPEND ls_parex TO lt_parex  .
    clear ls_parex.
    ls_parex-structure = 'BAPE_VBAKX'.
    ls_parex-valuepart1+0(10) = Sales order no
    ls_parex-valuepart1+10(1) = 'X'. <--- checkbox mark for custom field no 1
    ls_parex-valuepart1+11(1) = 'X'. <--- checkbox mark for custom field no 2
    APPEND ls_parex TO lt_parex.
    Same pair for VBAKKOZ & VBAKKOZX
    Updating custom fields
      CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          salesdocument    = Sales order number
          order_header_inx = 'U'   <--- U for update
        TABLES
          extensionin      = lt_parex[].
    Edited by: nkarwa on Oct 25, 2010 12:39 PM

  • BAPI: BAPI_SALESORDER_CHANGE - Document Change History

    Hi ,
    When I change a Sales Order usingthe BAPI: BAPI_SALESORDER_CHANGE, will it create the change history for the document?
    Appreciate Your help.
    Thanks,
    Kannan.

    Transaction is SCDO and look at object called VERKBELEG
    Check the below link :
    http://help.sap.com/saphelp_nw04s/helpdata/en/c7/69bccff36611d3a6510000e835363f/content.htm
    Thanks
    Seshu

  • BAPI-structure: invalid change message while changing structure field lengh

    Hi Experts,
      I've one structure which is used in many BAPIs.
      I want to change the field lengh of one of the field in the structure.
      When I'm activating it,  it is giving me message BAPI-structure: invalid change.
    Can you help me on this issue ?
    Naimish.

    Look at [BAPI Programming Guide (CA-BFA)|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf]
    If your BAPI is released, you wont be allowed to change the structure, so you should un-release the BAPI, BOR and FM before updating the structure parameter.
    Regards

  • BAPI for changing delivery date and delivery time fields in LIKP table

    Hi All,
         Is there any BAPI or function module to change the delivery date and delivery time in LIKP table ?
    Please tell me experts if exists.
    Thank you,
    Raghu.

    try these:
    BAPI/FM to update LIKP and VTTK tables
    http://sap.ittoolbox.com/groups/technical-functional/sap-dev/bapi-for-changing-sales-headertable-likp-662800

  • 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$

  • How can i change zz-field in VA01 transaction using BAPI_SALEORDER_CHANGE

    Hi ,
    i have to change the some customized fields (z-fields ) in transaction va02.
    how can i change the customized fields using bapi. i am using 'BAPI_SALEORDER_CHANGE' .
    i am writing my test program like this :
    wa_extension-structure = 'VBAK-ZZDELVRNO'."'BAPE_VBAK'.
    *"'VBAK-ZZDELVRNO'.
    wa_extension-VALUEPART1 = '100000303810'.
    wa_extension-VALUEPART2 = '123456'.
    append wa_extension to it_extension.
      MOVE: con_upgrade TO l_header_inx-updateflag,
      con_x TO l_header_inx-bill_block.  " Billing.
    l_faksk TO l_header_in-bill_block.  " Billing block.
    *--Call Bapi 'BAPI_SALESORDER_CHANGE' to change billing block
      CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
           EXPORTING
                salesdocument    = l_vbeln
                order_header_in  = l_header_in
                order_header_inx = l_header_inx
           TABLES
                 EXTENSIONIN    =  it_extension
                return           = it_return2.
    i don't know exactly wat's the value i have to populate into table EXTENSIONIN .
    it's very urgent .
    Thanks,
    kumar.

    BAPI-step by step procedure
    http://www.sapgenie.com/abap/bapi/example.htm
    list of all BAPI's
    http://www.planetsap.com/LIST_ALL_BAPIs.htm

  • Error in bapi while  changing  and add items in transparant table

    data : t_poitems type standard table of bapimepoitem,
           t_poitemx type standard table of bapimepoitemx,
           w_poitems type bapimepoitem,
           w_poitemx type bapimepoitemx,
           t_return type standard table of bapiret2,
           w_return type bapiret2.
    loop at t_modify_detail into w_modify_detail-ebeln.       * populating changing data
    *--&modifying fields
    w_poitems-po_item = w_modify_detail-ebelp.
    w_poitems-material = w_modify_detail-matnr.
            append w_poitems to t_poitems.
    w_poitemx-po_item = w_modify_detail-ebelp.
    w_poitemx-po_itemx = 'X'.
    w_poitems-material = 'X'.
            append w_poitemx to t_poitemx.
    endloop.
          call function 'BAPI_PO_CHANGE'
            exporting
              purchaseorder                =  w_header-ebeln
            POHEADER                     =
            POHEADERX                    =
            POADDRV
           tables
             return                        =     t_return
              poitem                       =    t_poitems
             poitemx                      =     t_poitemx
            POADDRDELIVERY               =      
    call function 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      WAIT  
    ERROR IS:
    giving error : cl_po_item_handle_mm.................cp
    function in which error showing: mepo docitem_get

    Check this sample code
    http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm
    BAPI PO CHANGE with MENGE
    Hope it helps to identify your requirement and fix accordingly.
    ashish

  • Can u tell me any predefined BAPI for change and creation of Material

    Hi,
        Can anybody tell me  predefined BAPI for change and creation of Materialmasterand Pricing?
    Thanks & regards,
    Gopianne.

    you can use the BAPI to BAPI_MATERIAL_SAVEDATA create as well as to change material master.
    When changing material master data, you need enter only the material
    number.
    In the header data, you must select at least one view for which data is
    to be created. Depending on the view selected, you must maintain other
    required parameters. If you do not enter values for all of the required
    parameters, the method is ended with an error message.
    The corresponding fields in the tables (such as CLIENTDATA) must first
    be supplied with data by the calling program. An indicator must also be
    set for each of these fields so that the data is written to the database
    by the method. This requires the calling program to supply the
    corresponding field with the indicator in a checkbox table (for example,
    CLIENTDATAX). Checkbox tables exist for tables that do not contain any
    language-dependent texts (MAKT, MLTX), International Article Numbers
    (MEAN), or tax classifications (MLAN). Several data records for a
    material can be created in these tables.
    regards
    vivek
    reward points if it helps

  • Passing Changed  extended fields using ALE-IDOC to receiving system

    Hi all,
    Please tell me how passing changed  extended fields using ALE-IDOC to receiving system can be achieved. Is it possible by Chnage pointer concept.Do i need to do some coading after data enters into receiving system as it is required while creating the entries in database table.
    For ex. in matmas05 extended for classification and inspection view and then created using 'CREATION'
    related bapi.Do i also need to incorporate the changes by change related bapi or ir can be handled by change pointer concept.
    Thanks.

    Hi Sanu
    1) Please tell me how passing changed extended fields using ALE-IDOC to receiving system can be achieved. Is it possible by Chnage pointer concept.
    => Looks like you have extended standard IDOC here. so you need to find User Exit or BADI for the Push program to populate the additional fields. Yes, it is possible thru change pointers as well.
    1) Do i need to do some coading after data enters into receiving system as it is required while creating the entries in database table.
    => Yes, as suggested in 1 try finding User Exits/BADIs.
    Regards
    Shital

  • BAPI for change PO confirmation date

    Hi,
    Does anyone know a bapi or a function module for change the confirmation date of one item of a purchase order ( that changes the field EINDT of table EKES ) ?
    I need to change it according to goods receipt date.
    Thanks in advance,
    Paulo Sousa

    you can use BAPI_PO_CHANGE
    In particular you would be interested in schedule line table POSCHEDULE in the function interface and the field for confirmation date is DELIVERY_DATE.
    Also you need to pass the BAPI some header fields like PO number etc and item fields liek material number etc along with the POSCHEDULE structure.
    Also remember to mark X in POSCHEDULEX for corresponding field POSCHEDULEX-DELIVERY_DATE, so that the change will be transferred to the PO in database.
    Also this BAPI can auto COMMIT
    Hope this helps

  • BAPI for Change Customer

    Hi Experts,
    We have a requirement to change the details of a customer. We are using BAPI, "BAPI_CUSTOMER_CHANGEFROMDATA". Change is happening when we try to change details like name, But when we try to change 'country' field, we are getting error saying  "Personal address diffrent from comapany address; change not allowed"..... Can anybody help me with this,,, or can somebody suggest any other BAPI for change customer....
    Thanks and regards,
    Mahendra R

    Hi Mahendra,
    CHek the link below[using BAPI_CUSTOMER_CHANGEFROMDATA1;

  • BAPI for change documents like FB09

    Hi
    I need to change the Assignment Number (ZUONR) Field for several document positions just like FB09 ,
    Does somebody knows a BAPI for change document positions (BSEG) ?
    Regards
    Frank

    Hi,
    Please see this link, It may help you.
    Add documents to materials via BAPI
    Regards,
    Shamma

Maybe you are looking for

  • OB52 Unable to see Open and Closing Posting Periods in V_T001B table

    HI Guru's, Iam trying to see open and closing periods in OB52 buts its not shwoing any entries.. if i check in table T001B showing all entries.. how to solve it anyone can help me... regards Janardhan

  • Unable to email files via LR 5.7 anymore

    I can not email my photos via LR anymore. Says unable to authenticate. I have validated my yahoo and gmail account but LR can not email.

  • SAP 8.81 client starting problem

    Dear All, When i start SAP B1 8.81 client with a particular company on the SAP B! 8.81 server. after giving the user name and password it automatically get closed. with the following error " you cannot open window[680] confirmation of recurring posti

  • How to download Flash?

    In order to download, install & activate Adobe Flash Player (to see Youtube) do you first have to have an Adobe account? I tried to download Flash without having an Adobe account & I just kept getting 'This page does not exist' at the end after click

  • Help with Servlet Addressing

    I'll never, ever, as long as I live ever figure out where to put JSP stuff in my directories. in my tomcat I have an examples directory with a helloworld servlet... C:\jakarta-tomcat-4.1.12\webapps\examples\WEB-INF\classes\HelloWorldExample.class tha