2018 Oct 30 6:12 AM
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.
2018 Nov 16 10:27 AM
2018 Oct 30 8:20 AM
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.
2018 Oct 30 8:21 AM
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 🙂
2018 Nov 15 11:15 AM
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??
2018 Nov 15 10:03 PM
2018 Nov 16 5:12 AM
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.
2018 Nov 16 6:00 AM
Pl check whether this has something to do with personal settings in purchase order.
personal settings > basic settings > process messages directly.
2018 Nov 16 9:11 AM
2018 Nov 16 10:27 AM