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

Need help in Module pool

Former Member
0 Likes
862

Hi Friends,

Can anyone give me the idea for creating module pool using 3 to 4 database tables.

7 REPLIES 7
Read only

gopi_narendra
Active Contributor
0 Likes
736

transaction ABAPDOCU gives u good examples on module pool programming

Regards

- Gopi

Read only

Former Member
0 Likes
736

hi..

Module pool program is nothing but all the programs related to screens.

Try out these steps..

1. go to se80(object navigator).

2. you can create a program there and then create a transaction code for that module pool program by right clicking on the program name.

3.now create a screen.

4.go to the layout.

5. click on the icon " dictionary and program fields" or instead press F6.

6.you will get a screen "screen painter : dict/ program fields".

7.enter the table name eg. mara and click on the "get from dict" tab.

8. you will get all the fields in the table.

9. select the fields you want.

10. now place this in your layout.

hope this helps you.

Read only

Former Member
0 Likes
736

a module pool program can be ceated using <u><i><b>se 80 - object avigator.</b></i></u>

select program in the drop-down box..

enter a program name and press enter key...

right click on the program name (object name)

save the object in ur own package...

u can also create include callled TOPinclude- to globalise all the data used in the program...

choose create ---> choose SCREENS ..

goto layout and set the layout of the screen...

use screen PBO - Process before output modules...

(PBO occurs before user interaction)

and PAI - Process after input modules for module pool programming..

(PAI occurs after user interaction)

double click on modules..

declare structures for using different internal tables and work areas for different database tables .

let us have a a structure called struct_tables

having fields from VBAK and KNA1 such as NAME1, STRAS, ORT01, PSTLZ,

TELF1 BY INNER JOINING VBAK AND KNA1 TABLES BASED UPON KUNNR AS KEY FIELD AND HAVING SALES DOCUMENT NUMBER 'VBELN' AS INPUT BY THE USER .

statement :

SELECT NAME1

STRAS

ORT01

PSTLZ

TELF1

VBELN

KUNNR

FROM VBAK INNER JOIN KNA1 ON

VBAKKUNNR = KNA1KUNNR .

and then u can also write the sselected fields in a table control wizard...

thus u can perform module pool programming using 3-4 database tables.

Read only

Former Member
0 Likes
736

Hi rangith;

create a moduole pool program using se38.

goto to the screen painter se51 and create screen for the same program .

after creating a screen go to the layout and PRESS F6 OR CLICK ON THE ICON (PROGRAM OR DICTIONARY ATTRIBUTES ). If u want to add the fields from the database table , write the transparent table name and click get from dictionary.

If u have created a structure in the program and created an internal table for that structure u need field , write an internal table and click get from the program

with regards.

prince elvis

Read only

Former Member
0 Likes
736

Thanks for your kind response. If i have to take data from BSEG and BKPF tables then what should be done. Because we cannot create a structure using BSEG and BKPF.

Read only

Former Member
0 Likes
736

Hi Ranjith,

In ur case u can try developing a structure of the fields u want and declare a internal table and work area for the structure and now u can retrive data from BSEG or the other table u mentioned..i have attached a simple data retrival code from bseg table u can change the structure and query to get desired result..

TYPES : begin of types,

bukrs type bseg-bukrs,

belnr type bseg-belnr,

GJAHR type bseg-gjahr,

BUZEI type bseg-buzei,

end of types.

data : it type table of types,

wa type types.

select

bukrs belnr gjahr

from bseg

into table it

where gjahr = '2003' .

if sy-subrc eq 0.

loop at it into wa.

write : / wa-bukrs , wa-belnr , wa-gjahr .

endloop.

endif.

hope it would have resolved ur issue..

regards,

Rajkumar.G