‎2008 Feb 22 5:54 AM
hi,
can anybody tell me how to go about doing module pool programming ....... to start with ....... how to add 2 nos. using screen with 2 i\o fields for user to input 2 nos. and a output field for result.........
can u tell the coding and the way plz ..
‎2008 Feb 22 1:02 PM
Hi,
First design a screen. Transaction SE 80 -> Right Click on Programs -> Create a Program -> Choose type as Module Pool.
Within the program which will be typically named like SAPMZ<name> right click -> Create screen -> Go to Layout -> take three input/output fields and a pushbutton.
Double click on the pushbutton -> assign a function code (example 'ADD') .
Go to Element List -> enter 'ok_code' corresponding to the last entry (ok_code).
Activate.
In the TOP include define there global data types which will be of the screen field types.
e.g : DATA: number1 TYPE '<screenfield-number1>'
DATA: number2 TYPE '<screenfield-number2>'
DATA: result TYPE '<screenfield-result>'
In the PAI of the screen, write CASE: ok_code.
WHEN 'ADD'.
result = number1 + number2.
ENDCASE.
Activate the whole program.
When you click the push button the addition result should come.
Reward if Helpful.
‎2008 Feb 23 5:21 PM
Hi,
Firstly, you can go to Tcode SE80 and here create a package.
On that package name right click and select program.
Then choose program type modulepool program.
Similarly, you can create screen and then select layout and drag and drop labels and pushbuttons as per your requirements.. Then double click on th push buttons.You will see property window and there we will find FCTCODE and there type the names e.g suppose you want to
display then typy on the fctcode Display or any name as you wish.
After that save and activate it. and then close the window.
And then go back to the intial screen .
And then click Flow logic button and then uncomment the statement
module status_1000 PBO block and then doible click on status_1000
save and activate and then go back and then PAI block uncomment the statement module status_1000 and the dobule click on status_1000 and on that type the code below.
In the PAI of the screen, write CASE: sy-ucomm.
WHEN 'ADD'.
result = number1 + number2.
ENDCASE.
Activate the whole program.
When you click the push button the addition result should come.
If helpful then rewards me.
‎2008 May 02 11:45 AM
HI,
CHECK THIS LINK FOR DIALOG PROGRAMMING
http://www.savefile.com/download/750840?PHPSESSID=ab23180edc2632f75ad8b43adc1a216b
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/frameset.htm
MOdule user_command_0100 inut.
case sy-ucomm.
when 'B_ADD'
w_res = w_num1 + w_num2.
when 'B_SUB'.
w_res = w_num1 - w_num2.
endcase.
endmodule.
Reward Ponits if usefull
regards
fareedas
Edited by: Fareeda Tabassum S on May 2, 2008 4:16 PM