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: 
Read only

DYNPRO deletes value after user interaction

suem
Explorer
0 Likes
1,210

Hi,

im neu in ABAP Welt and tried to write a calculator but whenever i click a button. it deletes field which i want to also see. Can You experts help me for this?

here is my code:

MODULE user_command_2000 INPUT.
   IF sy-ucomm EQ 'BACK'.
     LEAVE TO SCREEN 0.
   ELSEIF sy-ucomm EQ 'CLEAR'.
     CLEAR:
           gv_numinp1 ,
           gv_numinp2 ,
           gv_numoutp1.
   ELSEIF sy-ucomm EQ 'EXIT' OR sy-ucomm EQ 'CANC'.
     LEAVE PROGRAM.
   ELSEIF sy-ucomm EQ 'CALC'.
     IF gv_numinp1 IS INITIAL AND gv_numinp2 IS INITIAL.
       MESSAGE 'bitte' TYPE 'S' DISPLAY LIKE 'E'.
     ENDIF.
     CREATE OBJECT go_main EXPORTING iv_num1 gv_numinp1 iv_num2 gv_numinp2.
     IF gv_radplus EQ abap_true"Summe
       go_main->sum(

         IMPORTING
           ev_result =            gv_numoutp1  " RESULT
       ).

     ELSEIF gv_radmin EQ abap_true"Minus
       go_main->subtraction(
       IMPORTING
           ev_result =            gv_numoutp1  " RESULT
       ).

     ELSEIF gv_radmultip EQ abap_true"multiplication
       go_main->multiplication(
       IMPORTING
           ev_result =            gv_numoutp1  " RESULT
       ).

     ELSEIF gv_raddiv EQ abap_true"division
       go_main->division(
       IMPORTING
           ev_result =            gv_numoutp1  " RESULT
       ).
     ENDIF.

   ENDIF.
   WRITE gv_numoutp1.
 ENDMODULE.

 

and Photos:

before:

suem_1-1714998476491.png

and after click:

suem_2-1714998520272.png

BR.

 

 

Hi,

im neu in ABAP Welt and tried to write a calculator but whenever i click a button. it deletes field which i want to also see. Can You experts help me for this?

here is my code:

MODULE user_command_2000 INPUT.
   IF sy-ucomm EQ 'BACK'.
     LEAVE TO SCREEN 0.
   ELSEIF sy-ucomm EQ 'CLEAR'.
     CLEAR:
           gv_numinp1 ,
           gv_numinp2 ,
           gv_numoutp1.
   ELSEIF sy-ucomm EQ 'EXIT' OR sy-ucomm EQ 'CANC'.
     LEAVE PROGRAM.
   ELSEIF sy-ucomm EQ 'CALC'.
     IF gv_numinp1 IS INITIAL AND gv_numinp2 IS INITIAL.
       MESSAGE 'bitte' TYPE 'S' DISPLAY LIKE 'E'.
     ENDIF.
     CREATE OBJECT go_main EXPORTING iv_num1 gv_numinp1 iv_num2 gv_numinp2.
     IF gv_radplus EQ abap_true"Summe
       go_main->sum(

         IMPORTING
           ev_result =            gv_numoutp1  " RESULT
       ).

     ELSEIF gv_radmin EQ abap_true"Minus
       go_main->subtraction(
       IMPORTING
           ev_result =            gv_numoutp1  " RESULT
       ).

     ELSEIF gv_radmultip EQ abap_true"multiplication
       go_main->multiplication(
       IMPORTING
           ev_result =            gv_numoutp1  " RESULT
       ).

     ELSEIF gv_raddiv EQ abap_true"division
       go_main->division(
       IMPORTING
           ev_result =            gv_numoutp1  " RESULT
       ).
     ENDIF.

   ENDIF.
   WRITE gv_numoutp1.
 ENDMODULE.

 

and Photos:

before:

suem_1-1714998476491.png

and after click:

suem_2-1714998520272.png

BR.

 

 

2 REPLIES 2
Read only

Sandra_Rossi
Active Contributor
0 Likes
1,184

Just debug.

Read only

suem
Explorer
1,166

in debug numbers are there. there was a mistake with screen. if someone has same problem later. just control if your output field flagged is.

BR