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: 

MM : enhancement through ME_PO_PROCESS_CUST

0 Kudos
737

I have to do enhancement through Badi ME_PO_PROCESS_CUST .

while creating a PO against same vendor within same payment terms, if 3 PO has been created against same vendor with same payment terms system should allow to save it when creating the 4 PO against same vendor with same payment terms system should raise the warning message. can anyone please help.

1 ACCEPTED SOLUTION

ajitkumar
Active Contributor
0 Kudos
258

give a number in process message directly window and see

8 REPLIES 8

raymond_giuseppi
Active Contributor
0 Kudos
258

Did you try to create your implementation with SE19 executing your check in a method such as CHECK (which will always be executed before save/post) if not, start reading SE18 documentation of the BAdI.

SimoneMilesi
Active Contributor
0 Kudos
258

Hello Ravi,

which part is hard to you to achieve?
There is a nice blog with a test scenario and case here https://blogs.sap.com/2017/11/28/sap-po-error-handling-using-badi-me_process_po_cust/ you can use to start write your code.

If you face something more specific you cannot achieve, come back to us, but my first suggestion is to read that blog, implement your code and... debug, debug, debug.

It's the best chance you have to master the issue and be able to improve your skills there 🙂

0 Kudos
258

I have done with enchancement using ME_PO_PROCESS_CUST. but now problem is that while creating PO, no standard error message is coming like 'enter pur org' 'enter pur group' 'enter vendor' etc, its not telling which field is to be field. Can you please help me that what's the probelem and how to solve it??

0 Kudos
258

Which Methods have you implemented and how do you show your Custom Messages? Please show some of the Code ...

0 Kudos
258
i have used Badi ME_PO_PROCESS_CUST.

DATA : lv_header TYPE mepoheader,

       Counter TYPE I,

       lv_text TYPE string.

*START-OF-SELECTION.

clear : lv_header, counter.

lv_header = im_header->get_data( ).



refresh : IT_EKKO.

clear : wa_ekko.

select ebeln bukrs lifnr zterm

FROM ekko

INTO TABLE it_ekko

WHERE LIFNR = lv_header-LIFNR

*  AND zterm = lv_header-zterm

  AND bukrs = '3000'.

SORT it_ekko DESCENDING.



do 5 TIMES.

 read TABLE it_ekko INTO wa_ekko INDEX sy-index.

 wa_ekko1 = wa_ekko.

 APPEND wa_ekko1 TO it_ekko1.

 enddo.

delete ADJACENT DUPLICATES FROM it_ekko1 COMPARING EBELN.



clear : counter.

  LOOP AT it_ekko1 INTO wa_ekko1 where zterm eq lv_header-zterm.

    Counter = counter + 1.

  ENDLOOP.

IF counter = 3.

lv_text = 'Do You Want To Change Vendor Payment Term'.



data : p_w_conf_msg(50) TYPE C,

       p_wa_answer(50) TYPE C.



p_w_conf_msg = 'Do You Want To Change Vendor Payment Term'.

p_wa_answer = 'Please Change the ZTERMS'.

DATA : Answer TYPE Char1.



CALL FUNCTION 'POPUP_TO_CONFIRM'

  EXPORTING

   TITLEBAR                    = lv_text

*   DIAGNOSE_OBJECT             = ' '

    text_question               = p_w_conf_msg

   TEXT_BUTTON_1               = 'Yes'(002)

*   ICON_BUTTON_1               = ' '

   TEXT_BUTTON_2               = 'No'(005)

*   ICON_BUTTON_2               = ' '

   DEFAULT_BUTTON              = '1'

   DISPLAY_CANCEL_BUTTON       = ' '

*   USERDEFINED_F1_HELP         = ' '

*   START_COLUMN                = 25

*   START_ROW                   = 6

*   POPUP_TYPE                  =

*   IV_QUICKINFO_BUTTON_1       = ' '

*   IV_QUICKINFO_BUTTON_2       = ' '

 IMPORTING

   ANSWER                      = answer "p_wa_answer

* TABLES

*   PARAMETER                   =

 EXCEPTIONS

   TEXT_NOT_FOUND              = 1

   OTHERS                      = 2

          .

IF sy-subrc <> 0.

* Implement suitable error handling here

ENDIF.



IF Answer = 1.  "'TEXT_BUTTON_1'.

  LEAVE LIST-PROCESSING.

ENDIF.



ENDIF.

warning message was not coming so i used popup. but after this enhacement standard messages are not coming. can you please help me and let me know the solution.

ajitkumar
Active Contributor
0 Kudos
258

Pl check whether this has something to do with personal settings in purchase order.

personal settings > basic settings > process messages directly.

0 Kudos
258

Nothing is changed with settings.

ajitkumar
Active Contributor
0 Kudos
259

give a number in process message directly window and see