Go to SE80, select program from drop down, provide name and press enter.
A popup will come just click yes.
Check 'Create with TOP module' and enter.
Provide a top include name and enter.
Select module pool and save.
Expand program, double click on top include and add below code.
Right click on program name, create -> screen.
Provide a screen number and enter.
Provide short description and click on layout.
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.
Move mouse cursor on layout and place the form in suitable position.
Now click on text icon, put it before any input field and enter text.
Similarly create labels for all fields.
Insert button, provide text as 'Get Data', double click, provide a name , fct code, enter and close.
Save and Activate.
Close the layout and go to program and click on flow logic.
Double click on each module and create them in main program.
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.
Right click on program, create -> transaction.
Provide transaction code as ZSAPN_MAT_MPP, provide short text and enter.
Provide program name as ZSAPN_MPP_MATERIAL, screen no as 100 and save in a local object.
Now go to t-code ZSAPN_MAT_MPP, provide a material no and click on get data button, it will get output.