Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Dynpro field updating in PAI before executing message of type E command

Hi there.

I am coping a couple of days with problem how to update or refresh dynpro fields with new values in PAI event just before executing message of type e command.

To demonstrate my problem I have simple dynpro with two char fields (one for entering values, other for displaying only), status GUI with two buttons defined and abap program:

REPORT zsl_x .

  ok_code TYPE sy-ucomm,

  inp = 'ggg'.
  txt = 'fff'.
  SET SCREEN '1100'.

*&      Module  STATUS_1100  OUTPUT
*       text
MODULE status_1100 OUTPUT.
  SET PF-STATUS '1100'.
  SET TITLEBAR '1100'.

ENDMODULE.                 " STATUS_1100  OUTPUT
*&      Module  USER_COMMAND_1100  INPUT
*       text
MODULE user_command_1100 INPUT.
    ok_ucode TYPE sy-ucomm.
  MOVE ok_code TO ok_ucode.
  CLEAR ok_code.
  SET SCREEN 1100.
  CASE ok_ucode.
    WHEN 'BUT1'.
      inp = 'but1'.
      txt = 'Button ONE pressed'.
    WHEN 'BUT2'.
      inp = 'but2'.
      txt = 'Button TWO pressed'.
      MESSAGE e001(00) with 'Error!'.
      SET SCREEN 0.
ENDMODULE.                 " USER_COMMAND_1100  INPUT

First when running the program I press button1 (BUT1). The fields inp and txt are filled with apropriate values and dynpro displays them.

Then I press button2 (BUT2) which has defined command in PAI that should fill dynpro fields with apropriate values, then execute message command.

But the fields of dynpro are refreshed on the screen only after pressing Enter (i.e. executing GOON).

My question is if it is possible to force SAP somehow to refres dynpro fields right before displaying of error message. I other words I need the correct field values to be displayed on the screen when user sees the error message.

Not what you were looking for? View more on this topic or Ask a question