‎2008 Feb 22 7:26 AM
hi ,
Plz tell me how to perform mathematical operation on 2 no. using dialog program.
‎2008 Feb 22 7:31 AM
hi,
goto,
SE80 -> Select Program from drop-down list -> Specify program name starting with SAPMZ or SAPMY -> Press Enter -> Click on Yes to create object -> Create Top Include File by clicking on Continue icon in pop-up screens -> Save under a package -> Assign a request number -> MPP program with specified name is created with Top include File.
To create screen, Right click on program name -> Select Create -> Screen -> Opens Screen Description page -> Enter short description for screen -> Select screen type as NORMAL -> Click on LAYOUT pushbutton from application toolbar -> Opens Screen Painter -> Drag and drop two input fields(ip1 ,ip2 from toolbar -> Likewise, create two pushbuttons( ADD, BACK) -> Double click on each component -> Opens Attributes box -> Specify attributes for each screen component -> For pushbutton, specify FCT code( give it as ADD and DISPLY in caps) -> Save the screen -> Click on Flowlogic pushbutton from application toolbar -> Opens Flow logic editor to create event functionalities for screen components -> Decomment PAI module -> Double click on PAI module name -> Click on Yes to create PAI module object -> Opens PAI module -> Specify the following code within module-endmodule statements:
declaration in top include:
DATA : ip1,ip2,s.
PAI:
case sy-ucomm:
when 'ADD'.
S = ip1 + ip2.
LEAVE TO LIST-PROCESSING.
write : / s.
when 'BACK'.
Leave program.
encase.
hope this helps u,
regards,
arunsri
‎2008 Feb 22 7:33 AM
i want user to input 2 nos. and output to come in 3rd field .... i made this program ... but its not running .....
&----
*& Module pool ZDBPOOL2
*&
&----
*&
*&
&----
PROGRAM ZDBPOOL2.
DATA : I1 TYPE I , I2 TYPE I , O1 TYPE P .
&----
*& Module USER_COMMAND_0100 INPUT
&----
text
----
MODULE USER_COMMAND_0100 INPUT.
*AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'SUM'.
ADD I1 TO I2.
O1 = I1.
WHEN 'SUB'.
O1 = I1 + I2 .
WHEN 'MUL'.
O1 = I1 * I2 .
WHEN 'BACK'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
‎2008 Feb 22 7:42 AM
Code is Ok But do you have pus buttons for selecting the operation . when you create push button there you should have given same function codes.
Check it if function codes are correct.
Regards,
Nageswar
‎2008 Feb 22 7:47 AM
Hi,
Create the program in SE80.
follow the steps below.
1.In top-include,declare as follows
DATA: A(5),B(5),R(5).
DATA: OK_CODE TYPE SY-UCOMM.
save it.
2.Create the screen and activate the PAI module. Save it.
Click on "Layout" in application toolbar.
Take 3 input fields and text fields.(2 for taking the input
values and 1 for displaying the result)
One pushbutton name as ADD.
save and activate. click on "element list".
3.Enter OK_CODE.
click on flow logic
double click on PAI
4.Enter the below code in PAI
CASE OK_CODE.
WHEN 'ADD'.
R = A + B.
ENDCASE.
save,activate.
5.Create tcode and execute the code.
Thanks,
chandu.