Bapi = bapi_po_change

Hello Experts,
I'm using the BAPI bapi_po_change in my program to update the field delivery complete indicator in tthe database.
i'm passing the po number in the bapi. i want that if the PO number i'm passing is being edited by any other transaction code than this should be processed by bapi.
and for that particular po no. i have to show the message as ERROR in the ALV display i'm showing as a output of my program.
please help as early as possible.
helpful responses would be highly rewarded.
thanks,
Krishan Kumar.

Hi Krishna kumar,
The errors will be stored in the return parameters RETURN for the each PO read from the internal table and the bapi is called.
If any error raises will be stored in RETURN parameter. U append this information along with the PO into another internal table. At last use normal ALV code to display the errors along with the PO number from the internal table in which u stored.
Thanks,
Surya.

Similar Messages

  • Closing Purchase order using BAPI : BAPI_PO_CHANGE

    Hi ABAPers,
    I have a requirement to develope a new report program which should accept a file which contains a list of PO and related Line Items to be closed. Basically the u201CDelivery completedu201D (EKPO-ELIKZ) check-box should be ticked and the PO should be saved.
    I know I have to use BAPI: BAPI_PO_CHANGE.
    But I am not aware how the parameters of this BAPI is populated.
    Please let me know how to populate the parameters of this BAPI in order to Close the list of POs from file.
    Input for this BAPI - I have only PO number, item number.
    Thanks,
    ~Sachin

    >
    Sachin Dandekar wrote:
    > Hi all,
    >
    > Now I am able to close the PO using BAPI BAPI_PO_CHANGE.
    >
    > Here I have one requirement to stop triggering messages while closing PO.
    > Please tell me how to stop triggering of output type if I close PO using this program.
    >
    > Thanks,
    > ~Sachin
    check parameter to BAPI
    NO_MESSAGING = 'X'

  • How to add New LineItems in PO using BAPI - BAPI_PO_CHANGE

    I have gone thru sdn but didnt get any clear solution......
    I am trying to add New Line Items in a PO using BAPI- BAPI_PO_CHANGE, but getting the following errors.....
    E BAPI             003      Instance 83000625 of object type PurchaseOrder could not be changed
    E MEPO           000      Purchase order still contains faulty items
    E SE                026      You cannot maintain service specs. due to incomplete transfer structure
    E ME                003      Plant cor not defined (please check your input)
    suggest any solutions
    here I am trying to add '00040' line item in the Existing PO & add a Service line in the added line item...
      itemx-po_item = '00040'.
      itemx-po_itemx = c_x.
      item-pckg_no = '0000000001'.
      append item. clear item.
      clear service[].
      service-pckg_no = '0000000001'.
      service-line_no = '0000000001'.
      service-subpckg_no = '0000000002'.
      service-from_line = '1' .
      append service. clear service.
      service-pckg_no = '0000000002'.
      service-line_no = '0000000001'.
      service-ext_line = '0000000040'.
      service-quantity = wa_datatab-col10 .
      service-short_text = wa_datatab-col9 .
      service-GR_PRICE = wa_datatab-col12 .
      service-USERF1_NUM  = wa_datatab-col13 .
      append service. clear service.
    then calling 'BAPI_PO_CHANGE' with item, account, condition, services data and its corresponding itemx,accountx,conditionx....
    Kindly send me if there is any code corrections....

    Hi Srikar,
            Check these threads on adding a line item using BAPI_PO_CHANGE
          [Re: FM BAPI_PO_CHANGE & new PO line items;
         [.BAPI_PO_CHANGE - ME 664;
    It may help you
    Regards,
    Pavan.

  • BAPI- BAPI_PO_CHANGE - Buffer table not up to date

    Dear All,
    I am facing problem when updating PO using BAPI FM  "BAPI_PO_CHANGE".
    Using excel file i am uploading data to system and updating fields. Here excel file have more than 100 records.
    problem is if two documents have same error message first one giving what is the errror message there, but second one it giving
    error message like "Buffer table is not upto date", this error message coming from BAPI and it displaying.
    I have need that what is the error message first document have that message have to display in output.
    means  error message  "Buffer table is not upto date" Instead it should display the first document message.
    But when i run differently it giving what is the error message is there that is displaying.
    if u run continually that it giving message "Buffer table is not upto date".
    please let me know ASAP.
    Regards,
    Srinivas.
    Edited by: Sreenivas B on Mar 25, 2010 2:20 PM

    Hi Moorthy
    Please check below components
    s/w Component       Release
         WP-PI                600_46C
         ST-PI                2005_1_46C
         ST-A/PI               01L_R3_46C
        SAP_NOTES       46C
        SAP_HR               46C
      SAP_BASIS          46C
      SAP_APPL               46C
      SAP_ABA               46C
      CIN               40A
    Best Reagrds,
    Srinivas

  • BAPI_PO_CHANGE, changing condition value in the purchase order

    Hi Friends,
    I have a requirement,
    a flat file is present in the application server that contains the information about PO,PO-ITEM,Condition type, movement type , condition value, plant, storage location .
    And i m calling the bapi "BAPI_PO_CHANGE" and passing the po number to it.
    the bapi returns the following tables, i_return, i_header,i_cond, i_item,i_itemx.
    But the purpose of calling the BAPI is, to check, if the condition value in the specified PO is '0', then it has to replace with the value of condition type present in the flat file.
    But when we check the tablei_return, its shows error type.
    And the PO is not updated with the new  condition value.
    Help me out in sorting this problem, by telling me
    what value is to be passed to the respective BAPI and what should i do to solve the issue?
    and after that i m using a BAPI " BAPI_GOODSMOVEMENT_CREATE".
    and it is for the purpose of creating the GR(Goods Receipt),
    when i go through the i_return table of the bapi, it si returning a message that "BAPI_201  Unable to create goods movement".
    Help me in proving the input to those bapi's and how can i get the expected output?
    And let me know, what the bapi's ,"BAPI_COMMIIT" and " BAPI_ROLLBACK" , will be doing?
    Edited by: kumar t on Aug 9, 2008 1:02 PM

    HI
    [Check the Link|http://abap.wikiprog.com/wiki/BAPI_PO_CHANGE]
    [Commit|http://abap.wikiprog.com/wiki/BAPI_TRANSACTION_COMMIT]
    [Roll Back|http://abap.wikiprog.com/wiki/BAPI_TRANSACTION_ROLLBACK]
    Regards
    Pavan

  • How to change the open quantity of PO / STO using  BAPI_PO_CHANGE

    Hi Friends,
    How can I change the open quantity in ME22 using the BAPI BAPI_PO_CHANGE...
    I am getting some errors..The values I am passing to the BAPI are:-
    *-- Purchase Order document
        lv_purchaseorder = tbl_join-ebeln.
    *-- Calculate Open quantity
        lv_quantity = ( tbl_join-menge - tbl_join-wemng ).
    *-- Fills Schedule quantity to be processed.
        tbl_poschedule-po_item      = tbl_join-ebelp.
        tbl_poschedule-sched_line   = tbl_join-etenr.
        tbl_poschedule-quantity     = lv_quantity.
        APPEND tbl_poschedule.
    *-- Marks the Schedule quantity to be processed.
        tbl_poschedulex-po_item     = tbl_join-ebelp.
        tbl_poschedulex-sched_line  = tbl_join-etenr.
        tbl_poschedulex-po_itemx    = c_true.
        tbl_poschedulex-sched_linex = c_true.
        tbl_poschedulex-quantity    = c_true.
        APPEND tbl_poschedulex.
    CALL FUNCTION 'BAPI_PO_CHANGE'
          EXPORTING
            PURCHASEORDER                = lv_purchaseorder
          POHEADER                     =
          POHEADERX                    =
          POADDRVENDOR                 =
            TESTRUN                      = 'X'
       IMPORTING
          EXPHEADER                    =
          EXPPOEXPIMPHEADER            =
         TABLES
           RETURN                       = tbl_return
           POSCHEDULE                   = tbl_poschedule
           POSCHEDULEX                  = tbl_poschedulex.
    Is there any other required fields needs to be passed to change the open quantity..
    I am checking in ME22...
    The scheduled quantity is 20.
    Delivered quantity is 15.
    Open quantity is 5   and ( this field is in non-editable display )
    Delivery date  is 10.10.2002  ( which is in past )
    Now using this BAPI ..I want to post the remaining open quantity which is " 5 "
    How can i do this ?? Please help.

    Hi Hari
    Please check after making the following changes:
    *-- Marks the Schedule quantity to be processed.
    tbl_poschedulex-po_item = tbl_join-ebelp.
    tbl_poschedulex-sched_line = tbl_join-etenr.
    <b>tbl_poschedulex-po_itemx = 'U'. "c_true.
    *tbl_poschedulex-sched_linex = c_true.</b>
    tbl_poschedulex-quantity = c_true.
    APPEND tbl_poschedulex.
    If still you do not get the desired function working add the below code:
    tbl_poitem-po_item = tbl_join-ebelp.
    tbl_poitem-quantity = lv_quantity.
    append tbl_poitem.
    tbl_poitemx-po_item = tbl_join-ebelp.
    tbl_poitemx-po_itemx = 'U'.
    tbl_poitemx-quantity = c_true.
    append tbl_poitemx.
    Hope this helps.
    Kind Regards
    Eswar

  • Deletion of schedule line in PO using BAPI_PO_CHANGE

    Hi ,
    Can anyone give me the code to delete a schedule line in a po using the bapi bapi_po_change.
    Useful answers will be rewarded.
    Regards,
    Sowmya.

    Hi,
    Refer below code
    *&      Form  sub_populate_data
          text
    FORM sub_populate_data .
    *--Local Variables
      DATA : l_ipdate      TYPE rc65a-datefrom,
             l_fdate       TYPE sy-datum.
      IF NOT it_succ_file[] IS INITIAL.
        LOOP AT it_succ_file INTO st_succ_file.
          st_ipfile = st_succ_file.
    *--Sales Document
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
            EXPORTING
              input  = st_ipfile-vbeln
            IMPORTING
              output = st_salesdoc.
          st_ord_headx-updateflag = c_u.
    *--Sales Document Item
          st_schedule_line-itm_number = st_ipfile-posnr.
          st_schedule_linex-itm_number = st_ipfile-posnr.
          st_schedule_linex-updateflag = c_i.
    *--Schedule line date
          l_ipdate = st_ipfile-edatu.
    *--Call function module to convert the date format into current user format
          CALL FUNCTION 'CY_CONVERT_DATE'
            EXPORTING
              date_string_imp = l_ipdate
            IMPORTING
              date_exp        = l_fdate.
          st_schedule_line-dlv_date = l_fdate.
          st_schedule_linex-dlv_date = c_chk.
          st_schedule_line-req_date = l_fdate.
          st_schedule_linex-req_date = c_chk.
    *--Order quantity in sales units
          st_schedule_line-req_qty = st_ipfile-wmeng.
          st_schedule_linex-req_qty = c_chk.
          APPEND st_schedule_line TO it_schedule_line.
          APPEND st_schedule_linex TO it_schedule_linex.
    *--Clear
          CLEAR : st_schedule_line,
                  st_schedule_linex.
          AT END OF posnr.
    *--Perform to delete the existing schedule line
            PERFORM sub_delete_schedule_line.
          ENDAT.
          AT END OF vbeln.
    *--Clear
            CLEAR : st_erfile.
            READ TABLE it_erfile INTO st_erfile WITH KEY vbeln = st_ipfile-vbeln
                                                         posnr = st_ipfile-posnr
                                                         BINARY SEARCH.
            IF sy-subrc EQ 0.
              g_error_records = g_error_records + 1.
              g_total_records = g_total_records + 1.
            ELSE.
    *--Call the bapi to update sales order schedule line
              PERFORM sub_call_bapi.
            ENDIF.
          ENDAT.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " sub_populate_data
    *&      Form  sub_call_bapi
          text
    FORM sub_call_bapi.
      g_total_records = g_total_records + 1.
    *--Call BAPI to update sales order schedule line for simulation mode
      CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          salesdocument    = st_salesdoc
          order_header_inx = st_ord_headx
          simulation       = c_chk
        TABLES
          return           = it_return
          schedule_lines   = it_schedule_line
          schedule_linesx  = it_schedule_linex.
      IF NOT it_return[] IS INITIAL.
        READ TABLE it_return INTO st_return WITH KEY type = c_e.
        IF sy-subrc EQ 0.
          g_error_records = g_error_records + 1.
        ELSE.
          REFRESH : it_return.
    *--Call BAPI to update sales order schedule line
          CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
            EXPORTING
              salesdocument    = st_salesdoc
              order_header_inx = st_ord_headx
            TABLES
              return           = it_return
              schedule_lines   = it_schedule_line
              schedule_linesx  = it_schedule_linex.
        ENDIF.
        LOOP AT it_return INTO st_return
                          WHERE type EQ c_e.
          st_erfile = st_ipfile.
          st_erfile-message = st_return-message.
          APPEND st_erfile TO it_erfile.
          APPEND st_erfile TO it_file.
          CLEAR : st_return.
        ENDLOOP.
      ENDIF.
      IF it_file[] IS INITIAL.
    *--Call BAPI transaction commit to change the schedule line
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = c_chk.
      ELSE.
        ROLLBACK WORK.
    *--Call BAPI transaction rollback to rollback the schedule line
        CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      ENDIF.
    *--Clear
      CLEAR : st_salesdoc,
              st_ord_headx.
    *--Refresh
      REFRESH : it_return,
                it_schedule_line,
                it_schedule_linex.
    ENDFORM.                    " sub_call_bapi
    Regards,
    Prashant

  • BAPI FOR Deleting a Schedule Line Item from EKES and EKET tables

    Dear All,
    I would like to for deleting one of the line item from EKES (Po Confirmation ) and the respective line item from the EKET(PO Schedule Line Item Table).
    Assume that am allowing the user to select the lineitem from zprogram screen and collecting the PO and Its LIne Item details in an internal table.
    Can i Use
    <b>BAPI_PO_Change</b> , if so , can anybody tell me the steps to follow to use this bapi for deleting the PO lineItems, since i m going to try BAPI for First time.
    pls help me out
    Message was edited by: Raja K.P

    Hi raja ,
    loop at iekko1.
        w_index = sy-tabix.
        item-po_item   = itemx-po_item   = iekko1-ebelp.
        item-quantity  = iekko1-mng01.
        itemx-quantity = iekko1-mng01.
        if iekko1-wamng = iekko1-wemng.
        itemx-no_more_gr = item-no_more_gr = 'X'.
        else.
        itemx-no_more_gr = item-no_more_gr = ''.
        endif.
        append item.
        append itemx.
          clear return[].
          call function 'BAPI_PO_CHANGE'
               exporting
                    purchaseorder = iekko1-ebeln
               tables
                    return        = return
                    poitem        = item
                    poitemx       = itemx.
          if return[] is initial.
          commit work and wait.
          call function 'DEQUEUE_ALL'.
    search for deletion fields which u have to mark 'X'.
    before calling  this BAPi u have to lock the PO by using ENQUEUE.
    <b>
    FU BAPI_PO_CHANGE
    Text
    Change purchase order
    Functionality
    Function module BAPI_PO_CHANGE enables you to change purchase orders. The Change method uses the technology behind the online transaction ME22N.
    Alternatively, the IDoc type PORDCH1 is available. The data from this IDoc populates the interface parameters of the function module BAPI_PO_CHANGE.
    Functionality in Detail
    Authorization
    When you create (activity 02) an Enjoy purchase order, the following authorization objects are checked:
    M_BEST_BSA (document type in PO)
    M_BEST_EKG (purchasing group in PO)
    M_BEST_EKO (purchasing organization in PO)
    M_BEST_WRK (plant in PO)
    Controlling adoption of field values via X bar
    For most tables, you can use your own parameters in the associated X bar (e.g. PoItemX) to determine whether fields are to be set initial, values inserted via the interface, or default values adopted from Customizing or master records, etc. (for example, it is not mandatory to adopt the material group from an underlying requisition - you can change it with the BAPI).
    Transfer
    Purchase order number
    The PurchaseOrder field uniquely identifies a purchase order. This field must be populated in order to carry out the Change method.
    Header data
    The header data of the Enjoy purchase order is transferred in table PoHeader.
    Item data
    The item data of the Enjoy purchase order is stored in the tables PoItem (general item data). Changes regarding quantity and delivery date are to be made in the table PoSchedule.
    Use the table PoAccount to change the account assignment information.
    Services and limits
    Changes to existing items cannot be carried out with the Change method. It is only possible to create new items.
    Conditions
    Conditions are transferred in the table PoCond; header conditions in the table PoCondHeader. A new price determination process can be initiated via the parameter CALCTYPE in the table PoItem.
    Vendor and delivery address
    The vendor address in the table PoAddrVendor and the delivery address in the table PoAddrDelivery can only be replaced by another address number that already exists in the system (table ADRC). Changes to address details can only be made using the method BAPI_ADDRESSORG_CHANGE.
    Partner roles
    You can change all partners except the partner role "vendor" via the table PoPartner.
    Export/import data
    Export/import data can be specified per item in the table PoExpImpItem. Foreign trade data can only be transferred as default data for new items. Changes to the export/import data of existing items are not possible.
    Texts
    Header and item texts can be transferred in the tables PoTextHeader and PoTextItem. Texts for services are imported in the table PoServicesText. Texts can only be replaced completely.
    Version Management
    You can make use of the Version Management facility via the table AllVersions.
    Return
    If the PO was changed successfully, the header and item tables are populated with the information from the PO.
    Return messages
    Messages are returned in the parameter Return. This also contains information as to whether interface data has been wrongly or probably wrongly (heuristical interface check) populated. If a PO has been successfully created, the PO number is also placed in the return table with the appropriate message.
    Restrictions
    With this function module, it is not possible to:
    Create subcontracting components (you can only use existing ones)
    Create configurations (you can only use existing ones)
    Change message records (table NAST) and additional message data (this data can only be determined via the message determination facility (Customizing))
    Attach documents to the purchase order
    Change foreign trade data
    Change service data
    Change or reexplode BOMs
    A firewall prevents the manipulation of data that is not changeable in Purchasing according to the business logic of the purchase order (e.g. PO number, vendor, etc.).
    PO items with an invoicing plan cannot be created or changed using the BAPIs
    In this connection, please refer to current information in Note 197958.
    To change addresses with numbers from Business Address Services (cantral address management), please use the function module BAPI_ADDRESSORG_CHANGE.
    To change variant configurations, please use the function module BAPI_UI_CHANGE. More information is available in the BAPI Explorer under the Logistics General node.
    In the case of changes that are to be made via the BAPI_PO_CHANGE, a firewall first checks whether the relevant fields are changeable. This approach follows that of the online transaction. Here it is not possible to change the vendor or the document type, for example.
    Example
    Example of changes made to a purchase order with:
    1. Change in header data
    2. Change in item
    3. Change in delivery schedule
    4. Change in account assignment
    5. Change in conditions
    6. Change in partners
    Parameter: PURCHASEORDER 4500049596
    Parameter: POHEADER
    PMNTTRMS = 0002
    PUR_GROUP = 002
    Parameter: POHEADERX
    PMNTTRMS = X
    PUR_GROUP = X
    Parameter: POITEM
    PO_ITEM = 00001
    CONF_CTRL = 0001
    Parameter: POITEMX
    PO_ITEM = 00001
    PO_ITEMX = X
    CONF_CTRL =  X
    Parameter: POSCHEDULE
    PO_ITEM = 00001
    SCHED_LINE = 0001
    QUANTITY = 10.000
    PO_ITEM = 00001
    SCHED_LINE = 0003
    DELETE_IND =  X
    Parameter: POSCHEDULEX
    PO_ITEM =  00001
    SCHED_LINE =  0001
    PO_ITEMX =  X
    SCHED_LINEX =  X
    QUANTITY =  X
    PO_ITEM =  00001
    SCHED_LINE =  0003
    PO_ITEMX =  X
    SCHED_LINEX =  X
    DELETE_IND = X
    Parameter: POACCOUNT
    PO_ITEM = 00001
    SERIAL_NO = 01
    GL_ACCOUNT = 0000400020
    Parameter: POACCOUNTX
    PO_ITEM = 00001
    SERIAL_NO = 01
    PO_ITEMX = X
    SERIAL_NOX = X
    GL_ACCOUNT = X
    Parameter: POCOND
    ITM_NUMBER = 000001
    COND_TYPE = RA02
    COND_VALUE = 2.110000000
    CURRENCY = %
    CHANGE_ID = U
    Parameter: POCONDX
    ITM_NUMBER = 000001
    COND_ST_NO = 001
    ITM_NUMBERX = X
    COND_ST_NOX = X
    COND_TYPE = X
    COND_VALUE = X
    CURRENCY = X
    CHANGE_ID = X
    Parameter: POPARTNER
    PARTNERDESC =  GS
    LANGU =  EN
    BUSPARTNO = 0000001000
    Help in the Case of Problems
    1. Note 197958 lists answers to frequently asked questions (FAQs). (Note 499626 contains answers to FAQs relating to External Services Management.)
    2. If you have detected an error in the function of a BAPI, kindly create a reproducible example in the test data directory in the Function Builder (transaction code SE37). Note 375886 tells you how to do this.
    3. If the problem persists, please create a Customer Problem Message for the componente MM-PUR-PO-BAPI, and document the reproducible example where necessary.
    Customer Enhancements
    The following user exits (function modules) are available for the BAPI BAPI_PO_CREATE1:
    EXIT_SAPL2012_001 (at start of BAPI)
    EXIT_SAPL2012_003 (at end of BAPI)
    The following user exits (function modules) are available for the BAPI BAPI BAPI_PO_CHANGE:
    EXIT_SAPL2012_002 (at start of BAPI)
    EXIT_SAPL2012_004 (at end of BAPI)
    These exits belong to the enhancement SAPL2012 (see also transaction codes SMOD and CMOD).
    There is also the option of populating customer-specific fields for header, item, or account assignment data via the parameter EXTENSIONIN.
    Further Information
    1. Note 197958 contains up-to-date information on the purchase order BAPIs.
    2. If you test the BAPIs BAPI_PO_CREATE1 or BAPI_PO_CHANGE in the Function Builder (transaction code SE37), no database updates will be carried out. If you need this function, please take a look at Note 420646.
    3. The BAPI BAPI_PO_GETDETAIL serves to read the details of a purchase order. The BAPI cannot read all details (e.g. conditions). However, you can use the BAPI BAPI_PO_CHANGE for this purpose if only the document number is populated and the initiator has change authorizations for purchase orders.
    4. Frequently used BAPIs for purchase orders are BAPI_PO_CREATE, BAPI_PO_CREATE1, BAPI_PO_CHANGE, BAPI_PO_GETDETAIL, BAPI_PO_GETITEMS, BAPI_PO_GETITEMSREL, and BAPI_PO_GETRELINFO.
    5. For more information on purchase orders, refer to the SAP library (under MM Purchasing -> Purchase Orders) or the Help for the Enjoy Purchase Order, or choose the path Tools -> ABAP Workbench -> Overview -> BAPI Explorer from the SAP menu.
    Parameters
    PURCHASEORDER
    POHEADER
    POHEADERX
    POADDRVENDOR
    TESTRUN
    MEMORY_UNCOMPLETE
    MEMORY_COMPLETE
    POEXPIMPHEADER
    POEXPIMPHEADERX
    VERSIONS
    NO_MESSAGING
    NO_MESSAGE_REQ
    NO_AUTHORITY
    NO_PRICE_FROM_PO
    EXPHEADER
    EXPPOEXPIMPHEADER
    RETURN
    POITEM
    POITEMX
    POADDRDELIVERY
    POSCHEDULE
    POSCHEDULEX
    POACCOUNT
    POACCOUNTPROFITSEGMENT
    POACCOUNTX
    POCONDHEADER
    POCONDHEADERX
    POCOND
    POCONDX
    POLIMITS
    POCONTRACTLIMITS
    POSERVICES
    POSRVACCESSVALUES
    POSERVICESTEXT
    EXTENSIONIN
    EXTENSIONOUT
    POEXPIMPITEM
    POEXPIMPITEMX
    POTEXTHEADER
    POTEXTITEM
    ALLVERSIONS
    POPARTNER
    Exceptions
    Function Group
    2012
    </b>
    regards
    prabhu
    Message was edited by: Prabhu Peram

  • BAPI_PO_CHANGE for account assignment tab

    Hi sdn,
    I am trying to chnage the Account Assgnment tab details with the BAPI BAPI_PO_CHANGE and getting below error message.
    E     MEPO     000     Purchase order still contains faulty items
    I     06     684     Releases already effected are liable to be reset
    E     06     436     In case of account assignment, please enter acc. assignment data for item
    I am trying to the chnage the line item details for Acount assignment type - Cost center. Item catagory - Limit.
    Th evalue i am changing - Gl account and Cost center.
    Below is the sample code.
    APPEND wa_poitem TO it_poitem.
          wa_poitemx-po_item = wa_poitem-po_item.
          wa_poitemx-po_itemx = c_x.
          APPEND wa_poitemx TO it_poitemx.
            wa_poaccount-costcenter        = wa_po_tmp_c-kostl.
            wa_poaccountx-costcenter       = c_x.
            wa_poaccount-gl_account    = wa_po_tmp_c-sakto.
            wa_poaccountx-gl_account     = c_x.
            wa_poaccount-gr_rcpt       = wa_po_tmp_c-wempf.
            wa_poaccountx-gr_rcpt     = c_x.
          wa_poaccountx-po_item      = wa_po_tmp_c-ebelp.
          wa_poaccountx-serial_no    = wa_poaccount-serial_no.
          wa_poaccountx-po_itemx     = c_x.
          wa_poaccountx-serial_nox   = c_x.
          APPEND wa_poaccount TO it_poaccount.
          APPEND wa_poaccountx TO it_poaccountx.
    CALL FUNCTION 'BAPI_PO_CHANGE'
        EXPORTING
          purchaseorder  = wa_po_c-ebeln
          testrun        = v_testrun
          no_messaging   = c_x
          no_message_req = c_x
        IMPORTING
          expheader      = wa_expheader
        TABLES
          return         = it_return
          poitem         = it_poitem
          poitemx        = it_poitemx
          poaccount      = it_poaccount
          poaccountx     = it_poaccountx

    Hi I had fixed this problem by creating Enhancement point in the Method .
    IF_PURCHASE_ORDER_MM~SET_DATA
    at the end of the method.
    if sy-tcode = 'ZPO_ACCT_CHANGE'.
    free my_recheck_queue[].
    refresh my_recheck_queue[].
    endif.
    Edited by: Naresh Nelapatla on May 13, 2011 5:17 PM

  • Delivery cost not created during GRN of PO using BAPI

    I have a customized program which use BAPI - BAPI_PO_CREATE1 to create PO, PO was created successully.
    then program will use BAPI - BAPI_PO_CHANGE to update condition pricing, which is also executed succesfully. all condition pricing (KONV) updated correctly.
    Lastly, the program will use BAPI - BAPI_GOODSMVT_CREATE to create GRN and update delivery cost. However in my case, the delivery cost is not update, EKBZ table record is not created, as well as GRN item line table MSEG table is not updated with delivery cost.
    Anyone face this type of problem before?What is the possible causes?
    Any help and suggestion is greatly appreciated.

    Lai,
    you should try asking this on ABAP forum thread. You will get a response. May be there is another BAPI u should use or may be you the usage of BAPI is incomplete. Pl confirm with ABAP forum.
    Rgds

  • Urgent help in BAPI

    Hello All,
    My requirement - A new field ZLGCYPO - CHAR(10) is added to existing EKKO structure. Now I want to update the field for a given PO using BAPI. Can anyone pls help me in solving this?

    Hi,
      use the BAPI BAPI_PO_CHANGE to update the custom field.
      Extend the structure BAPI_TE_MEPOHEADER with the custom field..
      Use EXTENSIONIN structure to populate the custom field.
    Thanks,
    Naren

  • Changing a Purchase Order with "BAPI_PO_CHANGE"

    Hi Experts,
    I am trying to change the Confirmation data for an existing PO using the BAPI "BAPI_PO_CHANGE".
    I am filling the PO Number in the "PURCHASEORDER" Import parameter.
    I am also filling the "CONF_TYPE", "DELIV_DATE" and "QUANTITY" fields in the "POCONFIRMATION" Table parameter which is specifically the data i need to add to the existing PO under the "Confirmations" tab of the PO.
    I am getting all the input data for the BAPI from a file on the presentation server. The file has details of Material Number, Purchase Order Number, Ship to Address, Delivery Date and Quantity.
    But i am not able to change any data in the Purchase Order when i test the BAPI. I am getting the following messages in the "RETURN" Tables parameter:
    T ID                   NUM MESSAGE
    W ME                   667 Max. line number reached (Please always first enter line number manually)
    E BAPI                 003 Instance 45317399 of object type PurchaseOrder could not be changed
    W ME                   178 Batch SURE not maintained for material 10013537 (please check your input)
    E 06                   218 Net price must be greater than 0
    I am not sure if i am missing to fill any parameter here.
    Kindly help me in resolving this issue.
    Thanks in advance.
    Regards,
    Keerthi

    Hello to all,
    that is just for documentation. SAP answerd the problem in OSS-304243 but this message is not accessable if you don't have powerful OSS-Users.
    This SAP-note might be interesting: 197958
    OSS-Message 652796 8.8.2011
    BAPI_PO_CHANGE
    We can not process confirmations by using the parameter poconfirmation.
    The Baps reports always S 06 022 - no data changed.
    In the SDN there are some hints telling that the BAPI_PO_CHANGE does notsupport processing of confirmations. More detailled infos should be in
    the OSS-Message 0000304243 but this message is not accessable for us.
    Can you confirm that the BAPI_PO_CHANGE does not support adding
    confirmations? We debugged the BAPI and there is no code for updating
    confirmations found.
    Best regards
    Bernhard Lascy
    09.08.2011 - 10:43:07 CET - Antwort von SAP
    Dear Bernhard,
    I regret to inform you that the functionality you request is not
    implemented in the R/3 standard system.
    Unfortunately it is not possible to change/load confirmations with the
    function module BAPI_PO_CREATE/BAPI_PO_CHANGE. Table POCONFIRMATION in
    BAPI interface is relevant for Display/List Vendor Confirmation in BAPI,not for update/insert Vendor confirmation in PO.
    Furthermore, we recommends that you use Idocs for automatically
    entering confirmations. The Message type to use is ORDRSP.
    You may read more about this topic in the online documentation.
    Please see also following attached note for your reference.
    456127 FAQ: Electronic Data Interchange (EDI) in purchasing
    Best regards,
    Pavel Olysar
    Support Consultant
    Global Support - Logistics

  • BAPI to add Purchase Order Confirmation?

    Hi,
    I have to add PO Confirmations and I found the BAPI 'BAPI_PO_CHANGE' that have an "tables" parameter for my requeriment. But I created a test program and I checked that it doesn't work for that purpouse (and I'm not the 1st one who find that problem: [Re: BAPI_PO_CHANGE is not updating Confirmation Category and Date cate Category; ). I checked the code and the BAPI really don't do anything with POCONFIRMATION data except read it....
    Have you an alternative for this??

    Hello to all,
    that is just for documentation. SAP answerd the problem in OSS-304243 but this message is not accessable if you don't have powerful OSS-Users.
    This SAP-note might be interesting: 197958
    OSS-Message 652796 8.8.2011
    BAPI_PO_CHANGE
    We can not process confirmations by using the parameter poconfirmation.
    The Baps reports always S 06 022 - no data changed.
    In the SDN there are some hints telling that the BAPI_PO_CHANGE does notsupport processing of confirmations. More detailled infos should be in
    the OSS-Message 0000304243 but this message is not accessable for us.
    Can you confirm that the BAPI_PO_CHANGE does not support adding
    confirmations? We debugged the BAPI and there is no code for updating
    confirmations found.
    Best regards
    Bernhard Lascy
    09.08.2011 - 10:43:07 CET - Antwort von SAP
    Dear Bernhard,
    I regret to inform you that the functionality you request is not
    implemented in the R/3 standard system.
    Unfortunately it is not possible to change/load confirmations with the
    function module BAPI_PO_CREATE/BAPI_PO_CHANGE. Table POCONFIRMATION in
    BAPI interface is relevant for Display/List Vendor Confirmation in BAPI,not for update/insert Vendor confirmation in PO.
    Furthermore, we recommends that you use Idocs for automatically
    entering confirmations. The Message type to use is ORDRSP.
    You may read more about this topic in the online documentation.
    Please see also following attached note for your reference.
    456127 FAQ: Electronic Data Interchange (EDI) in purchasing
    Best regards,
    Pavel Olysar
    Support Consultant
    Global Support - Logistics

  • Updating T'code ME23N using BAPI's

    Dear All,
    I am updating T'code ME23N using BAPI  " BAPI_PO_CHANGE". First i m tried in SE37 there its not updating it giving error like " PO could not be changed using the Enjoy-BAPI"  for this  i m trying in 4.6c.
    Here i have to update only two check boxes those are NO_MORE_GR(ELIKZ) and FINAL_INV(EREKZ).
    Please tell me any one there are  any other BAPI's are  avialable or how to slove this porblem.
    Best Regards,
    Srinivas.

    Hello
    I just have run this code in 4.6C. It working fine.
    DATA: xreturn  like BAPIRET2      occurs 0 with header line,
          xpoitem  like BAPIMEPOITEM  occurs 0 with header line,
          xpoitemx like BAPIMEPOITEMX occurs 0 with header line.
    xpoitem-po_item = p_ebelp.  " set position here
    xpoitem-no_more_gr = 'X'.
    xpoitem-final_inv = 'X'.
    append xpoitem.
    xpoitemx-po_item = p_ebelp. " set position here
    xpoitemx-no_more_gr = 'X'.
    xpoitemx-final_inv = 'X'.
    append xpoitemx.
    CALL FUNCTION 'BAPI_PO_CHANGE'
         EXPORTING
                  purchaseorder    = p_ebeln "set ebeln here
         TABLES
                  return           = xreturn
                  poitem           = xpoitem
                  poitemx          = xpoitemx.
    if sy-subrc = 0.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
           EXPORTING WAIT = 'X'.
    endif.

  • BAPI or FM to change the PO release group

    Hi,
    I would like to change the PO release group (EKKO-FRGGR).
    I could not find the way to change this field through BAPI BAPI_PO_CHANGE.
    Please suggest me any BAPI or FM!
    Thanks,
    Khanh

    Hi,
    It seems ME_REL_STRATEGIE_EKKO is used for creating a new PO.
    I want to change the PO release group for a specific PO only.
    And the BAPI BAPI_PO_RELEASE seems to change the Release Code, not Release Group!!!
    Please advice!
    Thanks,
    Khanh
    Edited by: Khanh Nguyen on Sep 23, 2010 2:37 PM

Maybe you are looking for

  • External hard drive connected to mac Mini is having problems and won't repair

    Hi, Thanks in advance for any support. My Mac mini (OS 10.7.5) isn't reading the external drive correctly and sometimes doesn't find it at all. When it does find the drive, some folders which I know to be large show up as empty (not always the same f

  • Error on opening interactive forms.

    Hi, I am working on interactive forms and was designing a form but suddenly my form is not responding now: As I use the "Edit" option my form designer opens a pop up like: Microsoft Visual C++ Runtime Library Runtime Error! Program: c\PROGRA1\adobe\D

  • Baisc Aqualogic Interaction SSO mechanism

    I have a basic question on how the aqualogic interaction SSO works. I see an Authentication SOurce SSO, but i dont understand which repository it connects to. How it generates the Login Token. Can i use the features of authentication service outside

  • Issue with event struct reading controls

    Hello all. I'm having issue reading my control clusters after triggering an event. Here is what I was trying to do: 1) I have a control with several booleans 2) A mouse up on the cluster triggers an event. 3) Although it's not pictured, I was using t

  • Apple activation servers??

    I just got an iPhone 4 today, super anxious to get it going. I turned on my iPhone and went through everything to the activation and I get the message "Couldnt activate iPhone". I called Apple and Verizon and they said that the servers are being SLAM