‎2007 Dec 07 8:43 AM
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
‎2007 Dec 07 8:53 AM
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
‎2007 Dec 07 8:53 AM
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
‎2007 Dec 07 9:29 AM