Displaying Error Message (Without using Error Indicator Message)

Hello,

I need to display an Error Message in Display file but not using a display field's Error Indicator Option or Message files.

For Example: "File is updated" or "You are not authorized".  It should come in the last line of display file. I can do this by highlighting a field. but what I need is just to show a message when the operation is done.

Please give your suggestions.
TSMVijayAsked:
Who is Participating?
 
MurpheyApplication ConsultantCommented:
You can do the same with the RTVMSG command, you can include that from a little CL program or directly run it with a QCMDEXEC call. Personally I prefer to use a CLprogram just Message-ID as input parameter and Message text as return parameter.... if you like you can even define an extra parameter to include variable text in the message text like 'File MyFile opened' or 'user SRIRAM not authorized'.
What is also possible within your RPG program not so easy.

Regards,
Murph
0
 
MurpheyApplication ConsultantCommented:
Hi TSMVijay,

What is wrong with a message file? it's the most easy way....
but there are other posibilities. depending on the situation...
tell me (us)) more and I (we) will advise :)

Regards,
Murph
0
 
Sriram_PenumathyCommented:
One option is to use an compile time array in the program. You can store all the messages such as 'File opened','user not authorized' etc in this array. In the actual logic you can look up the array  to retrieve the corresponding text.  
0
 
MurpheyApplication ConsultantCommented:
Hi TSMVijay,

Just a question, why did you aksked for a solution without a MSGF?
it works quit the same as a RTVMSG, unless you use fixed errornumbers in your DSPF.

Regards,
Murph
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.