Module Pool Program to Display Material Details

Example module pool program to display material details, module pool program using form and button

+ -
Requirement: Display material details for a material input by designing a module pool screen.

Go to SE80, select program from drop down, provide name and press enter.

Display material details using Module Pool Programming

A popup will come just click yes.

Display material details using Module Pool Programming

Check 'Create with TOP module' and enter.

Display material details using Module Pool Programming

Provide a top include name and enter.

Display material details using Module Pool Programming

Select module pool and save.

Display material details using Module Pool Programming

Expand program, double click on top include and add below code.

Right click on program name, create -> screen.

Display material details using Module Pool Programming

Provide a screen number and enter.

Display material details using Module Pool Programming

Provide short description and click on layout.

Display material details using Module Pool Programming

Module Pool layout designer will open, click on 'Dictionary/Program fields icon' (see below image), a popup will open, provide name as WA_MARA, click on 'Get from program', select all rows and enter.

Display material details using Module Pool Programming

Move mouse cursor on layout and place the form in suitable position.

Display material details using Module Pool Programming

Now click on text icon, put it before any input field and enter text.

Similarly create labels for all fields.

Display material details using Module Pool Programming

Insert button, provide text as 'Get Data', double click, provide a name , fct code, enter and close.

Save and Activate.

Display material details using Module Pool Programming

Close the layout and go to program and click on flow logic.

uncomment modules.

Display material details using Module Pool Programming

Double click on each module and create them in main program.

Display material details using Module Pool Programming

After creating two modules, go to PAI and add below code.

IF SY-UCOMM = 'GETM' .

  SELECT SINGLE * FROM MARA INTO CORRESPONDING FIELDS OF WA_MARA
    WHERE MATNR = WA_MARA-MATNR.
ENDIF.

Display material details using Module Pool Programming

Right click on program, create -> transaction.

Display material details using Module Pool Programming

Provide transaction code as ZSAPN_MAT_MPP, provide short text and enter.

Display material details using Module Pool Programming

Provide program name as ZSAPN_MPP_MATERIAL, screen no as 100 and save in a local object.

Display material details using Module Pool Programming

Now go to t-code ZSAPN_MAT_MPP, provide a material no and click on get data button, it will get output.

Display material details using Module Pool Programming


Learner Questions


No Questions by learners, be first one to ask ..!!

    Please Sign in to ask a question

    Was this lesson helpful to you? Yes No 75 People out of 77 think this lesson helpful


    Lesson Navigation

    ←Previous Chapter
    Next Lesson → String Operations and field symbols