Regarding BAPI_PO_CHANGE

Hi,
I am using BAPI_PO_CHANGE to update a PO. I need to update the PO line item condition Amount, and currency to a new value currency. I am not able to update Amount field and currency in the po conditions. I am able to chnage using ME22N. I need to uodate the same using BAPI. How can I update that, which tables and fields I need to pass for this.
Thanks
Kishore

Hi,
You need to pass the conditions data to the following tables parameter:
POCOND
POCONDX
See the function module documentation for further help.
Br,
Advait

Similar Messages

  • PR Line Item Number should be Same for PO Line Item Numebr

    Hi Gurus,
    I have a rare Requiremenet. I will convert Only one PR to PO(So It is one to one) PR Item Number should Be Equal to PO Item Number.. can anybody suggest me is there any way to achive this.
    Explanation:
    Actually we will create third party Sale order and with A BAPI we  create PO in background.
    I will change Sales Order qty(Decrease directly or increse with schedule lines) so new PR items will be generated or Existing may be deleted. now i want my PR Item number should be equal to PO Item Number.
    In BAPI we have a provision to provide PR number still system is taking in sequential intervel of 10,20,30....
    How to overide this...
    EX:
                     PR               PO
    ItemNO      10              10
    ItemNO      30              30
    Thanks
    Pradeep

    Hi Monika,
    Thanks a lot my issue got resolved. annd i have another question regarding BAPI_PO_Change.
    Actually i am passing Price from PR to PO and i am making no_price_from_po while chenging PO and i am passing PRICE from SO to PO. Below scenario will explain My requirement.
    In third party we are creating Automatic PO from SO. we have developed one ZTrasaction for SO Approval in two stages, in second level Approval we are converting PR to PO.
    while creating we are able to pass Price value from SO to PO From Condition in the Pricing procedure.
    while changing we have 3 scenarios
    1.Changing Existing PR Item quantity
    2. Adding one more schedule line to the Existing SO so it will create one more PR Item
    3. we are adding one more Line Item in the SO in this case also one more PR Item will be generated
    we are able to convert each PR Item will be one PO line Item 
    But while changing we will have PO still we don't want to copy the Price from Previous Document.
    we have activated no_price_from_PO in the BAPI but still system is taking from previous Document.
    Pl suggest me if there anyway to over come this issue...
    Thanks
    -Pradeep

  • 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

  • BAPI_PO_CHANGE not updating internal order no. in account assignment

    Hi,
    I am using 'BAPI_PO_CHANGE' to update the internal order no.
    I am first fetching the existing account assignment line items using 'BAPI_PO_GETDETAIL1' and then modifying the internal order no. as below.
            lt_poaccount-orderid = '310021000000'.
            MODIFY lt_poaccount INDEX lv_poacc_tabix TRANSPORTING orderid.
            lt_poaccountx-po_item = gt_po-ebelp.
            lt_poaccountx-orderid = 'X'.
            APPEND lt_poaccountx.
    but while calling the BAPI, the original values are returned and the message is 'No Data Changed'.
        CALL FUNCTION 'BAPI_PO_CHANGE'
          EXPORTING
            purchaseorder = gt_distinct_po-ebeln
          TABLES
            return        = lt_return
            poaccount     = lt_poaccount
            poaccountx    = lt_poaccountx.
    (The internal order no. is different than the original)
    Can somebody please assist me on this?
    Thanks in advance.

    Hi Kumar,
    I recommend you to try changing the internal order manually through transaction ME22N and see if that is possible in your system first.
    After that if that isn't possible you should contact your MM Expert for advise.
    Regards,
    Gilberto Li

  • 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_PO_CHANGE - error while locking PO iems

    All,
    We're getting error when trying to lock PO items using BAPI_PO_CHANGE.
    The PO item has a closed order as the account assignment in the PO. We do not get the error if the order is open.
    Has anybody encountered this problem before? Is there any way to suppress this and allow locking of the item? Any inputs will be highly appreciated.
    Regards
    Deepthi.

    More info on this,
    I get the error -
    'Material purchase order' not allowed - Order XXXXXX
    When we try to lock the same PO item using ME22N it is successful.
    Is there any relevant OSS note for this?

  • BAPI_PO_CHANGE Add Services

    Hi all,
    I need to update a PURCHASE ORDER with new services but im getting the error msg "Enter Quantity in service line" but my service line is a information line what could be the problem (poservices-inform = 'X'. poservices-serv_type = 'HZ' ).
    Im unable also to insert text information with POSERVICESTEXT.
    What could be missing?
    Test sequence
    Se37
    BAPI_PO_CHANGE
    BAPI_TRANSACTION_COMMIT
    TEST 1 (unable to insert POSERVICESTEXT information in PO, but the NZ lines are insert )
    Return
    T ID NUM MESSAGE
    S 06 023 Standard PO 4500000284 changed
    W ME 887 Error transferring ExtensionIn data for enhancement CI_EKKODB
    I ME 664 Change Order Unit could not be effected
    Parâmetros: PURCHASEORDER = 4500000284
    Parâmetros: VERSIONS
    POST_DATE = 00000000
    Parâmetros: POITEM
    PO_ITEM = 00010
    SHORT_TEXT = CHANGE
    MATERIAL = 000000000040000008
    QUANTITY = 1.000
    PO_UNIT = LE
    PCKG_NO = 0000000001
    Parâmetros: POITEMX
    PO_ITEM = 00010
    PO_ITEMX = X
    SHORT_TEXT = X
    MATERIAL = X
    QUANTITY = X
    PO_UNIT = X
    PCKG_NO = X
    Parâmetros: POSCHEDULE
    PO_ITEM = 00010
    SCHED_LINE = 0001
    QUANTITY = 1.000
    Parâmetros: POSCHEDULEX
    PO_ITEM = 00010
    SCHED_LINE = 0001
    PO_ITEMX = X
    SCHED_LINEX = X
    QUANTITY = X
    Parâmetros: POSERVICES
    PCKG_NO = 0000000001
    LINE_NO = 0000000001
    OUTL_LEVEL = 0
    OUTL_IND = X
    SUBPCKG_NO = 0000000002
    FROM_LINE = 1
    PCKG_NO = 0000000002
    LINE_NO = 0000000002
    EXT_LINE = 0000000010
    OUTL_LEVEL = 0
    SERV_TYPE = NZ
    QUANTITY = 5.000
    BASE_UOM = UN
    PRICE_UNIT = 1
    GR_PRICE = 10.0000
    SHORT_TEXT = SHORT 1
    USERF1_TXT = LINHA NORMAL
    PCKG_NO = 0000000002
    LINE_NO = 0000000003
    EXT_LINE = 0000000020
    OUTL_LEVEL = 0
    SERV_TYPE = NZ
    QUANTITY = 5.000
    BASE_UOM = UN
    PRICE_UNIT = 1
    GR_PRICE = 10.0000
    SHORT_TEXT = SHORT 2
    USERF1_TXT = LINHA NORMAL
    PCKG_NO = 0000000002
    LINE_NO = 0000000004
    EXT_LINE = 0000000030
    OUTL_LEVEL = 0
    SERV_TYPE = NZ
    QUANTITY = 5.000
    BASE_UOM = UN
    PRICE_UNIT = 1
    GR_PRICE = 10.0000
    SHORT_TEXT = SHORT 3
    USERF1_TXT = LINHA NORMAL
    Parâmetros: POSERVICESTEXT
    PCKG_NO = 0000000002
    LINE_NO = 0000000004
    TEXT_ID = LLTX
    FORMAT_COL = *
    TEXT_LINE = LONGO
    PCKG_NO = 0000000002
    LINE_NO = 0000000004
    TEXT_ID = LTXT
    FORMAT_COL = *
    TEXT_LINE = SUCINTO
    Second test
    Return
    T ID                   NUM MESSAGE
    E SE                   319 Please enter a quantity
    W ME                   887 Error transferring ExtensionIn data for enhancement CI_EKKODB
    E BAPI                 003 Instance 4500000284 of object type PurchaseOrder could not be changed
    Parameters:    PURCHASEORDER        = 4500000284                                                                               
    Parameters:    VERSIONS                       
    POST_DATE                      = 00000000
                                                                                    Parameters:    POITEM                         
    PO_ITEM                        = 00010
    SHORT_TEXT                     = CHANGE                                 
    MATERIAL                       = 000000000040000008
    QUANTITY                       = 1.000 
    PCKG_NO                        = 0000000001
                                                                                    Parameters:    POITEMX                        
    PO_ITEM                        = 00010
    PO_ITEMX                       = X
    SHORT_TEXT                     = X
    MATERIAL                       = X
    QUANTITY                       = X
    PCKG_NO                        = X
                                                                                    Parameters:    POSCHEDULE                     
    PO_ITEM                        = 00010
    SCHED_LINE                     = 0001
    QUANTITY                       = 1.000                                                                               
    Parameters:    POSCHEDULEX                    
    PO_ITEM                        = 00010
    SCHED_LINE                     = 0001
    PO_ITEMX                       = X
    SCHED_LINEX                    = X
    QUANTITY                       = X
                                                                                    Parameters:    POSERVICES                     
    PCKG_NO                        = 0000000001
    LINE_NO                        = 0000000001
    OUTL_LEVEL                     = 0
    OUTL_IND                       = X
    SUBPCKG_NO                     = 0000000002
    FROM_LINE                      = 1    
    PCKG_NO                        = 0000000002
    LINE_NO                        = 0000000002
    EXT_LINE                       = 0000000010
    OUTL_LEVEL                     = 0
    SERV_TYPE                      = NZ
    QUANTITY                       = 5.000 
    BASE_UOM                       = UN
    PRICE_UNIT                     = 1 
    GR_PRICE                       = 10.0000    
    SHORT_TEXT                     = SHORT 1                                
    USERF1_TXT                     = LINHA NORMAL                           
    PCKG_NO                        = 0000000002
    LINE_NO                        = 0000000003
    EXT_LINE                       = 0000000020
    OUTL_LEVEL                     = 0
    SERV_TYPE                      = HZ
    GR_PRICE                       = 10.0000    
    SHORT_TEXT                     = SHORT 2                                
    INFORM                         = X
    USERF1_TXT                     = LINHA INFO                             
    PCKG_NO                        = 0000000002
    LINE_NO                        = 0000000004
    EXT_LINE                       = 0000000030
    OUTL_LEVEL                     = 0
    SERV_TYPE                      = NZ
    QUANTITY                       = 5.000 
    BASE_UOM                       = UN
    PRICE_UNIT                     = 1 
    GR_PRICE                       = 10.0000    
    SHORT_TEXT                     = SHORT 3                                
    USERF1_TXT                     = LINHA NORMAL                                                                               
    Parameters:    POSERVICESTEXT                 
    PCKG_NO                        = 0000000002
    LINE_NO                        = 0000000004
    TEXT_ID                        = LLTX
    FORMAT_COL                     = *
    TEXT_LINE                      = LONGO                                                                               
    PCKG_NO                        = 0000000002
    LINE_NO                        = 0000000004
    TEXT_ID                        = LTXT
    FORMAT_COL                     = *
    TEXT_LINE                      = SUCINTO
    Thanks and Regards
    null
    Message was edited by:
            Luis  Constantino

    Thank you for reply.
    Yes, I read it, but I found a sap note that say:
    You can also change services using BAPI_PO_CHANGE. Up to now, it was only possible to add complete service or limit items.
    Using the new BAPI_PO_CHANGE, you can now make changes to services and with limits.
    Because in the production mode the interfaces are filled entirely from available documents by report, SAP always assumes that the services or limits to be changed are sent in full to the BAPI interfaces with all the data belonging to them, even if not all the data is changed. If required entry fields are missing, the system displays an error message, other data not filled is possibly initialized. (It is not necessary to assign the complete item.)
    - NOTE 561507 -
    "What BAPI_PO_CHANGE can now do:
    1. Changes to an already existing item:
                  For an existing item, you can
    a) Add, change or delete services.
    b) Add, change or delete limits (free limits and contract limits), provided that this does not cause the net value of the purchase order item to become "0".
    1. Account assignment change for item category B and D: For an existing item, the account assignment can be changed.
    a) Account assignment category U can be converted into another account assignment category allowed for the item categories, and vice versa.
    b) An existing account assignment can be changed.
    c) In case of services, a single account assignment can be converted into a multiple account assignment and vice versa - not with limits (with item category B), here multiple account assignment is not possible on-line either).
    2. Making changes to more than one item.
    3. Change outline layouts.
    What the BAPI_PO_CHANGE cannot do:
    Everything which is not possible on-line either."

  • BAPI_PO_CHANGE - Account assignment serial number issue

    Hi,
    I am modifying Service PO with BAPI_PO_CHANGE.
    I am passign A/c Assignment with WBS_Element value and serial number '01' for individual line.
    PO has A/c Assignment catagory P(Project).
    But the existing PO which i want to modify, had Serial number '02' for A/c assignemnt serial number.
    So it is giving Short dump with raising exception for the class of Account assignnment handler.
    What need to dofor such A/c assignment catagory in Service PO Case.?
    Regards,
    Manoj

    Hi,
    Please try to change the serial number manually in mE22N and see.
    Regards,
    Nagaraj

  • BAPI_PO_CHANGE "No account assignment for service 0000010" SE 518 Error

    Hi  Friends,
    I am using BAPI_PO_CHANGE to add new line item with service data to purchase order.
    For one scenario BAPI give me above error is "No account assignment for service 0000010" SE 518 .
    basically when i pass outline aggrement and contract item to bapi i am getting this error.....according to my observation in outline agrement account assignment is maintain as 'U' but i want to pass outline agrement as 'K' or 'N' so i am passing this into BAPI parameters ,however i feel somewhere it is getting conflict  so it giving above error...
    Please guide,
    Thanks & Regards,
    Bhaskar

    Hi Seini,
    Thanks for reply ..
    I have pass contract number to BAPI ....and i also pass cost center and GL account to account assignment but still bapi giving same error.....I am totally stuck into this i tried a lot with different options..for other scenario BAPI works fine but when I pass contract number with account assignment 'U' and I want to change this 'U' to 'K' or 'N'  for this I pass account assignment to PO line item but BAPI fails in this perticular scenario.

  • Free_Item in BAPI_PO_CHANGE

    Hi,
    I want to make price = 0 in PO line Item. I'm using BAPI_PO_CHANGE with this code:
    DATA: gs_ekpo TYPE ekpo.
    DATA: gt_return TYPE TABLE OF bapiret2.
    DATA: gs_return TYPE bapiret2.
    DATA: gt_bapimepoitem TYPE TABLE OF bapimepoitem.
    DATA: gt_bapimepoitemx TYPE TABLE OF bapimepoitemx.
    DATA: gs_bapimepoitem TYPE bapimepoitem.
    DATA: gs_bapimepoitemx TYPE bapimepoitemx.
    PARAMETERS: p_ebeln LIKE ekpo-ebeln DEFAULT '1000901140'.
    PARAMETERS: p_ebelp LIKE ekpo-ebelp DEFAULT '1'.
    CLEAR: gs_ekpo,
           gs_return,
           gt_return[],
           gs_bapimepoitem,
           gs_bapimepoitemx,
           gt_bapimepoitem[],
           gt_bapimepoitemx[].
    SELECT SINGLE * FROM ekpo INTO gs_ekpo
    WHERE
          ebeln = p_ebeln AND
          ebelp = p_ebelp.
    IF sy-subrc = 0.
      gs_bapimepoitem-po_item = gs_ekpo-ebelp.
      gs_bapimepoitem-free_item = 'X'.
      APPEND gs_bapimepoitem TO gt_bapimepoitem.
      gs_bapimepoitemx-po_item = gs_ekpo-ebelp.
      gs_bapimepoitemx-free_item = 'X'.
      APPEND gs_bapimepoitemx TO gt_bapimepoitemx.
      CALL FUNCTION 'BAPI_PO_CHANGE'
        EXPORTING
          purchaseorder = gs_ekpo-ebeln
        TABLES
          return        = gt_return
          poitem        = gt_bapimepoitem
          poitemx       = gt_bapimepoitemx.
      READ TABLE gt_return INTO gs_return WITH KEY type = 'E'.
      IF sy-subrc EQ 0.
    *- errors
        WRITE:/ 'E', gs_ekpo-ebeln, gs_ekpo-ebelp, 'BAPI',
        gs_return-message.
      ELSE.
    *- success
        CLEAR: gs_return,
               gt_return[].
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait   = 'X'
          IMPORTING
            return = gs_return.
      ENDIF.
    ENDIF.
    The program run succsefely, but it does not update the price on the line item to value 0.
    Any Help please? i have SAP 4.72 with SAPKH47016.
    Thanks.

    Hi
    Try using the BADI to change the price.
    Implement BADI definition (ME_PROCESS_PO_CUST) and create a class and implemented the interface (IF_EX_ME_PROCESS_PO_CUST) and use the methods (PROCESS_ITEM) - GET_DATA and SET_DATA to change the price
    Pls let me know, whether it works
    Regards
    Madhan Doraikannan

  • Problem with BAPI_PO_CHANGE in adding services

    Hello,
    I have a problem in using BAPI_PO_CHANGE in adding new services for an existing po_item . I fill the table POITEM, POITEMX. Then I fill the POACCOUNT and POACCOUNTX table. Lastly I fill the table POSERVICES, POSRVACCESSVALUES. After running it with commit step. I get as return:
    The purchase order .... was updated. But if I look at my purchase order with trans. me23n, there was nothing added. Thus, I do not know what I forget. So it will be great, if someone can provide an example in correct filling the table.
    In Table POSERVICES I add for the field PCKG_NO the value : 0000000001, is this correct? because I will add new services positions.
    Thanks in advance for your support.
    Kind regards,
    Erkan

    Hello Anuradha,
    yes, I used the BAPI Commit command but it did not work.
    Kind regards,
    Erkan

  • How to display error messages in BAPI_PO_CHANGE  with PO and item ?

    Hello Friends,
    I am calling BAPI_PO_CHANGE to update delivery flag for 50 POs.
    Each PO has 4 line items. For ex.
    10001     10     5.00     material1      X
    10001     20     45.00     material2      X
    10001     30     22.00     material15      X     u201Cerror
    10001     40     45.00     material41      X
    10002     10     46.00     material17      X
    10002     20     25.00     material3      X     u201Cerror
    10002     30     75.00     material5      X     u201Cerror
    10002     40     44.00     material8      X
    u2026u2026u2026u2026u2026..
    u2026u2026u2026u2026u2026
    Now, suppose some line items have error.
    I am able to get it from BAPIu2019s    RETURN table.
    But how can I display that error message with PO and line item?
    NOTE : I am calling BAPI_PO_CHANGE for each PO with ITEM internal table.
    Please guide me.
    Regards
    RH

    The it_change_return fields parameter and row identify the PO_ITEM.
    Try this...
    *&      Form  READ_MESSAGES_OP_CHANGE
          BAPI_PO_CHANGE Return messages
    FORM read_messages_op_change .
      DELETE it_change_return WHERE type = 'W'.
      DELETE it_change_return WHERE type = 'I'.
      LOOP AT it_change_return ASSIGNING <is_change_return>.
        IF <is_change_return>-type = 'E'.
          z_error_flg = 'X'.
        ENDIF.
        v_item = v_item + 1.
        it_log_mess-packagenr = v_packagenr.
        it_log_mess-object = v_object.
        it_log_mess-docnum = v_docnum.
        it_log_mess-itemnr = v_item.
        it_log_mess-type = <is_change_return>-type.
        it_log_mess-id = <is_change_return>-id.
        it_log_mess-mnumber = <is_change_return>-number.
        IF <is_change_return>-parameter <> 'POITEM'.
          it_log_mess-message = text-po1.
          REPLACE '&' WITH z_po_number INTO it_log_mess-message.
          CONCATENATE it_log_mess-message <is_change_return>-message
            INTO it_log_mess-message SEPARATED BY space.
        ELSE.
          READ TABLE it_change_poitem ASSIGNING <is_change_poitem>
            INDEX <is_change_return>-row.
          it_log_mess-message = text-pr2.
          REPLACE '&' WITH z_po_number INTO it_log_mess-message.
          REPLACE '@' WITH <is_change_poitem>-po_item
            INTO it_log_mess-message.
          CONCATENATE it_log_mess-message <is_change_return>-message
                INTO it_log_mess-message SEPARATED BY space.
        ENDIF.
        it_log_mess-message_v1 = <is_change_return>-message_v1.
        it_log_mess-message_v2 = <is_change_return>-message_v2.
        it_log_mess-message_v3 = <is_change_return>-message_v3.
        it_log_mess-message_v4 = <is_change_return>-message_v4.
        APPEND it_log_mess.
      ENDLOOP.
    ENDFORM.                    " READ_MESSAGES_OP_CHANGE

  • BAPI_PO_CHANGE Sub-contracting PO

    Hello experts,
    we are using BAPI_PO_CHANGE to change the Item Category of a material
    in a purchase order to L (sub-contracting) when we do we receive the
    error message in the BAPI u201CNot possible to determine any componentsu201D
    due to the fact the associated material doesn't have a BoM. we do not
    want to create BoMs for these materials, we want to populate the BoM
    requirements directly in the Purchase order as you can do with
    transaction ME22n where you receive the same error message but you can
    continue,but in the the BAPI you can't. we have try many ways even
    trying to manipulate the error message but all fails.
    please advise if this is possible to do? are we using the correct
    BAPI? we have also tried with BAPI_PO_CREATE1 but the same error.
    Regards
    Mark

    hello Purnima.
                         thank you for the quick reply
    we are on SAP ECC 6.0 and this support note has already been applied.
    i think my question was a bit misleading, we have create a sub-contractor ( L) PO with BAPI_PO_CREATE1 and wish to add
    additional sub-contracting PO lines using  BAPI_PO_CHANGE the additional PO header lines, do not have a BoM already created and we do not want to create one as these are one off activities , we would like to applied the BOM components for the PO header item directly in the PO as you can in ME22n.  
    regards
    Mark

  • Updating Purchase Order data - BAPI_PO_CHANGE?

    Hi,
    I have been searching for a SAP standard tool that can update a Purchase Order upon its execution. The closest function module I could find was BAPI_PO_CHANGE. However, it was documented as a restriction that updating of service data is not possible with this function module (I have also tested this).
    Are there any other possible mechanisms which can be called/used for the purpose of updating a PO including its services? It would be most desirable if the following fields on a Purchase Order can be changed/updated via this mechanism (fields in bold are data found in a service):
    Field Field name
    Percentage EBKN-VPROZ
    Distribution Indicator EBAN-VRTKZ
    Project EBKN-PROJN
    Order EBKN-AUFNR
    Responsibility Cost Centre EBKN-ZZMRESP
    WBS Element EBKN-PS_PSP_PNR
    Cost Centre EBKN-KOSTL
    Unblocking User ESLL-USERF2_TXT
    User for Approval ESLL-USERF1_TXT
    Currency EBAN-WAERS
    Quantity EBAN-MENGE
    Price EBAN-PREIS
    Price unit EBAN-PEINH
    Overall Limit ESUH-SUMLIMIT
    Expected Value ESUH-COMMITMENT
    Net Value ESLL-NETWR
    Thanks in advance.
    ~ Andi

    Hi,
    You can try these FM to update info record.
    ME_DB_UPDATE_INFORECORDS
    ME_UPDATE_INFORECORD
    ME_UPDATE_INFORECORD_COND
    ME_UPDATE_INFORECORD_PD
    Check the sample code on BAPI_PO_CHANGE
    http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm
    Regards,
    Shiva Kumar

Maybe you are looking for