Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

module pool

Former Member
0 Likes
808

HI gurus

can somebody provide me a detailed step by step procedure for module pool program. like i want to take some data in an internal table and display it with some modifications and calculaations.

Regards,

Neeraj

8 REPLIES 8
Read only

Former Member
0 Likes
782

hi,

1.First goto se38.

2. Select an executable program n write

tables : zstd.

data : dynnr like sy-dynnr value 0200,

controls tb type tabstrip.

then save, check n activate.

3. goto se51.

4. write the program name n the screen no. n then create.

then goto layout.

drag n drop tabstrip control. then within it again drag n drop subscreen.

then in tab1 double click n write the name as input and text as i/p parameter n the ref-field as sub.

then double click on tab2 and write the name as output and text as o/p parameter n ref-field as sub.

Then double click on tabstrip and give the name as tabstrip.

Double click on subscreen and give the name as sub.

then save , check n activate.

5. Then go back n in flow logic write after process before o/p.

Call subscreen sub including 'ur program name' dynnr.

and under process after input write...

call subscreen sub.

then uncomment user_command_0100 and double click on it then write.

case sy-ucomm.

when 'input'.

dynnr = '0200'.

tbstrip-activetab = 'input'.

when 'output'.

dynnr = '0300'.

tbstrip-activetab = 'output'.

endcase.

endmodule.

6. Then go back to initial screen and change the screen number to 0200 qand create,while creating select the subscreen radiobutton and goto layout..

then press f6 give table/field name eg any of ur table name from where u want to select ur fields from.

and click on get from dict.

then select each field n drag n drop them .take 2 push buttons one for back n the other for enter.

s,c,activate. then go back to flowlogic uncomment module_user_command_0200 n double click on it n then write..

case sy-ucomm.

when 'fetch'.

select * from ur table naem where ur field no = table-field .

endselect.

when 'enter'.

dynnr = '0300'.

tbstrip-activetab = 'output'.

select * from ur table name where condition..

endselect.

endcase.

endmodule.

s,c,activate.

7. then go back to initial screen and change the screen no to 0300 n create. while creating ,select the subscreen option n goto layout..

then press f 6 n select some more fields n drag n drop them...n create a push button as back. n exit.

s,c,a. go back...

select the flow logic then under module_user_commd_0300.

write the code as..

case sy-ucomm.

when 'back'.

dynnr = '0200'

tbstrip-activetab = 'input'.

when 'exit'.

leave the program.

endcase.

endmodule.

then s,c,a.

then goto se93.

give the TC as z.....with prefix z.

click on create give prg name-the one u have given in se38 n screen no as -0100.

then goto GUI support tab strip n select it.

Select SAP GUI for HTML.

s,c,f 8.

we will get t he output...

Hope u might have got a clear view of module pool program...if so don't forget to reward with points..

with regards,

madhuri.

Read only

0 Likes
782

hi madhuri

is controls tb type tabstrip is correct, it is saying TB is not expected. syntax error.

pl help.

regards

neeraj

Read only

0 Likes
782

U need to <b><u>award points for all the useful replies</u></b>, and also u nees to <b><u>mark it as Answered if ur problem is solved</u></b>.

Regards

Sudheer

Read only

0 Likes
782

thank you sudhir for ur concern . but let me remind u that i am awarding only for the answer best suitable to me.

I think we should do in that way only , Right......

Regards,

Neeraj

Read only

Former Member
0 Likes
782

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

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 demo_dynpro* and press F4.

You will get a list of demo module pool programs.

Regards,

Padmam.

Read only

Former Member
0 Likes
782

Hi,

pls check this code

1...................

this is a sample code with five push buttons one of which is a cancel button and i/o field..

DATA: OK_CODE LIKE SY-UCOMM,

SAVE_OK LIKE OK_CODE,

OUTPUT(8) TYPE C.

CALL SCREEN 100.

<b>MODULE USER_COMMAND_0100 INPUT.</b>

SAVE_OK = OK_CODE.

CLEAR OK_CODE.

CASE SAVE_OK.

WHEN 'BUTTON_EXIT'.

LEAVE PROGRAM.

WHEN 'BUTTON_1'.

OUTPUT = 'Button 1'(001).

WHEN 'BUTTON_2'.

OUTPUT = 'Button 2'(002).

WHEN 'BUTTON_3'.

OUTPUT = 'Button 3'(003).

WHEN 'BUTTON_4'.

OUTPUT = 'Button 4'(004).

WHEN OTHERS.

OUTPUT = SAVE_OK.

ENDCASE.

ENDMODULE.

in this..The screen flow logic is as follows...

PROCESS BEFORE OUTPUT.

MODULE INIT_SCREEN_0100.

PROCESS AFTER INPUT.

MODULE USER_COMMAND_0100...

When the user chooses a pushbutton, the PAI event is triggered...

The function code

of the pushbutton is assigned to the screen field OK_CODE, which is then passed

onto the ABAP field with the same name...

The module USER_COMMAND_0100 is

then processed....

a text symbol is assigned to the OUTPUT field

according to the button that the user chose. This is displayed in the output field on

the screen. If the user chooses Cancel, the program ends.

2...........

Check out this link

http://sap.mis.cmich.edu/sap-abap/abap09/index.htm

pls reward if it helpful

Thanks

Vana

Read only

Former Member
0 Likes
782

u can use (Notice that Example programs were underlined.)

1) <b>Table Controls</b>

Table Control with LOOP - ENDLOOP - <u>demo_dynpro_tabcont_loop</u>

PBO.

flights-lines = fill. "DESCRIBE TABLE itab LINES fill.

LOOP WITH CONTROL FLIGHTS.

READ TABLE itab INTO demo_conn INDEX flights-current_line.

ENDLOOP.

PAI.

LOOP WITH CONTROL FLIGHTS.

lines = sy-loopc.

MODIFY itab FROM demo_conn INDEX flights-current_line.

ENDLOOP.

Table Control with LOOP AT ITAB - <u>demo_dynpro_tabcont_loop_at</u>

Table Control Modificatinos

PBO.

flights-lines = fill. "DESCRIBE TABLE itab LINES fill.

LOOP AT ITAB INTO DEMO_CONN WITH CONTROL FLIGHTS.

ENDLOOP.

PAI.

LOOP AT ITAB.

MODIFY itab FROM demo_conn INDEX flights-current_line.

ENDLOOP.

2) <b>Step loops.</b>

Step Loop - <u>demo_dynpro_step_loop</u>

PBO.

LOOP.

idx = sy-stepl + line.

READ TABLE itab INTO wa INDEX idx.

ENDLOOP.

PAI.

LOOP.

lines = sy-loopc.

idx = sy-stepl + line.

MODIFY itab FROM wa INDEX idx.

ENDLOOP.

3) <b>ALV Grid(using FM Reuse_alv_List_Display)</b>

http://www.sapdevelopment.co.uk/reporting/alv/alvgrid.htm

4) <b>ALV Grid(using FM Reuse_alv_Grid_Display)</b>

http://www.sapdevelopment.co.uk/reporting/alv/alvlist.htm

5) <b>ALV Grid(Using ABAP Objects, class CL_GUI_ALV_GRID)</b>

<u>DEMO_ABAP_OBJECTS_CONTROLS

DEMO_ABAP_OBJECTS_SPLIT_SCREEN</u>

Hope this will solve ur problem..

<b><u>Dont forget to reward all the useful replies</u></b>

Sudheer

Read only

Former Member