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

MPP Sales

The document outlines the steps to create a module pool program in SAP for displaying sales order details. It includes creating structures, internal tables, screens, and fetching data from the vbak and kna1 tables based on user input. The provided code demonstrates the implementation of these steps, including handling user commands and validating sales numbers.

Uploaded by

Nikhil Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

MPP Sales

The document outlines the steps to create a module pool program in SAP for displaying sales order details. It includes creating structures, internal tables, screens, and fetching data from the vbak and kna1 tables based on user input. The provided code demonstrates the implementation of these steps, including handling user commands and validating sales numbers.

Uploaded by

Nikhil Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
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 internal table

Step 3: Create screen and add buttons

Step 4: In layout, create fields

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

Code:

PROGRAM SAPMZSD_SALES_DETAIL

TYPES :
BEGIN OF gty_out,
vbeln TYPE vbak-vbeln,
erdat TYPE vbak-erdat,
erzet TYPE vbak-erzet,
kunnr TYPE vbak-kunnr,
name01 TYPE kna1-name1,
ort01 TYPE kna1-ort01,
land01 TYPE kna1-land1,
END OF gty_out.
DATA :ok_code TYPE sy-ucomm,
gv_vbeln TYPE vbak-vbeln.
gs_out TYPE gty_out.

*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET PF-STATUS 'ZPF_STATUS'.
SET TITLEBAR 'ZTITLE'.
ENDMODULE. " STATUS_0100 OUTPUT

*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
CASE OK_CODE.
WHEN 'BACK'.
leave to SCREEN 0.
when 'CLEAR'.
CLEAR gs_out.
when 'DIS'.
SELECT SINGLE vbak~vbeln

vbak~erdat

vbak~erzet

vbak~kunnr

kna1~name1

kna1~ort01

kna1~land1 INTO gs_out FROM vbak INNER JOIN kna1 on vbak~kunnr = kna1~kunnr
WHERE vbak~vbeln = gs_out-vbeln.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT

*&---------------------------------------------------------------------*
*& Module EXIT INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE exit INPUT.
CASE OK_CODE.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " EXIT INPUT
*&---------------------------------------------------------------------*
*& Module SALE_NUM_VALID INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE sale_num_valid INPUT.
CLEAR gv_vbeln.
SELECT SINGLE vbeln from vbak INTO gv_vbeln
WHERE vbeln = gs_out-vbeln.
if sy-subrc NE 0.
MESSAGE 'Please Enter a Valid Sales No' TYPE 'E'.
ENDIF.
ENDMODULE. " SALE_NUM_VALID INPUT

You might also like