Skip to Content
Former Member
Mar 22, 2011 at 03:01 PM

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.

      purchaseorder  = wa_po_c-ebeln
      testrun        = v_testrun
      no_messaging   = c_x
      no_message_req = c_x
      expheader      = wa_expheader
      return         = it_return
      poitem         = it_poitem
      poitemx        = it_poitemx
      poaccount      = it_poaccount
      poaccountx     = it_poaccountx