0% found this document useful (0 votes)
5 views

Mpp Table

The document outlines the steps to create a module pool program in SAP for displaying sales order details. It includes creating a structure and table, designing a screen with buttons, and fetching data from the vbak and vbap tables based on user input. The provided code snippet demonstrates the implementation of the program logic and user command handling.

Uploaded by

Nikhil Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Mpp Table

The document outlines the steps to create a module pool program in SAP for displaying sales order details. It includes creating a structure and table, designing a screen with buttons, and fetching data from the vbak and vbap tables based on user input. The provided code snippet demonstrates the implementation of the program logic and user command handling.

Uploaded by

Nikhil Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Program: Display sales order details

Steps:

Step 1: Goto SE80 and create modulepool program

Step 2: Create Structure and table

Step 3: Create screen and add buttons

Step 4: In layout, create fields

Step 5: Fetch data from vbak and vbap tables and display it based on user input.

PROGRAM SAPMZSD_OUT_TABLE
DATA: ok_code TYPE sy-ucomm.
CONTROLS tbc TYPE TABLEVIEW USING SCREEN '0480'.
TYPES : BEGIN OF lty_out,
vbeln TYPE vbak-vbeln,
vkorg TYPE vbak-vkorg,
posnr TYPE vbap-posnr,
matnr TYPE vbap-matnr,
kwmeng TYPE vbap-kwmeng,
netpr TYPE vbap-netpr,
END OF lty_out.

DATA : gt_out TYPE STANDARD TABLE OF lty_out,


gs_out TYPE lty_out.
*&---------------------------------------------------------------------*
*& Module STATUS_0480 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0480 OUTPUT.
SET PF-STATUS 'ZPF_STATUS'.
SET TITLEBAR 'ZTITLE'.

ENDMODULE. " STATUS_0480 OUTPUT


*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0480 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0480 INPUT.
CASE ok_code.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'DIS'.
DATA :gv_erdat TYPE vbak-erdat.
SELECT vbak~vbeln

vbak~vkorg

vbap~posnr

vbap~matnr

vbap~kwmeng

vbap~netpr INTO TABLE gt_out FROM vbak INNER JOIN vbap ON vbak~vbeln = vbap~vbeln
WHERE vbak~erdat = gv_erdat.
IF sy-subrc = 0.
SORT gt_out BY vbeln posnr.
ENDIF.
ENDCASE.
ENDMODULE. " USER_COMMAND_0480 INPUT

You might also like