Skip to Content

BADI not working

Hello ABAP Experts ,

I am subjected to a client requirement according to which whenever purchase orders are created with stock transfer document type (ZSTM , ZSTO are the customised types used) , Commitment item field under the ACCOUNT ASSIGNMENT Tab in me21n should be filled with value 'DUMMY'.

So i choose ME_PROCESS_PO_CUST Badi to accomplish this task.

And taking the below conditions i wrote my code :

Whenever Purchase Order type ZSTM or ZSTO is selected Item Category is automatically assigned with value 7 ( its displayed as value U but is saved as value 7 in EKPO)

So whenever EKPO-PSTYP = '7'

set EKKN-FIPOS = 'DUMMY'.

My code is as follows which i wrote under METHOD PROCESS_ACCOUNT

method IF_EX_ME_PROCESS_PO_CUST~PROCESS_ACCOUNT.

DATA: LS_ACCOUNT TYPE MEPOACCOUNTING ,

LS_ITEM TYPE REF TO IF_PURCHASE_ORDER_ITEM_MM,

PO_ITEM TYPE MEPOITEM.

BREAK : SAPABAP.

LS_ITEM = IM_ACCOUNT->GET_ITEM( ). "for getting PO line item being processed

PO_ITEM = LS_ITEM->GET_DATA( ).

LS_ACCOUNT = IM_ACCOUNT->GET_DATA( ). "for getting PO line item Account Assignment

IF PO_ITEM-PSTYP eq '7'.

LS_ACCOUNT-FIPOS = 'DUMMY'.

CALL METHOD IM_ACCOUNT->SET_DATA( LS_ACCOUNT ).

ENDIF.

Break point is also not working.

Thanks n Regards ,

Sij


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Jul 03, 2012 at 12:43 AM

    Are you using the classic BADi ME_PROCESS_PO_CUST or have you implemented it from the new Enhancement Spot ME_PROCESS_PO_CUST ?

    The classic BADI has been migrated to the new Enhancement Spot ME_PROCESS_PO_CUST.

    - Puneet

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 04, 2012 at 06:05 AM

    Hello Bruno ,

    No this the only implementation in our system. If multiple usage is not allowed in this BADI then how can i create a new one.

    Anyway i have managed the solution by implementing the same in Method PROCESS_ITEM.

    And its working , whenever the user creates a PO with type ZSTM or ZSTO Commitment Item field gets filled with DUMMY value.

    Thank you all for spending your valuable time for helping me to find the solution.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 17, 2012 at 08:21 AM

    This is because the Classical BAdi has migrated to new BADI... check the implementation of the enhancement spot and it should work for you.. 😊

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 17, 2012 at 08:58 AM

    Hello All ,

    I got the solution for this problem by writing code in Method PROCESS_ITEM instead.

    Thanks to all for your contributions.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.