• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1863
  • Last Modified:

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.
0
TSMVijay
Asked:
TSMVijay
  • 3
1 Solution
 
theo kouwenhovenCommented:
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
 
theo kouwenhovenCommented:
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
 
theo kouwenhovenCommented:
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

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now