11-01-2007 8:45 AM
Hi
Can any one give me brief idea about Module pool reporting
Regards
Sandhya
SAP-ABAP Consultant
11-01-2007 8:50 AM
Hi
Module pool programs are based on screen processing.They have PBO(process before output) and PAI(process after input modules. where u code for the respective processes of settin menu in PBO and handling user actions in PAI.
For more info refer the below link:
<u>http://help.sap.com/saphelp_nw04/helpdata/en/10/e7dbde82ba11d295a40000e8353423/content.htm</u>
11-01-2007 8:48 AM
check these links
http://www.allsaplinks.com/dialog_programming.html
http://www.sap-img.com/abap.htm
http://sap.ittoolbox.com/code/archives.asp?i=10&t=450&a=t
http://www.sapdevelopment.co.uk/dialog/dialoghome.htm
check this link:
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCDWBTUT/BCDWBTUT.pdf
http://help.sap.com/saphelp_40b/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/applet.htm
Have a look at these good links-
http://www.allsaplinks.com/dialog_programming.html
http://sap.mis.cmich.edu/sap-abap/abap09/
http://www.sapdevelopment.co.uk/dialog/dialoghome.htm
http://help.sap.com/saphelp_webas630/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/content.htm
http://sap.mis.cmich.edu/abap-00/
http://www.allsaplinks.com/files/using_table_in_screen.pdf
http://help.sap.com/saphelp_46c/helpdata/en/08/bef2dadb5311d1ad10080009b0fb56/content.htm
http://www.sapgenie.com/links/abap.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c9/5472fc787f11d194c90000e8353423/frameset.htm
http://www.sapdevelopment.co.uk/dialog/dialoghome.htm
http://www.sapgenie.com/abap/example_code.htm
http://help.sap.com/saphelp_47x200/helpdata/en/52/670ba2439b11d1896f0000e8322d00/frameset.htm
http://www.allsaplinks.com/dialog_programming.html
http://www.sapbrain.com/TUTORIALS/default.html
http://www.sappoint.com/abap/spmp.pdf
http://www.sap-img.com/abap.htm
http://sap.ittoolbox.com/code/archives.asp?i=10&t=450&a=t
http://www.sapdevelopment.co.uk/dialog/dialoghome.htm
http://www.sapdevelopment.co.uk/dialog/dialoghome.htm
http://www.sappoint.com/faq/faqdiapr.pdf
http://www.allsaplinks.com/dialog_programming.html
http://www.sapgenie.com/abap/example_code.htm
http://help.sap.com/saphelp_46c/helpdata/en/08/bef2dadb5311d1ad10080009b0fb56/content.htm
http://www.sapgenie.com/links/abap.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c9/5472fc787f11d194c90000e8353423/frameset.htm
http://www.sapdevelopment.co.uk/dialog/dialoghome.htm
Screen Painter
http://help.sap.com/saphelp_47x200/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm
Menu Painter
http://help.sap.com/saphelp_nw04/helpdata/en/d1/801ce8454211d189710000e8322d00/frameset.htm
For Table Control Creation
1) Screen tables
A table can be created in transaction. These tables, when designed on the screen are called as SCREEN TABLES.
These are of two types.
Table Controls and Step loops
These tables are treated as Loops.
2)Features of Table Controls
Data is displayed in the form of table.
Table control gives user the feeling of an actual table.
You can scroll through the table vertically as well as horizontally.
You can select rows and columns.
You can resize the with of columns.
You can have separator lines between rows and columns.
Automatic resizing of the table when the user resizes the window.
You can update information in the table control and it can be updated in the database table by writing code for it.
3)Steps for creating table control
Declaration of table control in module pool program.
Designing of table controls on the screen.
Passing data to table control in flow logic.
4)Declaration of TC in MPP
syntax:
controls <name of table control> type tableview using screen <escreen no.f>.
5)Designing Table control on screen
Click on Table in Control bar and place it on the screen. You can adjust the length and width of the Table Control.
Name the table control.(same name as given in data declaration).
From dictionary object OR from program fields select the fields and place them in the table control
6)Passing data to table control
Usually transfer of data from program to screen is automatic.
In case of TC, you need to explicitly transfer the data to table control.
ABAP/4 provides Loop statement, which is associated with flow logic to transfer the data.
7)Passing of data contd.
PBO.
Loop at <name of internal table> with control <name of table control> cursor <scroll variable>.
modulecc.
Endloop.
PAI.
Loop at < name of internal table>.Endloop.
8)Scroll variables
Top_line : the row of table where the screen display starts.
Current_line : the row currently being processed inside a loop.
9)Transfer of data from prg to TC.
With eLoop at cf statement, the first row is placed in the header of internal table.
If any module is specified between Loop and End loop, it will be executed. In this module, generally we will be assigning this internal table fields to table control screen fields.
The row in internal table is transferred to the TC as stated in the eLoop atc..f statement.
The system encounters the eEndloopf statement and control is passed back to the next line of internal table.
In the same way all the records of the internal table are passed to the TC.
check this example demo_dynpro_value_select
this one will validate the input, and push button also there..
11-01-2007 8:50 AM
Hi
Module pool programs are based on screen processing.They have PBO(process before output) and PAI(process after input modules. where u code for the respective processes of settin menu in PBO and handling user actions in PAI.
For more info refer the below link:
<u>http://help.sap.com/saphelp_nw04/helpdata/en/10/e7dbde82ba11d295a40000e8353423/content.htm</u>
11-01-2007 8:56 AM
Hi
Check the below link:
http://wiki.ittoolbox.com/index.php/FAQ:What_is_module_pool_program_in_abap%3F
http://help.sap.com/saphelp_46c/helpdata/en/35/26b1aaafab52b9e10000009b38f974/content.htm
http://sap.mis.cmich.edu/sap-abap/abap09/sld011.htm
http://sap.mis.cmich.edu/sap-abap/abap09/index.htm
http://www.geocities.com/ZSAPcHAT
http://www.allsaplinks.com/files/using_table_in_screen.pdf
http://help.sap.com/saphelp_webas630/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/content.htm
http://www.sapdevelopment.co.uk/dialog/dialoghome.htm
http://help.sap.com/saphelp_46c/helpdata/en/08/bef2dadb5311d1ad10080009b0fb56/content.htm
http://www.sapgenie.com/links/abap.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c9/5472fc787f11d194c90000e8353423/frameset.htm
You can also check the transaction ABAPDOCU which gives you lot of sample programs.
Also you can see the below examples...
Go to se38 and give demodynpro and press F4.
YOu will get a list of demo module pool programs.
One more T-Code is ABAPDOCU.
YOu can find more examples there.
See the prgrams:
DEMO_DYNPRO_TABLE_CONTROL_1 Table Control with LOOP Statement
DEMO_DYNPRO_TABLE_CONTROL_2 Table Control with LOOP AT ITAB
http://www.geocities.com/ZSAPcHAT
http://www.allsaplinks.com/files/using_table_in_screen.pdf
Try like this
parameters :
table1(30) type c,
input(30) type c.
data w_flag type i.
at selection-screen output.
if w_flag eq 1.
clear w_flag.
loop at screen.
if screen-name = 'INPUT'.
%_INPUT_%_APP_%-TEXT = TABLE1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
at selection-screen.
w_flag = 1.
start-of-selection.
write input.
Use GET PF-STATUS to Gets the current GUI status.
Syntax
GET PF-STATUS <f> [PROGRAM <prog>] [EXCLUDING <itab>].
Returns the name of the current GUI status (the same as SY-PFKEY) into the variable <f>. The PROGRAM addition writes the name of the ABAP program to which the status belongs into the variable <prog>. The EXCLUDING addition returns a list of all currently inactive function codes into the internal table <itab>.
Then use SET PF-STATUS Sets the GUI status
Syntax
SET PF-STATUS <stat> [EXCLUDING <f>|<itab>]
[IMMEDIATELY] [OF PROGRAM <prog>].
Sets the GUI status <stat> for the subsequent screens. The EXCLUDING addition allows you to deactivate functions dynamically. The IMMEDIATELY addition sets the GUI status of the list currently displayed. The OF PROGRAM addition allows you to use a GUI status from another program.
Here you can use the Excluding option to exclude the ICONS
Sample coding
&----
*& Include MZ_TABLEO01 *
&----
&----
*& Module STATUS_0100 OUTPUT
&----
text
----
MODULE status_0100 OUTPUT.
SET PF-STATUS 'MYSTATUS'.
SET TITLEBAR 'TITLE-001'.
ENDMODULE. " STATUS_0100 OUTPUT
&----
*& Module POPULATE_IT OUTPUT
&----
text
----
MODULE populate_it OUTPUT.
IF ok_code NE 'ADD' AND
ok_code NE 'DEL'.
IF flag NE 'X'.
SELECT * FROM ztest_so INTO TABLE it_populate.
flag = 'X'.
ENDIF.
ENDIF.
ENDMODULE. " POPULATE_IT OUTPUT
&----
*& Module set_lines OUTPUT
&----
text
----
MODULE set_lines OUTPUT.
DESCRIBE TABLE it_populate LINES sy-tfill.
so_tbl_ctrl-lines = sy-tfill.
ENDMODULE. " set_lines OUTPUT
&----
*& Module move_values_to_tbl_ctrl OUTPUT
&----
text
----
MODULE move_values_to_tbl_ctrl OUTPUT.
MOVE : it_populate-vbeln TO ztest_so-vbeln,
it_populate-bukrs TO ztest_so-bukrs,
it_populate-kunnr TO ztest_so-kunnr,
it_populate-erdat TO ztest_so-erdat.
ENDMODULE. " move_values_to_tbl_ctrl OUTPUT
&----
*& Module set_select_status OUTPUT
&----
text
----
MODULE set_select_status OUTPUT.
READ TABLE it_selected WITH KEY vbeln = it_populate-vbeln.
IF sy-subrc EQ 0.
line_sel_col = 'X'.
ELSE.
line_sel_col = space.
ENDIF.
ENDMODULE. " set_select_status OUTPUT
&----
*& Module clear_okcode OUTPUT
&----
text
----
module clear_okcode output.
CLEAR OK_CODE.
endmodule. " clear_okcode OUTPUT
and in PAI
&----
*& Include MZ_TABLEI01 *
&----
&----
*& Module USER_COMMAND_0100 INPUT
&----
text
----
module USER_COMMAND_0100 input.
case ok_code.
when 'BACK' or 'CANC' or 'EXIT'.
leave to screen 0.
when 'SELALL'.
clear IT_selected.
refresh IT_selected.
loop at IT_POPULATE.
move-corresponding IT_POPULATE to IT_selected.
append IT_selected.
endloop.
when 'DESELALL'.
clear IT_selected.
refresh IT_selected.
when 'SAVE'.
LOOP AT IT_SELECTED.
MODIFY ZTEST_SO FROM IT_SELECTED.
ENDLOOP.
LOOP AT IT_DELETED.
DELETE FROM ZTEST_SO WHERE VBELN = IT_DELETED-VBELN.
ENDLOOP.
commit work.
when 'DEL'.
LOOP AT IT_SELECTED.
MOVE-CORRESPONDING IT_SELECTED
TO
IT_DELETED.
APPEND IT_DELETED.
Also delete it from T_SO.
DELETE IT_POPULATE WHERE VBELN = IT_SELECTED-VBELN.
ENDLOOP.
CLEAR IT_SELECTED.
REFRESH IT_SELECTED.
endcase.
endmodule. " USER_COMMAND_0100 INPUT
&----
*& Module get_selected_so INPUT
&----
text
----
module get_selected_so input.
If ok_code ne 'SELALL'.
IF line_sel_col EQ 'X'.
Read table IT_selected with key vbeln = IT_POPULATE-vbeln.
If sy-subrc ne 0.
MOVE-CORRESPONDING ztest_so TO IT_selected.
Append IT_selected.
Else.
MOVE-CORRESPONDING ztest_so TO IT_selected.
Modify IT_selected index sy-tabix.
Endif.
Else.
Read table IT_selected with key vbeln = IT_POPULATE-VBELN.
If sy-subrc eq 0.
Delete IT_selected where VBELN = IT_POPULATE-VBELN.
Endif.
Endif.
ENDIF.
endmodule. " get_selected_so INPUT
check these links, it may be helpful to u.
this link contains information about :
1)Table Controls in ABAP Programs
2)Looping Through an Internal Table
3)Table Controls: Examples with Scrolling
http://help.sap.com/saphelp_47x200/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/frameset.htm
process before output.
*&spwizard: pbo flow logic for tablecontrol 'MY_TAB'
module my_tab_change_tc_attr.
*&spwizard: module MY_TAB_change_col_attr.
loop at it_item
into wa_item
with control my_tab
cursor my_tab-current_line.
module my_tab_get_lines.
*&spwizard: module MY_TAB_change_field_attr
endloop.
module status_0100.
module set_curson.
module get_date.
module ok_code.
process after input.
*&spwizard: pai flow logic for tablecontrol 'MY_TAB'
loop at it_item.
chain.
field wa_item-zeile.
field wa_item-matnr.
field wa_item-maktx.
field wa_item-meins.
field wa_item-menge.
field wa_item-rflag.
module my_tab_modify on chain-request.
endchain.
endloop.
module my_tab_user_command.
*&spwizard: module MY_TAB_change_tc_attr.
*&spwizard: module MY_TAB_change_col_attr.
module get_vendor_name.
module user_command_0100.
For second screen
PROCESS BEFORE OUTPUT.
*&spwizard: pbo flow logic for tablecontrol 'CON_TAB'
module CON_TAB_change_tc_attr.
*&spwizard: module CON_TAB_change_col_attr.
loop at IT_DB_ITEM
into WA_DB_ITEM
with control CON_TAB
cursor CON_TAB-current_line.
module CON_TAB_get_lines.
*&spwizard: module CON_TAB_change_field_attr
endloop.
MODULE STATUS_0110.
*
PROCESS AFTER INPUT.
*&spwizard: pai flow logic for tablecontrol 'CON_TAB'
loop at IT_DB_ITEM.
chain.
field WA_DB_ITEM-ZEILE.
field WA_DB_ITEM-MATNR.
field WA_DB_ITEM-MAKTX.
field WA_DB_ITEM-MEINS.
field WA_DB_ITEM-MENGE.
field WA_DB_ITEM-RFLAG.
endchain.
endloop.
module CON_TAB_user_command.
*&spwizard: module CON_TAB_change_tc_attr.
*&spwizard: module CON_TAB_change_col_attr.
MODULE USER_COMMAND_0110.
Regards
Pavan