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

Similar Messages

  • 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

  • BAPI_PO_CHANGE

    I want to change payment terms for a purchase order. Is it possible to achieve the same by using BAPI_PO_CHANGE. I have tried the same by giving the po number and payment terms in POHEADER and POHEADERX. But failed to achieve the result. CAn anyone help me pl

    BAPI RETURN Table is not having any record. Otherwise it gives message as po successfully changed.

  • 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

  • Update Schedule line Delivery date using Bapi_po_Change

    Hi all,
    I am using Bapi_po_change to Update the Schedule line Delivery date(EKET-EINDT) for the PO based on the Item and the Schedule line.
    I am passing the PO number, Po header, Item structure, Schedule line Structure.
    But the Date is not getting updated in the Eket table.
    Please suggest.

    Hi Sukriti,
    Thanks for the Response, yes i have used the Bapi Transaction Commit Also .
    The point is I am able to Update the Statistical Delivery Date in the Same EKET table using BAPI_PO_Change .I have Checked all the Ways to update the EKET-EINDT(Delivery Date)but no Unable to do it.

  • 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

  • Unchecked final invoice and delivery completed indicator via BAPI_PO_CHANGE

    Hi All,
    Is it possible to reset the final invoice and delivery completed indicators of PO in ME23N using BAPI_PO_CHANGE? I need to unchecked the final invoice and delivery completed indicators for all POs in our system that were accidentally updated to delivery completed and final invoice by the user.
    Points will be rewared.

    what i did now is to create a prototype program like the one below:
    CONSTANTS c_po TYPE bapimepoheader-po_number VALUE '0040001816'.
    DATA: t_poitem-po TYPE bapimepoheader-po_number,
          t_return TYPE STANDARD TABLE OF bapiret2,
          t_poitem TYPE STANDARD TABLE OF bapimepoitem,
          t_poitemx TYPE STANDARD TABLE OF bapimepoitemx,
          x_return TYPE bapiret2,
          x_poitem TYPE bapimepoitem,
          x_poitemx TYPE bapimepoitemx.
    t_poitem-po = c_po.
    x_poitem-no_more_gr = 'X'.
    x_poitemx-no_more_gr = 'X'.
    x_poitem-final_inv = 'X'.
    x_poitemx-final_inv = 'X'.
    x_poitem-po_item = c_po.
    x_poitemx-po_item = c_po.
    APPEND x_poitem TO t_poitem.
    APPEND x_poitemx TO t_poitemx.
    CALL FUNCTION 'BAPI_PO_CHANGE'
      EXPORTING
        purchaseorder  = t_poitem-po
        no_messaging   = 'X'
        no_message_req = 'X'
      TABLES
        return         = t_return
        poitem         = t_poitem
        poitemx        = t_poitemx.
    IF sy-subrc = 0.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.
    ENDIF.
    The program is working if you will mark the PO as delivery completed and final invoice with suppressed output. The problem is i need to do the reverse which is to unmark. I replaced the value of no_more_gr and final_inv from 'X' to space but it is not working.

  • 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 with scheduling

    Hai frnds,
      Im using BAPI_PO_CHANGE for changing the quantity of the existing item and need to create an new item also. For this im using scheduling table(poschedule),where one item has two scheduling line.
    Existing details
    Eg: POHEADER:    0210000001
        POITEM:
          10 -> 400(quantity)
        POSCHEDULE:
          10 -> 1(1st sched) -> 100(quantity)
          10 -> 2(2nd sched) -> 300(quantity)
    After modification
    Eg: POHEADER:    0210000001
        POITEM:
         10 -> 60(quantity)
         20 -> 340(quantity)
        POSCHEDULE:
         10 -> 1(1st sched) -> 60(quantity)
         10 -> 2(2nd sched) -> 0(quantity)
         20 -> 1(1st sched) -> 40(quantity)
         20 -> 2(2nd sched) -> 300(quantity)
    Can anyone help me to solve this problem??? wat are the fields to be considered in POITEM,POSCHEDULE?
    Suganya Jayabalan.

    Hai Thomas,
      this is the code:
    REPORT  zfi_upd_import_process NO STANDARD PAGE HEADING
                                     MESSAGE-ID z6 .
    TABLES: zmmpoamend,ekko, ekpo.
    DATA:t_zmmpo_amend_tab LIKE zmmpoamend OCCURS 0 WITH HEADER LINE.
    DATA:t_zmmpo_amend_tab1 LIKE zmmpoamend OCCURS 0 WITH HEADER LINE.
    DATA:v_bstmg     LIKE bapimepoitem-quantity,
         v_ebelp     LIKE bapimepoitem-po_item,
         v_belnr1    LIKE bkpf-belnr,
         v_awkey     LIKE bkpf-awkey,
         v_orderunit LIKE ekpo-meins,
         v_currency  LIKE tcurc-waers,
         v_ebeln     LIKE ekko-ebeln,
         v_payterm   LIKE ekko-zterm,
         v_zfbdt     LIKE bseg-zfbdt,
         v_flag(1)   TYPE c,
         v_flgbdc(1) TYPE c.
    DATA: wa_bapiquantity1 like eket-menge,
          wa_bapiquanfin1 like eket-menge,
          wa_bapiquantot like eket-menge,
          wa_bapiquantity2 like eket-menge,
          wa_bapiquanfin2 like eket-menge.
    DATA: BEGIN OF t_belnr_tab OCCURS 0,
            belnr LIKE bkpf-belnr,
            gjahr LIKE bkpf-gjahr,
          END OF t_belnr_tab.
    DATA: BEGIN OF t_ret_tab OCCURS 0.
            INCLUDE STRUCTURE bapiret2.
    DATA: END OF t_ret_tab.
    FOR PO AMENDMENT POSTING ****************
    DATA:BEGIN OF t_bapimepocond_tab OCCURS 0.
            INCLUDE STRUCTURE bapimepocond.
    DATA:END OF t_bapimepocond_tab.
    DATA:BEGIN OF t_bapimepoitem_tab OCCURS 0.
            INCLUDE STRUCTURE bapimepoitem.
    DATA:END OF t_bapimepoitem_tab.
    DATA: t_bapimepoitem_tab1 LIKE t_bapimepoitem_tab OCCURS 0 WITH HEADER
    LINE
    DATA:BEGIN OF t_bapimepoitemdet_tab OCCURS 0.
            INCLUDE STRUCTURE bapiekpo.
    DATA:END OF t_bapimepoitemdet_tab.
    DATA:BEGIN OF t_bapieket_tab OCCURS 0.
            INCLUDE STRUCTURE bapieket.
    DATA:END OF t_bapieket_tab.
    DATA:BEGIN OF t_bapiposchedule OCCURS 0.
            INCLUDE STRUCTURE BAPIMEPOSCHEDULE.
    DATA:END OF t_bapiposchedule.
    data: w_no type i,
          w_no1 type i,
          w_idx type i.
    DATA: w_ebelp like ekpo-ebelp.
    DATA:BEGIN OF t_bapimepoaccount_tab OCCURS 0.
            INCLUDE STRUCTURE bapimepoaccount.
    DATA:END OF t_bapimepoaccount_tab.
    DATA:BEGIN OF t_bapimepoaccountx_tab OCCURS 0.
            INCLUDE STRUCTURE bapimepoaccountx.
    DATA:END OF t_bapimepoaccountx_tab.
    DATA:BEGIN OF t_bapimepoaccountdet_tab OCCURS 0.
            INCLUDE STRUCTURE bapiekkn.
    DATA:END OF t_bapimepoaccountdet_tab.
    DATA:BEGIN OF t_bapimepoitemx_tab OCCURS 0.
            INCLUDE STRUCTURE bapimepoitemx.
    DATA:END OF t_bapimepoitemx_tab.
    DATA:wa_bapimepoitem LIKE LINE OF t_bapimepoitem_tab.
    data: begin of t_bapiposchedulex occurs 0.
            include structure BAPIMEPOSCHEDULX.
    data: end of t_bapiposchedulex.
    END OF FOR PO AMENDMENT POSTING **********
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_poamd RADIOBUTTON GROUP rad1,
               p_mirofs RADIOBUTTON GROUP rad1,
               p_mirocd RADIOBUTTON GROUP rad1,
               p_mirofr RADIOBUTTON GROUP rad1,
               p_j1iex RADIOBUTTON GROUP rad1.
    SELECT-OPTIONS:s_zzboe FOR zmmpoamend-zzboe NO INTERVALS NO-EXTENSION
                               OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1.
    IF p_poamd = 'X'.
    begin of internal table processing for calling BAPI's*******
      SELECT * FROM zmmpoamend INTO TABLE t_zmmpo_amend_tab
         WHERE zzboe IN s_zzboe AND
               zzpostat = ' '.
      IF sy-subrc <> '0'.
        MESSAGE 'No PO found which has to be updated.' TYPE 'E'.
      ENDIF.
    begin of PO Amendment****************
      LOOP AT t_zmmpo_amend_tab .
        t_zmmpo_amend_tab-waers = 'INR'.
        t_zmmpo_amend_tab1 = t_zmmpo_amend_tab.
        t_zmmpo_amend_tab1-zzpostat = 'X'.
        APPEND t_zmmpo_amend_tab1.
        IF t_zmmpo_amend_tab-zzwrbtrvcd NE '0'.
          CLEAR t_bapimepocond_tab.
          t_bapimepocond_tab-itm_number = t_zmmpo_amend_tab-ebelp.
          t_bapimepocond_tab-cond_value = t_zmmpo_amend_tab-zzwrbtrvcd.
          t_bapimepocond_tab-cond_type = 'ZVCD'.
          t_bapimepocond_tab-currency = t_zmmpo_amend_tab-waers.
          t_bapimepocond_tab-change_id = 'I'.
          APPEND t_bapimepocond_tab.
        ENDIF.
        IF t_zmmpo_amend_tab-zzwrbtrvnv NE '0'.
          CLEAR t_bapimepocond_tab.
          t_bapimepocond_tab-itm_number = t_zmmpo_amend_tab-ebelp.
          t_bapimepocond_tab-cond_value = t_zmmpo_amend_tab-zzwrbtrvnv.
          t_bapimepocond_tab-cond_type = 'ZVNV'.
          t_bapimepocond_tab-currency = t_zmmpo_amend_tab-waers.
          t_bapimepocond_tab-change_id = 'I'.
          APPEND t_bapimepocond_tab.
        ENDIF.
        IF t_zmmpo_amend_tab-zzwrbtrccd NE '0'.
          CLEAR t_bapimepocond_tab.
          t_bapimepocond_tab-itm_number = t_zmmpo_amend_tab-ebelp.
          t_bapimepocond_tab-cond_value = t_zmmpo_amend_tab-zzwrbtrccd.
          t_bapimepocond_tab-cond_type = 'ZCCD'.
          t_bapimepocond_tab-currency = t_zmmpo_amend_tab-waers.
          t_bapimepocond_tab-change_id = 'I'.
          APPEND t_bapimepocond_tab.
        ENDIF.
        IF t_zmmpo_amend_tab-zzwrbtrvcv NE '0'.
          CLEAR t_bapimepocond_tab.
          t_bapimepocond_tab-itm_number = t_zmmpo_amend_tab-ebelp.
          t_bapimepocond_tab-cond_value = t_zmmpo_amend_tab-zzwrbtrvcv.
          t_bapimepocond_tab-cond_type = 'ZVCV'.
          t_bapimepocond_tab-currency = t_zmmpo_amend_tab-waers.
          t_bapimepocond_tab-change_id = 'I'.
          APPEND t_bapimepocond_tab.
        ENDIF.
        IF t_zmmpo_amend_tab-zzwrbtrvce NE '0'.
          CLEAR t_bapimepocond_tab.
          t_bapimepocond_tab-itm_number = t_zmmpo_amend_tab-ebelp.
          t_bapimepocond_tab-cond_value = t_zmmpo_amend_tab-zzwrbtrvce.
          t_bapimepocond_tab-cond_type = 'ZVCE'.
          t_bapimepocond_tab-currency = t_zmmpo_amend_tab-waers.
          t_bapimepocond_tab-change_id = 'I'.
          APPEND t_bapimepocond_tab.
        ENDIF.
        IF t_zmmpo_amend_tab-zzwrbtrvfi NE '0'.
          CLEAR t_bapimepocond_tab.
          t_bapimepocond_tab-itm_number = t_zmmpo_amend_tab-ebelp.
          t_bapimepocond_tab-cond_value = t_zmmpo_amend_tab-zzwrbtrvfi.
          t_bapimepocond_tab-cond_type = 'ZVFI'.
          t_bapimepocond_tab-currency = t_zmmpo_amend_tab-waers.
          t_bapimepocond_tab-change_id = 'I'.
          APPEND t_bapimepocond_tab.
        ENDIF.
        IF t_zmmpo_amend_tab-zzwrbtrvad NE '0'.
          CLEAR t_bapimepocond_tab.
          t_bapimepocond_tab-itm_number = t_zmmpo_amend_tab-ebelp.
          t_bapimepocond_tab-cond_value = t_zmmpo_amend_tab-zzwrbtrvad.
          t_bapimepocond_tab-cond_type = 'ZVAD'.
          t_bapimepocond_tab-currency = t_zmmpo_amend_tab-waers.
          t_bapimepocond_tab-change_id = 'I'.
          APPEND t_bapimepocond_tab.
        ENDIF.
        IF t_zmmpo_amend_tab-zzwrbtrvac NE '0'.
    ZVAC added..
          CLEAR t_bapimepocond_tab.
          t_bapimepocond_tab-itm_number = t_zmmpo_amend_tab-ebelp.
          t_bapimepocond_tab-cond_value = t_zmmpo_amend_tab-zzwrbtrvac.
          t_bapimepocond_tab-cond_type = 'ZVAC'.
          t_bapimepocond_tab-currency = t_zmmpo_amend_tab-waers.
          t_bapimepocond_tab-change_id = 'I'.
          APPEND t_bapimepocond_tab.
        ENDIF.
        IF t_zmmpo_amend_tab-zzwrbtrvae NE '0'.
    ZVAE added..
          CLEAR t_bapimepocond_tab.
          t_bapimepocond_tab-itm_number = t_zmmpo_amend_tab-ebelp.
          t_bapimepocond_tab-cond_value = t_zmmpo_amend_tab-zzwrbtrvae.
          t_bapimepocond_tab-cond_type = 'ZVAE'.
          t_bapimepocond_tab-currency = t_zmmpo_amend_tab-waers.
          t_bapimepocond_tab-change_id = 'I'.
          APPEND t_bapimepocond_tab.
        ENDIF.
        IF t_zmmpo_amend_tab-zzwrbtrmis NE '0'.
    ZMIS(Miscellaenous charges) added..
          CLEAR t_bapimepocond_tab.
          t_bapimepocond_tab-itm_number = t_zmmpo_amend_tab-ebelp.
          t_bapimepocond_tab-cond_value = t_zmmpo_amend_tab-zzwrbtrmis.
          t_bapimepocond_tab-cond_type = 'ZMIS'.
          t_bapimepocond_tab-currency = t_zmmpo_amend_tab-waers.
          t_bapimepocond_tab-change_id = 'I'.
          APPEND t_bapimepocond_tab.
        ENDIF.
        IF t_zmmpo_amend_tab-zzinsper NE '0'.
    insurance
          CLEAR t_bapimepocond_tab.
          t_bapimepocond_tab-itm_number = t_zmmpo_amend_tab-ebelp.
          t_bapimepocond_tab-cond_value = t_zmmpo_amend_tab-zzinsper.
          t_bapimepocond_tab-cond_type = 'ZPIN'.
          t_bapimepocond_tab-currency = '%'. "zmmpo_amend_tab-waers.
          t_bapimepocond_tab-change_id = 'I'.
          APPEND t_bapimepocond_tab.
        ENDIF.
        IF t_zmmpo_amend_tab-zzclsper NE '0'.
    *clearing charges.
          CLEAR t_bapimepocond_tab.
          t_bapimepocond_tab-itm_number = t_zmmpo_amend_tab-ebelp.
          t_bapimepocond_tab-cond_value = t_zmmpo_amend_tab-zzclsper.
          t_bapimepocond_tab-cond_type = 'ZPCL'.
          t_bapimepocond_tab-currency = '%'. "zmmpo_amend_tab-waers.
          t_bapimepocond_tab-change_id = 'I'.
          APPEND t_bapimepocond_tab.
        ENDIF.
        v_bstmg = t_zmmpo_amend_tab1-menge + v_bstmg.
        AT END OF ebelp.
         t_bapimepoitem_tab-po_number = t_zmmpo_amend_tab1-ebeln .
          t_bapimepoitem_tab-po_item = t_zmmpo_amend_tab1-ebelp .
          t_bapimepoitem_tab-quantity = v_bstmg.
          APPEND t_bapimepoitem_tab.
          CLEAR v_bstmg.
        ENDAT.
        AT END OF  ebeln.
         L_EBELN =
          CALL FUNCTION 'BAPI_PO_GETDETAIL'
            EXPORTING
              purchaseorder                    = t_zmmpo_amend_tab-ebeln
             items                            = 'X'
             account_assignment               = 'X'
             SCHEDULES                        = 'X'
           TABLES
             po_items                         = t_bapimepoitemdet_tab
             po_item_account_assignment       = t_bapimepoaccountdet_tab
             PO_ITEM_SCHEDULES                = t_bapieket_tab.
          CLEAR v_ebelp.
          v_ebelp = t_bapimepoitemdet_tab-po_item.
          LOOP AT t_bapimepoitem_tab.
            v_bstmg = t_bapimepoitem_tab-quantity.
            LOOP AT t_bapimepoitemdet_tab WHERE
                              po_number = t_zmmpo_amend_tab-ebeln AND
                              po_item = t_bapimepoitem_tab-po_item.
              IF t_bapimepoitemdet_tab-quantity =
              t_bapimepoitem_tab-quantity.
               MOVE-CORRESPONDING t_bapimepoitemdet_tab TO wa_bapimepoitem.
                wa_bapimepoitem-gr_basediv = ' '.
                APPEND wa_bapimepoitem TO t_bapimepoitem_tab1.
                t_bapimepoitemx_tab-po_item = wa_bapimepoitem-po_item.
                t_bapimepoitemx_tab-gr_basediv = 'X'.
                APPEND t_bapimepoitemx_tab.
              ELSE.
                v_ebelp = v_ebelp + '10'.
                MOVE-CORRESPONDING t_bapimepoitemdet_tab TO wa_bapimepoitem.
                wa_bapimepoitem-quantity = t_bapimepoitemdet_tab-quantity -
                                           t_bapimepoitem_tab-quantity.
                wa_bapimepoitem-po_item = v_ebelp .
                APPEND wa_bapimepoitem TO t_bapimepoitem_tab1.
                LOOP AT t_bapimepoaccountdet_tab
                  WHERE po_item = t_bapimepoitem_tab-po_item.
                  MOVE-CORRESPONDING t_bapimepoaccountdet_tab TO
                                    t_bapimepoaccount_tab.
                  t_bapimepoaccount_tab-gl_account =
                    t_bapimepoaccountdet_tab-g_l_acct.
                  t_bapimepoaccount_tab-itm_number =
                    t_bapimepoaccountdet_tab-sdoc_item.
                  t_bapimepoaccount_tab-quantity = wa_bapimepoitem-quantity.
                  t_bapimepoaccount_tab-po_item = v_ebelp.
                  t_bapimepoaccountx_tab-po_item = v_ebelp.
                  t_bapimepoaccountx_tab-quantity = 'X'.
                  t_bapimepoaccountx_tab-creat_date = 'X'.
                  t_bapimepoaccountx_tab-quantity = 'X'.
                  t_bapimepoaccountx_tab-gl_account = 'X'.
                  t_bapimepoaccountx_tab-bus_area = 'X'.
                  t_bapimepoaccountx_tab-costcenter = 'X'.
                  t_bapimepoaccountx_tab-sd_doc = 'X'.
                  t_bapimepoaccountx_tab-itm_number = 'X'.
                  t_bapimepoaccountx_tab-co_area = 'X'.
                  t_bapimepoaccountx_tab-part_acct = 'X'.
                  APPEND  t_bapimepoaccount_tab.
                  APPEND  t_bapimepoaccountx_tab.
                ENDLOOP.
                t_bapimepoitemx_tab-po_item = wa_bapimepoitem-po_item.
                t_bapimepoitemx_tab-quantity = 'X'.
                t_bapimepoitemx_tab-stge_loc = 'X'.
                t_bapimepoitemx_tab-preq_no = 'X'.
                t_bapimepoitemx_tab-preq_item = 'X'.
                t_bapimepoitemx_tab-material = 'X'.
                t_bapimepoitemx_tab-po_unit = 'X'.
                t_bapimepoitemx_tab-plant = 'X'.
                APPEND t_bapimepoitemx_tab.
                MOVE-CORRESPONDING t_bapimepoitemdet_tab TO wa_bapimepoitem.
                wa_bapimepoitem-quantity = v_bstmg.
                wa_bapimepoitem-gr_basediv = ' '.
                APPEND wa_bapimepoitem TO t_bapimepoitem_tab1.
                t_bapimepoitemx_tab-po_item = wa_bapimepoitem-po_item.
               t_bapimepoitemx_tab-quantity = 'X'.
               t_bapimepoitemx_tab-gr_basediv = 'X'.
                APPEND t_bapimepoitemx_tab.
    *********this is wer new coding starts*****************************
    *inserted for delivery scheduling foe PO
              loop at t_bapieket_tab
                      where po_item = t_bapimepoitemdet_tab-po_item.
                w_idx = sy-tabix.
              IF t_bapieket_tab-SERIAL_NO = '0001'.
               IF t_bapimepoitem_tab-quantity > t_bapieket_tab-quantity or
                  t_bapimepoitem_tab-quantity = t_bapieket_tab-quantity.
                 wa_bapiquantity1 = t_bapieket_tab-quantity.
               ELSEIF t_bapimepoitem_tab-quantity < t_bapieket_tab-quantity.
                 wa_bapiquantity1 = t_bapimepoitem_tab-quantity.
               ENDIF.
                 wa_bapiquanfin1 = t_bapieket_tab-quantity - wa_bapiquantity1.
                 t_bapieket_tab-QUANTITY = wa_bapiquantity1.
                 modify t_bapieket_tab index w_idx transporting quantity.
                  t_bapieket_tab-po_item = v_ebelp.
                  t_bapieket_tab-quantity = wa_bapiquanfin1.
                  append t_bapieket_tab.
              ELSE.
                 IF t_bapimepoitem_tab-quantity > t_bapieket_tab-quantity.
                  wa_bapiquantity2 = t_bapimepoitem_tab-quantity - wa_bapiquantity1.
                 ELSEIF t_bapimepoitem_tab-quantity < t_bapieket_tab-quantity or
                        t_bapimepoitem_tab-quantity = t_bapieket_tab-quantity.
                  wa_bapiquantity2 = 0.
                 ENDIF.
                 wa_bapiquanfin2 = t_bapieket_tab-quantity - abs( wa_bapiquantity2 ).
                 t_bapieket_tab-QUANTITY = abs( wa_bapiquantity2 ).
                 modify t_bapieket_tab index w_idx transporting quantity.
                  t_bapieket_tab-po_item = v_ebelp.
                  t_bapieket_tab-quantity = wa_bapiquanfin2.
                  append t_bapieket_tab.
              ENDIF.
              endloop.
              Sort t_bapieket_tab by po_item.
              sort t_bapimepoitem_tab1 by po_item.
              sort t_bapimepoitemx_tab by po_item.
              loop at t_bapieket_tab.
                move: t_bapieket_tab-po_item to t_bapiposchedule-po_item,
                      t_bapieket_tab-serial_no to t_bapiposchedule-sched_line,
                      t_bapieket_tab-quantity to t_bapiposchedule-quantity,
                      t_bapieket_tab-preq_no to t_bapiposchedule-preq_no,
                      t_bapieket_tab-preq_item to t_bapiposchedule-preq_item.
                if  t_bapieket_tab-quantity = 0.
                 t_bapiposchedule-delete_ind = 'X'.
                endif.
                append t_bapiposchedule.
                move: t_bapieket_tab-po_item to t_bapiposchedulex-po_item,
                      t_bapieket_tab-serial_no to t_bapiposchedulex-sched_line.
                t_bapiposchedulex-po_itemx = 'X'.
                t_bapiposchedulex-sched_linex = 'X'.
                if  t_bapieket_tab-quantity = 0.
                 t_bapiposchedulex-delete_ind = 'X'.
                elseif  t_bapieket_tab-quantity <> 0.
                 t_bapiposchedulex-quantity = 'X'.
                endif.
                clear: w_ebelp.
                select single ebelp from ekpo
                       into w_ebelp
                       where ebeln = t_zmmpo_amend_tab-ebeln and
                             ebelp = t_bapieket_tab-po_item.
                if w_ebelp is initial.
                 t_bapiposchedulex-preq_no = 'X'.
                 t_bapiposchedulex-preq_item = 'X'.
                endif.
                append t_bapiposchedulex.
                clear: t_bapiposchedulex, t_bapiposchedule.
               endloop.
              ENDIF.
            ENDLOOP.
    ***********end of new insertion**********************************************
            CLEAR t_bapimepoitemdet_tab.
            CLEAR v_bstmg.
          ENDLOOP.
          CALL FUNCTION 'BAPI_PO_CHANGE'
            EXPORTING
              purchaseorder                = t_zmmpo_amend_tab-ebeln
           TABLES
             return                       = t_ret_tab
             poitem                       = t_bapimepoitem_tab1
             poitemx                      = t_bapimepoitemx_tab
    *****************inserted by suganya-2006/06/27*************************
             POSCHEDULE                   = t_bapiposchedule
             POSCHEDULEX                  = t_bapiposchedulex
    *****************end of insertion-suganya-2006/06/27********************
             poaccount                    =  t_bapimepoaccount_tab
             poaccountx                   =  t_bapimepoaccountx_tab
             pocond                       = t_bapimepocond_tab
          CLEAR v_flag.
          LOOP AT t_ret_tab.
            IF t_ret_tab-type = 'E'.
              v_flag = 'X'.
              WRITE:/2 t_zmmpo_amend_tab-ebeln,
                   15 t_ret_tab-type,
                   25 t_ret_tab-message.
            ENDIF.
            AT LAST.
              IF v_flag <> 'X'.
                UPDATE zmmpoamend FROM TABLE t_zmmpo_amend_tab1.
                CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
                  EXPORTING
                    wait = 'X'.
                WRITE:/2 'PO ',5 t_zmmpo_amend_tab-ebeln,
                               16 ' changed succesfully'.
              ENDIF.
            ENDAT.
          ENDLOOP.
          CLEAR t_ret_tab.
          REFRESH t_ret_tab.
          CLEAR t_bapimepocond_tab.
          REFRESH t_bapimepocond_tab.
          CLEAR t_zmmpo_amend_tab1.
          REFRESH t_zmmpo_amend_tab1.
          CLEAR t_bapimepoitem_tab.
          REFRESH t_bapimepoitem_tab.
          CLEAR t_bapimepoitemdet_tab.
          REFRESH t_bapimepoitemdet_tab.
          CLEAR t_bapimepoitem_tab1.
          REFRESH t_bapimepoitem_tab1.
          CLEAR t_bapimepoitemx_tab.
          REFRESH t_bapimepoitemx_tab.
          CLEAR t_bapimepoaccount_tab.
          REFRESH t_bapimepoaccount_tab.
          CLEAR t_bapimepoaccountdet_tab.
          REFRESH t_bapimepoaccountdet_tab.
          CLEAR t_bapimepoaccountx_tab.
          REFRESH t_bapimepoaccountx_tab.
        ENDAT.
      ENDLOOP.
    ENDIF.
    End of PO Amendment****************
    Regrads,
    Suganya Jayabalan

  • 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."

  • Using BAPI_PO_CHANGE to update PO with item actegory B

    Hi Experts,
    I have a requirement to update the PO with item category B which is created by referring  PR having account assignment category N(.( So I have a PO with Acc assignment N now have to update the item category with B ). I am using BAPI_PO_CHANGE to update the item category with B  .in me22n system will prompt the Limits ( overall limit , expected value) and Network details ( like GL acc and Network and activity code) so i am passing lt_poitem,lt_poitemx,lt_polimits,lt_poaccount,lt_poaccountx,lt_POSRVACCESSVALUES. System is issuing a message Buffer table is not up-to-date . Please let me know if any one updated the PO with item category B using BAPI_PO_CHANGE and please provide sample code for the same if possible. Thanks in advance.
    Thanks
    Pravee

    Hi Experts,
    I am passing the required structure as below .
    CALL FUNCTION 'BAPI_PO_CHANGE'
      EXPORTING
        purchaseorder = v_po
      TABLES
        return        = lt_return
        poitem        = lt_poitem
        poitemx       = lt_poitemx
        polimits      = lt_polimits
        poaccount     = lt_poaccount
        poaccountx    = lt_poaccountx
        POSRVACCESSVALUES = lt_POSRVACCESSVALUES
        POCONTRACTLIMITS = lt_POCONTRACTLIMITS
        POSERVICES    = lt_POSERVICES.
    Now i am getting a message below messages from BAPI :
    S     06     023     Indirect PO (ZSTA) 4506000481 changed
    I     ME     664     Change Item Category could not be effected
    I     ME     664     Change Item Category could not be effected
    I can see that the PO is not got updated with any of values.Please help me to resolve this issue.
    Thanks
    PRavee.

  • 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

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

Maybe you are looking for

  • Unable to connect computers to a Windows Server 2012

    I have two brand new Windows 7 Professional computers that I want to connect to a Windows Server 2012 Essentials.  I'm able to download the connector software but when it is searching for the server I receive a message that "Cannot locate or identify

  • Add new mandatory column without killing concurrent transactions

    I know of several approaches to this problem, but as the table in question is key to my organisation, I'd quite like to get this right first time! I need to add a 1 character column to a large (approx 1 million rows, approx 100 cols) table which also

  • Checkpoint not complete

    Hi I am getting this error in my alter.log file.Due to this error our performance is reduced. can you please tell me what are the steps i need to take to solve this issue in oracle 9.2.0.7 and 10.2.0.2 environment? Thanks. Regards, RJ.

  • Macbook and 3D applications

    Hi! I have just ordered a macbook (1.83 ghz) to replace my Powerbook 1.33 ghz (17inch). At home both me and my girlfriend use Cinema 4D for interior rendering and modelling. How well does the intel graphics perform in 3d apps such as Cinema 4D? Any e

  • Lan Database and Wireless Database Connectivity and Settings

    Some one help me that what the difference in LAN connectivity and connectivity over a wireless network. Is any difference. If difference than please send me some material to understand this. Thanks