Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

Screen Refresh

Former Member
0 Kudos


I created a dialog program which displays material details (one material at a time). When the user enters matnr1 (valid material) all the associated details are displayed on the screen output. The requirement is when the user enters an invalid material (matnr2) in succession then an error message needs to be displayed and the screen needs to be refreshed with the prior query details. I am not allowed to maintain a refresh button on the screen. For material validation I created a module... <i>field <field-name> module <module name></i> in PAI and wrote the logic for the field validation. I am able to display the error message but the screen still displays values from the previous run. Since the PBO even is not triggered.

My program output has table control and texts. Is there anyway I can refresh the screen output and display an error message before the PBO event is triggered (in PAI).

Any help regarding this is greatly appreciated.


Former Member
0 Kudos

If you are issuing the error message in PAI via something like "message e398(00) with 'Invalid material code entered:' matnr2." then you should not be reaching the PBO again i.e. I would expect you to be going:


on screen:
  User enters matnr1

  validate - all OK

  Fill screen details for matnr1

on screen:
  Details of matnr1 are showing
  User enters matnr2

  validate - issue "E" message... goes no further!

so yes, the matnr1 details will be on the screen but the error will highlight the problem.

If you did want to clear the screen, then in the "validate" you could set a flag like "g_error = 'X'." and issue just an "S" type message so the flow doesn't stop... this would allow you to go back into the PBO where you could test with "if g_error = 'X'. "clear all screen variables here!. clear: g_error. endif."

Or have I missed the point?


0 Kudos

Hi Jonathan,

Thanks for you reply.

That’s exactly what I am looking for..... Same thing stuck me, about displaying a warning message but the users are looking for error message.

Any more ideas regarding this....

0 Kudos

This worked for me....

I made use of CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE' in PBO. which will trigger PAI for the second time. So the first time it wont trigger the error message.. fine.. the screen fields get cleared in PBO and the second time when the PAI triggers it will tirgger an error message.

Thanks everyone......:)