Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Data in ME_PROCESS_PO_CUST - PROCESS_ACCOUNT

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos

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

7 REPLIES 7

Former Member
0 Kudos

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

uwe_schieferstein
Active Contributor
0 Kudos

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

0 Kudos

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

0 Kudos

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

0 Kudos

Hi Loni

I got the same problem but the system enforced me to hold the document.

Have you solved this issue?

Regards,

Miledys

0 Kudos

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

josef_graf
Explorer
0 Kudos

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( ).