Application Development 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: 

Module pool program

Former Member
0 Kudos

Hi experts,

I have to work on a new project which involves module pool programs. Can you please guide me what it is and provide an example module pool program. Please reply immediately.

With Regards

Emran Ali.

5 REPLIES 5

Former Member
0 Kudos

Hi,

give demodynpro in se38.. u ll find a lot of demo dynpro programs.. that s the best way to learn module pool programming..

Regards,

Aparna

former_member150733
Contributor
0 Kudos

Please see sample standard SAP Programs in T.Code SE80.

SAPBC_GLOBAL_SFLIGHT_CREATE SFLIGHT - Create table entry

SAPBC_GLOBAL_SFLIGHT_DISPLAY SFLIGHT - Display table entry

SAPBC_GLOBAL_SFLIGHT_EDIT SFLIGHT - Change table entry

Former Member
0 Kudos

Hi,

Module pool programming is a series of screens designed for some special purpose. This is different from excutable programs which displays reports on execution. Lets take a simple scenerio where we need to create a module pool program.

A simple case can be a MM01 transaction, the transaction for creation of materials .This transaction is nothing but a series of different screens when the user need to fill vareious informations needed for creating a material . and finally these screens are linked to a main program and then the screens are handled acccordingly . I think the above scenerio is very simple to understand whats the purpose of a module pool program.

Other example can be creating an employee database , where you d't want to fill all the data in the same screen and then according to the user actions you want to perform some operations( like saving the data to the DB or changing some existing information etc. ) then you can approach for creating a transaction or module pool programs.

The basic idea is that when you want to provide many facilities to the user for interacting with the screen and if you want the data processing( saving to the DB like that ) to be according to the user action then you can approach dialog programming .

Hope the information provided helps.

Regards,

Kate

Former Member
0 Kudos

Hi emraan

Module pool is like a screen designing and doing coding same as lika a real screen in SAP screen.

For example:

Consider a ME41 Transaction, this is for creating Request for Quatation.

lets take first screen.

Go to SE80 or SE38

create one module pool program, create screen and create screen design in layout.Before you have create custom table.

Sample codings:

In flow logic two modules will be there

1.PAI(PROCESS AFTER INPUT).

PAI is input, it contains action when u giving input in o/p screen.

2.PBO (PROCESS BEFORE OUTPUT).

PBO is Output it contains actions when u executing .here u have to give PF Stauts.

PAI code:

DATA : OK_CODE TYPE SY-UCOMM,

VALUE TYPE I VALUE 0,

RFQ LIKE ZSEN_ME41-RFQ,

RFQTYPE LIKE ZSEN_ME41-RFQTYPE,

LANKEY LIKE ZSEN_ME41-LANKEY,

RFQDATE LIKE ZSEN_ME41-RFQDATE,

QDEADLINE LIKE ZSEN_ME41-QDEADLINE,

PURORG LIKE ZSEN_ME41-PURORG,

PURGRP LIKE ZSEN_ME41-PURGRP.

&----


*& Module USER_COMMAND_1000 INPUT

&----


  • text

----


MODULE USER_COMMAND_1000 INPUT.

IF OK_CODE = 'SAVE'.

IF SY-DATUM <= ZSEN_ME41-RFQDATE AND ZSEN_ME41-RFQDATE <=

ZSEN_ME41-QDEADLINE.

CALL SCREEN 1001.

ENDIF.

IF SY-DATUM > ZSEN_ME41-RFQDATE.

MESSAGE W000(00) WITH 'RFQ DATE IS PAST'.

CLEAR ZSEN_ME41-RFQDATE.

ENDIF.

IF ZSEN_ME41-RFQDATE > ZSEN_ME41-QDEADLINE.

MESSAGE W000(00) WITH 'QDEADLINE SHOULD BE GREATER THAN RFQDATE'.

CLEAR ZSEN_ME41-QDEADLINE.

CLEAR ZSEN_ME41-RFQDATE.

ENDIF.

INSERT ZSEN_ME41.

ENDIF.

CASE OK_CODE.

WHEN 'BACK'.

LEAVE SCREEN.

WHEN 'EXIT'.

LEAVE SCREEN.

ENDCASE.

ENDMODULE. " USER_COMMAND_1000 INPUT

PBO code:

MODULE STATUS_1000 OUTPUT.

SET PF-STATUS 'RFQ'.

SET TITLEBAR 'ME41'.

ZSEN_ME41-RFQTYPE = 'AN'.

ZSEN_ME41-LANKEY = 'EN'.

ZSEN_ME41-RFQDATE = SY-DATUM.

ENDMODULE. " STATUS_1000 OUTPUT

If it is useful reward the points for me.

Thanks

senthil