2016 Jul 30 12:29 PM
Hi ABAPers,
Good day!!
I have a requirement where i have to change/modify or put new PF-STATUS after system error message in a report. My problem is when ever there is a validation happens i have written this code 'Message id 'sy-msgid' number 'sy-msgno'......' , so when control reaches this statement i should get some message and in the output am getting some standard PF STATUS. So now i want to put my own PF status instead of standard one which i highlighted in the attachement.
Kindly help me out in putting own PF status , because after statement me the control is coming out of the program and i want to only modify the PF status of screen when any error display on the screen.
Please find the screenshot for the same in the attachement
Your help is greatly appreciated !!
2016 Jul 30 1:28 PM
This is when you send a message of type W or E during execution of one of these reporting events:
INITIALIZATION, START-OF-SELECTION, GET, END-OF-SELECTION, TOP-OF-PAGE, END-OF-PAGE.
Instead, do your validation during the AT SELECTION-SCREEN event.
Reference to the ABAP documentation of MESSAGE : Behavior of messages
2016 Jul 30 1:28 PM
This is when you send a message of type W or E during execution of one of these reporting events:
INITIALIZATION, START-OF-SELECTION, GET, END-OF-SELECTION, TOP-OF-PAGE, END-OF-PAGE.
Instead, do your validation during the AT SELECTION-SCREEN event.
Reference to the ABAP documentation of MESSAGE : Behavior of messages
2016 Aug 01 8:15 PM
2016 Jul 30 1:43 PM
As mentioned by Sandra Rossi move your validation to AT SELECTION-SCREEN event.
However if for some reason you need to have that message in that particular event you use you can add IMMEDIATELY addition to your SET PF-STATUS before displaying the message.
SET PF-STATUS 'YOUR_STATUS' IMMEDIATELY.
2016 Aug 01 12:57 PM
Hi Hemanth,
Check the SY-MSGTY, If it is Error then first set the PF-Status then display the message.
Regards,
Praphul
2016 Aug 01 1:52 PM
You may try to re-arrange the sequence: If error situation is detected, first SET PF-STATUS, then MESSAGE TYPE 'E'.
I think then suggestion
IMMEDIATELY will not help or change anything here, because it
"Sets the GUI status after an interactive list event for the currently displayed list."
Or is it about list-processing? (code does not hurt, btw.)
Regards
Clemens
2016 Aug 01 8:04 PM
I did the same before MSTYP is E but PF status is not set. Thats why am wondering how ever i have to try adding 'Immediately' to PF status.
Thanks for the response!!
2016 Aug 01 2:36 PM
why don't change Message type ERROR like below.
MESSAGE 'user id do not exit' TYPE 'S' DISPLAY LIKE 'E'.
Regards,
Sinagam.
2016 Aug 01 8:08 PM
its not normal message , i generic message , report is bit complex it gets data from three different systems by using FM , so am handling FM's exeptions here in the code using MSGTY,MSGID statement....
After this statement control is coming out of the program , i could not able to set PF status for error screen ..
Message was edited by: hemanth kumar
2016 Aug 01 4:30 PM
AFAIK, Statuses can only be properly set in PBO event. Your message statement is in PAI after validation. So, unless you are triggering the PBO, you cannot set a new status.
Thanks,
Juwin
2016 Aug 01 8:43 PM
Hello,
Very good question Mr. Hemanth.
I completely agree with Juwin, Title, PF status are only to be declared in PBO. Even if you declare PF status in PAI trying to do whenever there is an error and trying to over write the PBO PF status you will not be able to achieve. As the sequence for every screen is PAI PBO, PAI PBO, PAI PBO. Hope it helped you or try to paste your code here and we will be able to help more efficiently.
Thanks,
Hiran.