Hi;
I have a Z class [ZCL_IM_ME_PROCESS_REQ_CUST], in the method IF_EX_ME_PROCESS_REQ_CUST~PROCESS_ACCOUNT i get account and item information, this is done ok, i get the data that i need.
Now i need to change wa_exkn-sakto value with a new value, but when i do this and run tcode ME51N i get the ERROR MOUT314 BAdI ME_PROCESS_OUT / ME_PROCESS_OUT_CUST.
But if i disable the code that changes wa_exkn-sakto the error isn't displayed. I've seen several examples and they do the same that i am doing, i don't see the difference.
Any help please
this is my code for method IF_EX_ME_PROCESS_REQ_CUST~PROCESS_ACCOUNT
IF sy-tcode = 'ME51N'.
DATA: wa_exkn TYPE exkn,
wa_exknx TYPE mepoaccounting_datax,
wa_item TYPE mereq_item,
wa_itemref TYPE REF TO if_purchase_requisition_item,
wa_exkn_hold TYPE exkn,
wa_exknx_hold TYPE mepoaccounting_datax,
wa_item_hold TYPE mereq_item,
wa_itemref_hold TYPE REF TO if_purchase_requisition_item.
DATA: p_bklas TYPE bklas,
p_konts TYPE saknr,
p_sakto TYPE saknr.
**************************************************************************
* P R O C E S S I N G *
**************************************************************************
IF im_count = 1.
CLEAR:wa_exkn_hold,
wa_exknx_hold,
wa_item_hold,
wa_itemref.
ENDIF.
CLEAR: wa_exkn,
wa_exknx,
wa_item,
wa_itemref.
***********************************************
* cuenta de mayor
***********************************************
CALL METHOD im_account->get_exkn
RECEIVING
re_exkn = wa_exkn.
MOVE wa_exkn TO wa_exkn_hold.
CALL METHOD im_account->get_exknx
RECEIVING
re_exknx = wa_exknx.
MOVE wa_exknx TO wa_exknx_hold.
***********************************************
* items
***********************************************
CALL METHOD im_account_ref->get_item
RECEIVING
re_item = wa_itemref.
MOVE wa_itemref TO wa_itemref_hold.
CALL METHOD wa_itemref->get_data
RECEIVING
re_data = wa_item.
MOVE wa_item TO wa_item_hold.
*** validamos que el documento presupuestario tenga datos
IF wa_exkn_hold-kblnr IS NOT INITIAL AND wa_exkn_hold-kblpos IS NOT INITIAL.
*** obtenemos la cta de mayor del documento presupuestario
SELECT SINGLE sakto INTO p_sakto FROM ebkn WHERE kblnr = wa_exkn_hold-kblnr AND kblpos = wa_exkn_hold-kblpos.
IF sy-subrc = 0.
SELECT SINGLE bklas INTO p_bklas FROM mbew WHERE matnr = wa_item_hold-matnr AND bwkey = wa_item_hold-werks.
IF sy-subrc = 0.
*** obtenemos la cuenta de mayor del material
SELECT SINGLE konts
INTO p_konts
FROM t030
WHERE
KTOPL = 'PCHN' AND
KTOSL = 'GBB' AND
KOMOK = 'VBR' AND
BKLAS = p_bklas.
IF sy-subrc = 0.
IF p_konts <> p_sakto. "cuentas de mayor diferentes de material y de documento presupuestario
******************************************************************
* THIS CODE IS THE ONE THAT LAUNCHES THE ERROR MEOUT134
******************************************************************
clear wa_exknx.
MOVE p_konts TO wa_exkn-sakto.
MOVE 'X' TO wa_exknx-sakto.
CALL METHOD im_account->set_exkn( wa_exkn ).
CALL METHOD im_account->set_exknx( wa_exknx ).
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
I've seen this link BAdI ME_PROCESS_OUT_CUST-&gt;PROCESS_HEADER is never called that describes the solution for the error, but i'm not sure if it is the solution for the problem.
Thanks on advance.
David Fúnez
Tegucigalpa, Honduras