SAP PM_SD_ORDER_READ Function Module for Provide order data for SD data transfer









PM_SD_ORDER_READ is a standard pm sd order read SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Provide order data for SD data transfer processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for pm sd order read FM, simply by entering the name PM_SD_ORDER_READ into the relevant SAP transaction such as SE37 or SE38.

Function Group: ISDI
Program Name: SAPLISDI
Main Program: SAPLISDI
Appliation area: I
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function PM_SD_ORDER_READ pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'PM_SD_ORDER_READ'"Provide order data for SD data transfer
EXPORTING
AUFNR = "PM order number
* VRGNG = "
* WARRANTY_CHECK = "
* CONTRACT_CHECK = 'X' "
* DOCFLOW_CHECK = 'X' "

IMPORTING
CONTRACT = "Contract
BSTNK = "Customer order number
BSTDK = "Customer ordering type
ABGRU = "Reason for rejection
GSBER = "Business area
PRCTR = "
FFPRF = "
BUKRS = "
KOKRS = "
AUTYP = "
ERDAT = "
CONPOS = "Outline agreement item
OBJNR = "
FAKTF = "
BEMOT = "
WAERS = "
CUOBJ = "
ERLOESE = "
SDAUART = "Order
WERKS = "PM Plant
VKORG = "Sales organization
VTWEG = "Distrib. channel
SPART = "Division
VKBUR = "
VKGRP = "

TABLES
* VBPA_WA = "Partners
* OBJK_WA = "Object list
* VBPAKOM_WA = "

EXCEPTIONS
NO_VALID_AUFNR = 1 NO_VALID_AUART = 2 INVOICE_WITH_PSP = 3 NO_CONTRACT_SPECIFIED = 4 T003O_AUART_NOT_MAINTAINED = 5 T350_AUART_NOT_MAINTAINED = 6 NO_VALID_QMNUM = 7 ERROR_OCCURRED = 8
.




Customer Function user exits

Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.
EXIT_SAPLISDI_001 Customer Exit for Determining Rejection of Billing Doc. Due to Warranty

IMPORTING Parameters details for PM_SD_ORDER_READ

AUFNR - PM order number

Data type: AUFK-AUFNR
Optional: No
Call by Reference: No ( called with pass by value option)

VRGNG -

Data type: TJ01-VRGNG
Optional: Yes
Call by Reference: No ( called with pass by value option)

WARRANTY_CHECK -

Data type: RIHEA-SLKNZ
Optional: Yes
Call by Reference: No ( called with pass by value option)

CONTRACT_CHECK -

Data type: RIHEA-SLKNZ
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

DOCFLOW_CHECK -

Data type: RIHEA-SLKNZ
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for PM_SD_ORDER_READ

CONTRACT - Contract

Data type: AUFK-KDAUF
Optional: No
Call by Reference: No ( called with pass by value option)

BSTNK - Customer order number

Data type: QMEL-BSTNK
Optional: No
Call by Reference: No ( called with pass by value option)

BSTDK - Customer ordering type

Data type: VBAK-BSTDK
Optional: No
Call by Reference: No ( called with pass by value option)

ABGRU - Reason for rejection

Data type: TVAG-ABGRU
Optional: No
Call by Reference: No ( called with pass by value option)

GSBER - Business area

Data type: AUFK-GSBER
Optional: No
Call by Reference: No ( called with pass by value option)

PRCTR -

Data type: AUFK-PRCTR
Optional: No
Call by Reference: No ( called with pass by value option)

FFPRF -

Data type: PMSDO-FFPRF
Optional: No
Call by Reference: No ( called with pass by value option)

BUKRS -

Data type: AUFK-BUKRS
Optional: No
Call by Reference: No ( called with pass by value option)

KOKRS -

Data type: AUFK-KOKRS
Optional: No
Call by Reference: No ( called with pass by value option)

AUTYP -

Data type: AUFK-AUTYP
Optional: No
Call by Reference: No ( called with pass by value option)

ERDAT -

Data type: AUFK-ERDAT
Optional: No
Call by Reference: No ( called with pass by value option)

CONPOS - Outline agreement item

Data type: AUFK-KDPOS
Optional: No
Call by Reference: No ( called with pass by value option)

OBJNR -

Data type: AUFK-OBJNR
Optional: No
Call by Reference: No ( called with pass by value option)

FAKTF -

Data type: PMSDO-FAKTF
Optional: No
Call by Reference: No ( called with pass by value option)

BEMOT -

Data type: AUFK-BEMOT
Optional: No
Call by Reference: No ( called with pass by value option)

WAERS -

Data type: AUFK-WAERS
Optional: No
Call by Reference: No ( called with pass by value option)

CUOBJ -

Data type: PMSDO-CUOBJ
Optional: No
Call by Reference: No ( called with pass by value option)

ERLOESE -

Data type: T003O-ERLOESE
Optional: No
Call by Reference: No ( called with pass by value option)

SDAUART - Order

Data type: TQ80-SDAUART
Optional: No
Call by Reference: No ( called with pass by value option)

WERKS - PM Plant

Data type: AFIH-IWERK
Optional: No
Call by Reference: No ( called with pass by value option)

VKORG - Sales organization

Data type: QMEL-VKORG
Optional: No
Call by Reference: No ( called with pass by value option)

VTWEG - Distrib. channel

Data type: QMEL-VTWEG
Optional: No
Call by Reference: No ( called with pass by value option)

SPART - Division

Data type: QMEL-SPART
Optional: No
Call by Reference: No ( called with pass by value option)

VKBUR -

Data type: QMEL-VKBUR
Optional: No
Call by Reference: No ( called with pass by value option)

VKGRP -

Data type: QMEL-VKGRP
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for PM_SD_ORDER_READ

VBPA_WA - Partners

Data type: VBPA
Optional: Yes
Call by Reference: No ( called with pass by value option)

OBJK_WA - Object list

Data type: OBJK
Optional: Yes
Call by Reference: No ( called with pass by value option)

VBPAKOM_WA -

Data type: VBPAKOM
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

NO_VALID_AUFNR - Order does not exist

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NO_VALID_AUART - Order type not allowed

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

INVOICE_WITH_PSP - Order is billed using WBS element

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NO_CONTRACT_SPECIFIED - Not sales order reference for service order

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

T003O_AUART_NOT_MAINTAINED -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

T350_AUART_NOT_MAINTAINED -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NO_VALID_QMNUM -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

ERROR_OCCURRED -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for PM_SD_ORDER_READ Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lv_aufnr  TYPE AUFK-AUFNR, "   
lt_vbpa_wa  TYPE STANDARD TABLE OF VBPA, "   
lv_contract  TYPE AUFK-KDAUF, "   
lv_no_valid_aufnr  TYPE AUFK, "   
lv_bstnk  TYPE QMEL-BSTNK, "   
lv_bstdk  TYPE VBAK-BSTDK, "   
lv_abgru  TYPE TVAG-ABGRU, "   
lv_gsber  TYPE AUFK-GSBER, "   
lv_prctr  TYPE AUFK-PRCTR, "   
lv_ffprf  TYPE PMSDO-FFPRF, "   
lv_bukrs  TYPE AUFK-BUKRS, "   
lv_kokrs  TYPE AUFK-KOKRS, "   
lv_autyp  TYPE AUFK-AUTYP, "   
lv_erdat  TYPE AUFK-ERDAT, "   
lv_vrgng  TYPE TJ01-VRGNG, "   
lv_conpos  TYPE AUFK-KDPOS, "   
lt_objk_wa  TYPE STANDARD TABLE OF OBJK, "   
lv_no_valid_auart  TYPE OBJK, "   
lv_objnr  TYPE AUFK-OBJNR, "   
lv_faktf  TYPE PMSDO-FAKTF, "   
lv_bemot  TYPE AUFK-BEMOT, "   
lv_waers  TYPE AUFK-WAERS, "   
lv_cuobj  TYPE PMSDO-CUOBJ, "   
lv_erloese  TYPE T003O-ERLOESE, "   
lv_sdauart  TYPE TQ80-SDAUART, "   
lt_vbpakom_wa  TYPE STANDARD TABLE OF VBPAKOM, "   
lv_warranty_check  TYPE RIHEA-SLKNZ, "   
lv_invoice_with_psp  TYPE RIHEA, "   
lv_werks  TYPE AFIH-IWERK, "   
lv_contract_check  TYPE RIHEA-SLKNZ, "   'X'
lv_no_contract_specified  TYPE RIHEA, "   
lv_vkorg  TYPE QMEL-VKORG, "   
lv_docflow_check  TYPE RIHEA-SLKNZ, "   'X'
lv_t003o_auart_not_maintained  TYPE RIHEA, "   
lv_vtweg  TYPE QMEL-VTWEG, "   
lv_t350_auart_not_maintained  TYPE QMEL, "   
lv_spart  TYPE QMEL-SPART, "   
lv_no_valid_qmnum  TYPE QMEL, "   
lv_vkbur  TYPE QMEL-VKBUR, "   
lv_error_occurred  TYPE QMEL, "   
lv_vkgrp  TYPE QMEL-VKGRP. "   

  CALL FUNCTION 'PM_SD_ORDER_READ'  "Provide order data for SD data transfer
    EXPORTING
         AUFNR = lv_aufnr
         VRGNG = lv_vrgng
         WARRANTY_CHECK = lv_warranty_check
         CONTRACT_CHECK = lv_contract_check
         DOCFLOW_CHECK = lv_docflow_check
    IMPORTING
         CONTRACT = lv_contract
         BSTNK = lv_bstnk
         BSTDK = lv_bstdk
         ABGRU = lv_abgru
         GSBER = lv_gsber
         PRCTR = lv_prctr
         FFPRF = lv_ffprf
         BUKRS = lv_bukrs
         KOKRS = lv_kokrs
         AUTYP = lv_autyp
         ERDAT = lv_erdat
         CONPOS = lv_conpos
         OBJNR = lv_objnr
         FAKTF = lv_faktf
         BEMOT = lv_bemot
         WAERS = lv_waers
         CUOBJ = lv_cuobj
         ERLOESE = lv_erloese
         SDAUART = lv_sdauart
         WERKS = lv_werks
         VKORG = lv_vkorg
         VTWEG = lv_vtweg
         SPART = lv_spart
         VKBUR = lv_vkbur
         VKGRP = lv_vkgrp
    TABLES
         VBPA_WA = lt_vbpa_wa
         OBJK_WA = lt_objk_wa
         VBPAKOM_WA = lt_vbpakom_wa
    EXCEPTIONS
        NO_VALID_AUFNR = 1
        NO_VALID_AUART = 2
        INVOICE_WITH_PSP = 3
        NO_CONTRACT_SPECIFIED = 4
        T003O_AUART_NOT_MAINTAINED = 5
        T350_AUART_NOT_MAINTAINED = 6
        NO_VALID_QMNUM = 7
        ERROR_OCCURRED = 8
. " PM_SD_ORDER_READ




ABAP code using 7.40 inline data declarations to call FM PM_SD_ORDER_READ

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

"SELECT single AUFNR FROM AUFK INTO @DATA(ld_aufnr).
 
 
"SELECT single KDAUF FROM AUFK INTO @DATA(ld_contract).
 
 
"SELECT single BSTNK FROM QMEL INTO @DATA(ld_bstnk).
 
"SELECT single BSTDK FROM VBAK INTO @DATA(ld_bstdk).
 
"SELECT single ABGRU FROM TVAG INTO @DATA(ld_abgru).
 
"SELECT single GSBER FROM AUFK INTO @DATA(ld_gsber).
 
"SELECT single PRCTR FROM AUFK INTO @DATA(ld_prctr).
 
"SELECT single FFPRF FROM PMSDO INTO @DATA(ld_ffprf).
 
"SELECT single BUKRS FROM AUFK INTO @DATA(ld_bukrs).
 
"SELECT single KOKRS FROM AUFK INTO @DATA(ld_kokrs).
 
"SELECT single AUTYP FROM AUFK INTO @DATA(ld_autyp).
 
"SELECT single ERDAT FROM AUFK INTO @DATA(ld_erdat).
 
"SELECT single VRGNG FROM TJ01 INTO @DATA(ld_vrgng).
 
"SELECT single KDPOS FROM AUFK INTO @DATA(ld_conpos).
 
 
 
"SELECT single OBJNR FROM AUFK INTO @DATA(ld_objnr).
 
"SELECT single FAKTF FROM PMSDO INTO @DATA(ld_faktf).
 
"SELECT single BEMOT FROM AUFK INTO @DATA(ld_bemot).
 
"SELECT single WAERS FROM AUFK INTO @DATA(ld_waers).
 
"SELECT single CUOBJ FROM PMSDO INTO @DATA(ld_cuobj).
 
"SELECT single ERLOESE FROM T003O INTO @DATA(ld_erloese).
 
"SELECT single SDAUART FROM TQ80 INTO @DATA(ld_sdauart).
 
 
"SELECT single SLKNZ FROM RIHEA INTO @DATA(ld_warranty_check).
 
 
"SELECT single IWERK FROM AFIH INTO @DATA(ld_werks).
 
"SELECT single SLKNZ FROM RIHEA INTO @DATA(ld_contract_check).
DATA(ld_contract_check) = 'X'.
 
 
"SELECT single VKORG FROM QMEL INTO @DATA(ld_vkorg).
 
"SELECT single SLKNZ FROM RIHEA INTO @DATA(ld_docflow_check).
DATA(ld_docflow_check) = 'X'.
 
 
"SELECT single VTWEG FROM QMEL INTO @DATA(ld_vtweg).
 
 
"SELECT single SPART FROM QMEL INTO @DATA(ld_spart).
 
 
"SELECT single VKBUR FROM QMEL INTO @DATA(ld_vkbur).
 
 
"SELECT single VKGRP FROM QMEL INTO @DATA(ld_vkgrp).
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!