2012 Nov 19 6:21 PM
Hi Experts,
I got requirement that is,
At the time of Customer Save using transaction code XD01 or XD02 , a check has to be done to see if the field KNVV-KVGR5 is populated .
If KNVV-KVGR5 is Initial ,
then – Do Not Save and return to customer screen with a pop up message stating : “Please specify Customer Group5 field”.
I have USEREXIT for this, it is
: EXIT_SAPMF02D_001
and the include is ZXF04U01.
I wrote the code:
IF I_KNVV-kvgr5 is initial.
DATA: lv_id TYPE icon-id.
TABLES: icon.
SELECT SINGLE id
FROM icon
INTO lv_id
WHERE name = 'ICON_MESSAGE_WARNING'.
* ENDSELECT.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = 'Warning'
txt1 = lv_id
txt2 = 'message'
EXCEPTIONS
OTHERS = 1.
endif.
Avtually it is throwing popup message but it is saving the customer data.
My requirement is First thing is it has to throw a popup message then the customer data won't save.
please help me
2012 Nov 19 10:17 PM
Hi Vinod,
try this;
CALL FUNCTION 'POPUP_DISPLAY_MESSAGE'
EXPORTING
TITEL = 'Error'
MSGID = 'MILL_SD'
MSGTY = 'E'
MSGNO = 164
MSGV1 = 'Please specify Customer Group5 field'.
or
MESSAGE ID 'MILL_SD' TYPE 'E' NUMBER '164' DISPLAY LIKE 'I' WITH 'Please specify Customer Group5 field'.
.
2012 Nov 20 5:14 AM
Hi Kahraman,
Thanks for the reply , Actually the function module you suggested is throwing a popup message, but the problem here is if I press enter the changes are saving. But my requirement is it should throw a popup plus it does not save the customer data it should return to customer screen(XD02 or XD01).
please help me....
2012 Nov 20 5:39 AM
hi Kahraman,
If i am displaying the message as status bar message it is not displaying the message fully. Actual message I need to display is
"Please specify Print Indicator in Sales Area Data / Additional Data / Customer Group5 field"
but it is displaying "
Please specify Print Indicator in Sales Area Data ".
So is there any option to increase message length ????
2012 Nov 20 5:49 AM
2012 Nov 20 5:51 AM
Hi Vinod,
you can do like this also
MESSAGE e000(0k) WITH
'Please specify Print Indicator in Sales Area Data'(001)' Additional Data'(002)'Customer Group5 field'(003).
Thanks,
Lavanya.
2012 Nov 20 7:34 AM
HI Lavanya,
Thank you for the reply.. It is working fine. Now Functional's asking some more enhancement that is
after displaying the Error message if they press ENTER it should go to CUSTOMER Screen (XD02 & XD01). So Can I call screen here?.....
2012 Nov 20 8:11 AM
In the respective badi I mentioned, you have the option to navigate to the required screen with the error message, In customer exit you do not have such option to navigate to screen. Convince your guys to use badi.
2012 Nov 20 5:12 AM
It is better to implement like below in badi CUSTOMER_ADD_DATA in method CHECK_ALL_DATA
check E_MSGID is initial.
IF S_KNVV-kvgr5 is initial.
e_msgid = 'ZMSG'.
e_dynnr = '7000'
E_FCODE = 'XYZ'.
endif.
Read the method documentation please.
2012 Nov 20 7:37 AM
HI Kesavadas...
I didn't tried the BADI option because they are asking me to implement in UserExit's ..