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

Two fields in screen

Former Member
0 Likes
362

I need to create three input fields..That is when i give values in the two boxes,it want to multiply and display the answer in the third box,whn i click the button..

Inside the button event i have created a methos..Now how i can get the two values from the screen. into the method and mulltiply it in the method..

I dnt knw how to do.Plz can any one tell how to do this

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
339

Hi Mahesh,

if u r doing it through screen painter then use PAI event for it...

See below example code...


REPORT  ZSCREEN_ILE                             .

call screen 5000.

DATA : D1 TYPE I, D2 TYPE I,TOTAL TYPE I.
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_5000  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_5000 INPUT.

CASE SY-UCOMM.

WHEN 'TOT'. " For Total button
PERFORM MUL.
WRITE TOTAL.
WHEN 'EXIT'. " For Exit button
LEAVE PROGRAM.
ENDCASE.
ENDMODULE.                 " USER_COMMAND_5000  INPUT

*&---------------------------------------------------------------------*
*&      Form  MUL
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM MUL .
TOTAL = D1 * D2.
ENDFORM.                    " MUL

hope it will solve ur problem..

<b>Reward points if useful..</b>

Thanks & Regards

ilesh 24x7

2 REPLIES 2
Read only

Former Member
0 Likes
340

Hi Mahesh,

if u r doing it through screen painter then use PAI event for it...

See below example code...


REPORT  ZSCREEN_ILE                             .

call screen 5000.

DATA : D1 TYPE I, D2 TYPE I,TOTAL TYPE I.
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_5000  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_5000 INPUT.

CASE SY-UCOMM.

WHEN 'TOT'. " For Total button
PERFORM MUL.
WRITE TOTAL.
WHEN 'EXIT'. " For Exit button
LEAVE PROGRAM.
ENDCASE.
ENDMODULE.                 " USER_COMMAND_5000  INPUT

*&---------------------------------------------------------------------*
*&      Form  MUL
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM MUL .
TOTAL = D1 * D2.
ENDFORM.                    " MUL

hope it will solve ur problem..

<b>Reward points if useful..</b>

Thanks & Regards

ilesh 24x7

Read only

Former Member
0 Likes
339

thnks