01-01-2008 12:11 PM
Hi Gurus,
I want want to restrict some GL account in account asignment PO . There BADI: ME_PROCESS_PO_CUST and interface PROCESS_ACCOUNT i want put error message on some GL accounts . How do i get GL number in this BADI. Actualy i am new in this . kindly provide some code to get data in this BADI.
Thanks in Advance
Jitendra Singh
01-01-2008 10:14 PM
Hello Jitendra
The method PROCESS_ACCOUNT will give you the accounting data. There you can set the accounting invalid depending on the account number.
method IF_EX_ME_PROCESS_PO_CUST~PROCESS_ACCOUNT.
" define local data
data:
ls_detail TYPE MEPOACCOUNTING.
ls_detail = im_account->get_data( ). " Note: function method call
CASE ls_detail-sakto.
WHEN '...' OR
'...' .
im_account->invalidate( ). " set account invalid -> accounting no possible
WHEN others.
ENDCASE.
endmethod.
Regards
Uwe
01-01-2008 2:34 PM
Jitendra,
As you had mentioned, In the Interface IF_EX_ME_PROCESS_PO_CUST, There is a Method Process account which has a parameter IM_ACCOUNT.
That parameter will have all the accounting information.
So when you implement your BADI, ou can place your code and validate the GL accounts from this parameter.
The Parameter IM_ACCOUNT is referred to IF_PURCHASE_ORDER_ACCOUNT_MM.
If you peek into IF_PURCHASE_ORDER_ACCOUNT_MM, you will have an idea.
le'me know if you need any more information.
Vinodh Balakrishnan
01-01-2008 10:14 PM
Hello Jitendra
The method PROCESS_ACCOUNT will give you the accounting data. There you can set the accounting invalid depending on the account number.
method IF_EX_ME_PROCESS_PO_CUST~PROCESS_ACCOUNT.
" define local data
data:
ls_detail TYPE MEPOACCOUNTING.
ls_detail = im_account->get_data( ). " Note: function method call
CASE ls_detail-sakto.
WHEN '...' OR
'...' .
im_account->invalidate( ). " set account invalid -> accounting no possible
WHEN others.
ENDCASE.
endmethod.
Regards
Uwe
04-14-2009 5:18 PM
Hi Uwe Schieferstein,
I know this is a very old trend, but stil this is exactly my problem too.
The requirement is to make the Earmarked Funds mandatory conditionally i.e. for a particular Commitment Item. I am using the following BADI ME_PROCESS_PO_CUST. In that method PROCESS_ACCOUNT is used.
I am able to generate the error to make the user enter the Earmarked Funds.
It is also displayed as error in red in the CHECK functionality also.
But the issue is that, the user is able to save the document in spite of the error( not enforcing the HOLD functionality as in the normal error message).
Am I missing something?
Gowri
10-02-2009 8:03 PM
Hi Gowri,
I have the same problem as yours: the user is able to save the document in spite of the error. Were you able to resolve it? Can you share your solution?
thanks
Loni
02-10-2010 8:57 PM
Hi Loni
I got the same problem but the system enforced me to hold the document.
Have you solved this issue?
Regards,
Miledys
02-24-2010 2:28 PM
Hi,
I found a solution, just have to manage badi ME_HOLD_PO. Make ch_allowed go blank when you find an error at any of the structures available like bekpo.
Regards,
Miledys
02-10-2011 2:16 PM
No big surprise as the method invalidate in class cl_po_accounting_handle_mm is empty.
I used the invalidate method of the po_item instead and it works quite fine:
DATA: lv_po_item TYPE REF TO if_purchase_order_item_mm.
CALL METHOD im_account->get_item
RECEIVING
re_item = lv_po_item.
.
.
.
CALL METHOD lv_po_item->invalidate( ).