03-30-2015 5:29 PM
Hi all,
I have a problem: in badi me_process_po_cust, method process_header I check the purchasing group.
if it is not correct, I throw an error message, but after this the fields in me22n are editable yet.
How can I lock the whole screen until the user sets the right value in field purchasing group?
Thank you in advance.
03-30-2015 9:23 PM
Use method CHECK instead, worked for me. There's a reason why not header method, but I don't remember why.
Code goes like
METHOD if_ex_me_process_po_cust~check.
.....
data: ls_header TYPE mepoheader.
CALL METHOD im_header->get_data
RECEIVING
re_data = ls_header.
lt_items = im_header->get_items( ).
IF ls_header-EKGRP = 'whatever'.
MESSAGE ID 'Zxx' TYPE 'E' NUMBER 'nnn'.
EXIT.
ENDIF.
Hope this helps.
03-31-2015 5:48 AM
Hi Rory,
please read the documentation of BADI ME_PROCESS_PO_CUST:
If you want to check fields in method PROCESS_HEADER and throw error messages, you have to use macros mmpur_metafield and mmpur_message_forced.
Regards,
Klaus
03-31-2015 11:21 AM
I've tried with the macros, but the result is the same, the field are editable yet...
03-31-2015 5:57 AM
Hi,
Please try this in your code.
include mm_messages_mac.
IF <CHECK CONDITION>
mmpur_message 'E' 'ME' '015' '' '' '' ''.
ENDIF.
It is help for you.
Regards,
Nilesh
03-31-2015 11:06 AM
03-31-2015 11:57 AM
Hi ,
Please try code in ME_PROCESS_PO_CUST~FIELDSELECTION_HEADER_REFKEYS.
data: LS_HEADER type mepoheader.
LS_HEADER = IM_HEADER->get_data( ).
if sy-tcode = 'ME21N' or sy-tcode = 'ME22N'.
loop at screen.
if screen-name = 'MEPO1222-EKGRP' .
screen-input = 0.
modify screen.
endif.
endloop.
endif.
Regards,
Nilesh
03-31-2015 12:08 PM
Hi,
Please write your logic in ME_PROCESS_PO_CUST->CHECK method. Then, I hope you will get it.
Regards,
Suresh