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.
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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 .

DATA:
  ok_code TYPE sy-ucomm,
  inp(10),
  txt(30).

START-OF-SELECTION.
  inp = 'ggg'.
  txt = 'fff'.
  SET SCREEN '1100'.
END-OF-SELECTION.


*&---------------------------------------------------------------------*
*&      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.
  DATA:
    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!'.
    WHEN 'BACK' OR 'EXIT' OR 'CANC'.
      SET SCREEN 0.
      LEAVE SCREEN.
  ENDCASE.
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.

2 REPLIES 2

former_member195698
Active Contributor
0 Kudos

You can try using the FM DYNP_VALUES_UPDATE to update the field with values before raising the error message

regards,

abhishek

reward points if useful

Former Member
0 Kudos

Hi the values will get refreshed once MODULE status_1100 OUTPUT executes. But before that only you are giving error message. That's why screen is not getting refreshed.

That is not possible to refresh values before PBO...