Application Development and Automation 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: 
Read only

Error message at VA01

Former Member
0 Likes
3,789

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!.

1 ACCEPTED SOLUTION
Read only

atul_mohanty
Active Contributor
0 Likes
2,295

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.

6 REPLIES 6
Read only

VijayaKrishnaG
Active Contributor
0 Likes
2,295

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

Read only

Lakshmipathi
Active Contributor
0 Likes
2,295

Let me know what for you were trying to trigger an error message in VA01.  You should be aware, there is one option with standard configuration, viz.Incompletion Log through which also, system will pop up error message.

G. Lakshmipathi

Read only

atul_mohanty
Active Contributor
0 Likes
2,296

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.

Read only

RJSA
Active Participant
0 Likes
2,295

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á

Read only

RJSA
Active Participant
0 Likes
2,295

Anthony,

Problem solved?


Best Regards,

Rafael Sá

Read only

Former Member
0 Likes
2,295

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.