Skip to Content
0
Former Member
Jan 05, 2012 at 05:24 PM

account assignment data not updated in PO

184 Views

HI All ,

I am creating a PO from PR from ME59N and i need to populate the account assignment category and accounting data in PO while creating it , I am using the BADI ME_PROCESS_PO_CUST and implemented the methods PROCESS_ITEM and for the same in the below way

DATA: lv_po_head_ref TYPE REF TO if_purchase_order_mm,

lv_mepoheader TYPE mepoheader,

lv_mepoitem TYPE mepoitem,

cl_po TYPE REF TO cl_po_header_handle_mm,

lv_item(5) TYPE c,

lv_bool TYPE boolean.

Retrieve Invoice Receipt Indicator for each item and if not set,

then set it.

lv_po_head_ref = im_item->get_header( ).

lv_mepoheader = lv_po_head_ref->get_data( ).

lv_mepoitem = im_item->get_data( ).

IF lv_mepoitem-knttp IS INITIAL.

lv_mepoitem-knttp = 'K'.

LV_MEPOITEM-KOSTL = '71005210E'.

LV_MEPOITEM-SAKTO = 'C4545411'.

CALL METHOD im_item->set_data

EXPORTING

im_data = lv_mepoitem.

ENDIF.

but i am getting below errors

PO could not be created

PO header data still faulty

Data from Business Add-In ME_PROCESS_PO_CUST not adopted

Can delivery date be met?

Enter Cost Center

Requisition could not be converted

I have tried putting in the same logic in PROCESS_ACCOUNT but still in vain .

please can you suggest what can be the reason, and how can i successfully update the details.

thanks

Edited by: Santosh Chitturu on Jan 5, 2012 6:24 PM