‎2014 Aug 05 10:34 AM
Hi guys,
I've tried to display an error message and I know that it makes all field greyed out.
Is there a way there I can validate header data and prompt the user a message?
I've searched around but no avail. I've tried coding at MV45AFZZ, MV45AFZB but its not working as intended.
Thanks for your time!.
‎2014 Aug 05 4:22 PM
Hi
You wrote " I've tried to display an error message and I know that it makes all field greyed out."
Could you please explain for which header field you want to validate and in which event (ex - Save, moving one screen to other etc) and where have you the wrote the code .
If you want to trigeer it at SAVE
You can use ' USEREXIT_SAVE_DOCUMENT_PREPARE' in program MV45AFZZ.
If want to issue a error message and then press enter to edit from the same screen, then do the following
MESSAGE W<message no>( <message id>) DISPLAY LIKE 'E' .
SET SCREEN sy-dynnr.
LEAVE SCREEN.
‎2014 Aug 05 10:56 AM
Hi Anthony,
To display error message without making input fields Gray-mode, we should use CHAIN and ENDCHAIN.
Process After Input." PAI of screen in which input fields exist
CHAIN.
FIELD <field-name> MODULE <module_name>. " (Say Validation)
ENDCHAIN.
MODULE VALIDATION.
" Validate field and display error message
ENDMODULE.
Regards
Vijay
‎2014 Aug 05 11:32 AM
‎2014 Aug 05 4:22 PM
Hi
You wrote " I've tried to display an error message and I know that it makes all field greyed out."
Could you please explain for which header field you want to validate and in which event (ex - Save, moving one screen to other etc) and where have you the wrote the code .
If you want to trigeer it at SAVE
You can use ' USEREXIT_SAVE_DOCUMENT_PREPARE' in program MV45AFZZ.
If want to issue a error message and then press enter to edit from the same screen, then do the following
MESSAGE W<message no>( <message id>) DISPLAY LIKE 'E' .
SET SCREEN sy-dynnr.
LEAVE SCREEN.
‎2014 Aug 05 4:36 PM
Hi Anthony,
try to use macro
mmpur_message 'E' 'ZW' '026' tekpo-ebelp '' '' ''.
mmpur_message 'type' class' 'number' var1 var2 var3 var4.
Best Regards,
Rafael Sá
‎2014 Aug 13 3:13 PM
‎2014 Aug 14 2:16 AM
Hi Rafael,
Sorry but it appears I can't use macro message in the exit. anyway yeah, solved the problem.
I coded the error message in userexit_save_document_prepare.
From SDN searches:
MESSAGE lv_b TYPE 'I' DISPLAY LIKE 'E'.
PERFORM folge_gleichsetzen(saplv00f).
fcode = 'ENT1'.
SET SCREEN sy-dynnr.
LEAVE SCREEN.
So far its working well.
Thanks for all the help.