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: 

Modify PF status to own PF status after system message hits in a report

Former Member
0 Kudos
1,151

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

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos
801

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

10 REPLIES 10

Sandra_Rossi
Active Contributor
0 Kudos
802

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

0 Kudos
801

Thanks for the info.

ziolkowskib
Active Contributor
0 Kudos
801

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.

Former Member
0 Kudos
801

Hi Hemanth,

Check the SY-MSGTY, If it is Error then first set the PF-Status then display the message.

Regards,

Praphul

0 Kudos
801

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

0 Kudos
801

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

0 Kudos
801

why don't change Message type ERROR like below.


MESSAGE 'user id do not exit' TYPE 'S' DISPLAY LIKE 'E'.



Regards,
Sinagam.

0 Kudos
801

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

Juwin
Active Contributor
0 Kudos
801

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

Former Member
0 Kudos
801

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.