07-02-2007 11:43 AM
hello friends
i m new in ABAP
i had designed database and now i want to enter the data through module pool so please guide me about the module pool and insert condition how could i do that
Do post friends...................
Waiting for ure precious suggestions
With Best Regards
Ruby
07-02-2007 12:56 PM
Hi,
This code is Addition and Subraction of two numbers stored in database table.
so this code will help you
**Main Program********
&----
*& Module pool ZADD *
*& *
&----
*& *
*& *
&----
PROGRAM ZADD.
TABLES ZADD.
DATA: OK_CODE LIKE SY-UCOMM.
INCLUDE ZADD_PBO.
INCLUDE ZADD_PAI.
**Main part is over***********
PROCESS BEFORE OUTPUT.
MODULE STATUS_1000.
*
PROCESS AFTER INPUT.
MODULE USER_COMMAND_1000.
----
***INCLUDE ZADD_PBO .
----
&----
*& Module STATUS_1000 OUTPUT
&----
text
----
MODULE STATUS_1000 OUTPUT.
SET PF-STATUS 'PF01'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_1000 OUTPUT
&----
*& Module USER_COMMAND_1000 INPUT
&----
text
----
MODULE USER_COMMAND_1000 INPUT.
CASE OK_CODE.
WHEN 'ADDITION'.
ZADD-ADD1 = ZADD-NUMBER1 + ZADD-NUMBER2.
WHEN 'SUBTRACT'.
ZADD-SUB = ZADD-NUMBER1 - ZADD-NUMBER2.
WHEN 'SAVE'.
INSERT ZADD.
ENDCASE.
ENDMODULE. " USER_COMMAND_1000 INPUT
IF HELPFULL REWARD
07-02-2007 11:46 AM
Hi,
screen programming is nothing but module pool programming,
please check out the below links it might help you
http://help.sap.com/saphelp_nw04/helpdata/en/e4/2adbef449911d1949c0000e8353423/frameset.htm
http://sap.mis.cmich.edu/sap-abap/abap09/sld011.htm
http://www.thespot4sap.com/articles/SAP_Design_Introduction.asp
http://help.sap.com/saphelp_46c/helpdata/en/fc/eb2d67358411d1829f0000e829fbfe/frameset.htm
HERE IS THE SAMPLE PROGRAM
PROGRAM DEMO_DYNPRO_INPUT_OUTPUT.
DATA: INPUT TYPE I,
OUTPUT TYPE I,
RADIO1, RADIO2, RADIO3, BOX1, BOX2, BOX3, EXIT.
CALL SCREEN 100.
MODULE INIT_SCREEN_100 OUTPUT.
CLEAR INPUT.
RADIO1 = 'X'.
CLEAR: RADIO2, RADIO3.
ENDMODULE.
MODULE USER_COMMAND_0100 INPUT.
OUTPUT = INPUT.
BOX1 = RADIO1.
BOX2 = RADIO2.
BOX3 = RADIO3.
IF EXIT NE SPACE.
LEAVE PROGRAM.
ENDIF.
ENDMODULE.
FOR MORE DETAILS PLEASE FOLLOW THE LINK BELOW
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dba9e735c111d1829f0000e829fbfe/content.htm
**********please reward points if the information is helpful to you***********
07-02-2007 11:47 AM
please suggest me how to continue and the steps that will help me to save data in database through Module pool using text boxes
Hope u got my point
07-02-2007 11:47 AM
Hi Ruby,
There is lot of help available on SDN, please search.
1. In your case through SE51 create Screen to Enter a data, or in program write a statemetn call screen <srno> and double click , it will take you to SE51.
See help.sap.com to design a screen.
2. Go to flow logic of it and you wll find PBO and PAI modules. create your own module or double click on them
3. Above step will take you to your program or report. Write your code to insert data selected on screen to yur database.
Reward if useful!
07-02-2007 11:51 AM
These steps i know i m using se80 and had make a progarm in that and set the PBO
actually i want wat steps or internal table or u can say code in PAI which will help me in inserting the data
i had made a module pool program but how to go further
Please provide me the link if u know that will help me out
step by step
With Best Regards
ruby
07-02-2007 12:29 PM
07-02-2007 12:05 PM
07-02-2007 12:18 PM
Create Table Control screen in Module Pool
· Step 1 (Create new structure for table control)
· Step 1 (Create new structure for table control)
· Step 2 (Create Program)
Tables: ZTC_EKKO.
screen 100.
data: ok_code type sy-ucomm.
data: it_ekko type standard
table of ZTC_EKKO initial size 0,
wa_ekko type ZTC_EKKO.
data: ok_code type sy-ucomm.
Press Save and Activate
· Step 4 (Create screen)
· Step 5 (Create table control)
· Step 6 (Populate table control )
· Step 7 (Create flow control )
Within the flow logic of screen 100 and create two modules, one to select the data from the database and the other to move the selected fields into the table control. Also insert the two loop statements to populate and retrieve the lines of the table control.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
module data_retrieval.
loop at it_ekko into wa_ekko with control TC100.
module populate_screen.
endloop.
*
PROCESS AFTER INPUT.
loop at it_ekko.
endloop.
MODULE USER_COMMAND_0100.
Double click the module data_retrieval to create and click yes to get past the popup. Ensure that a new include is created to hold all the PBO modules (default). Press enter.
Select 10 rows of data from the EKKO table and load into the internal table it_ekko. Go back to the flow logic to load this data into the Table Control.
*----
*
***INCLUDE MZ_TCONTROL_DATA_RETRIEVALO01 .
*----
*
*&----
*
*& Module data_retrieval OUTPUT
*&----
*
text
*----
*
MODULE data_retrieval OUTPUT.
select data from ekko table
SELECT ebeln bukrs bstyp bsart
bsakz loekz statu aedat
UP TO 10 ROWS
FROM ekko
INTO CORRESPONDING FIELDS OF TABLE it_ekko.
ENDMODULE. " data_retrieval OUTPUT
Double click the module populate_screen to create. Now move the values in this loop from the wa_ekko into the Table Control with the move-corresponding statement.
MODULE populate_screen OUTPUT.
DATA: ld_line TYPE i.
* Set which line of table is a top of displayed table control
IF sy-stepl = 1.
tc100-lines =
tc100-top_line + sy-loopc - 1.
ENDIF.
* move fields from work area to scrren fields
MOVE-CORRESPONDING wa_ekko TO ztc_ekko.
ENDMODULE. "
populate_screen OUTPUT
· Step 8 (Create transaction )
· Step 9 (Execute transaction )
please see the link for screen shots of the dailog module
http://www.sapdevelopment.co.uk/dialog/tabcontrol/tc_basic.htm
reward points if it is usefull ....
Girish
07-02-2007 12:56 PM
Hi,
This code is Addition and Subraction of two numbers stored in database table.
so this code will help you
**Main Program********
&----
*& Module pool ZADD *
*& *
&----
*& *
*& *
&----
PROGRAM ZADD.
TABLES ZADD.
DATA: OK_CODE LIKE SY-UCOMM.
INCLUDE ZADD_PBO.
INCLUDE ZADD_PAI.
**Main part is over***********
PROCESS BEFORE OUTPUT.
MODULE STATUS_1000.
*
PROCESS AFTER INPUT.
MODULE USER_COMMAND_1000.
----
***INCLUDE ZADD_PBO .
----
&----
*& Module STATUS_1000 OUTPUT
&----
text
----
MODULE STATUS_1000 OUTPUT.
SET PF-STATUS 'PF01'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_1000 OUTPUT
&----
*& Module USER_COMMAND_1000 INPUT
&----
text
----
MODULE USER_COMMAND_1000 INPUT.
CASE OK_CODE.
WHEN 'ADDITION'.
ZADD-ADD1 = ZADD-NUMBER1 + ZADD-NUMBER2.
WHEN 'SUBTRACT'.
ZADD-SUB = ZADD-NUMBER1 - ZADD-NUMBER2.
WHEN 'SAVE'.
INSERT ZADD.
ENDCASE.
ENDMODULE. " USER_COMMAND_1000 INPUT
IF HELPFULL REWARD