SAP PM_SD_CONTRACT Function Module for Reading contracts for equipment









PM_SD_CONTRACT is a standard pm sd contract SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Reading contracts for equipment 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 contract FM, simply by entering the name PM_SD_CONTRACT 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_CONTRACT 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_CONTRACT'"Reading contracts for equipment
EXPORTING
* KUNUM = ' ' "
* KDAUF = ' ' "
* KDPOS = ' ' "
* HIER = 'X' "With sup. objects
* CONF = ' ' "With configuration data
* SELMOD = 'D' "Selection session
* CUOBJ = "
* SEL_SCREEN = ' ' "
* TPLNR = ' ' "Functional location
* EQUNR = ' ' "Equipment
* MATNR = ' ' "
* VKORG = ' ' "
* VTWEG = ' ' "
* SPART = ' ' "
* DATE = SY-DATUM "Date
* UZEIT = SY-UZEIT "Time

TABLES
* VEDA_WA = "Contract data
* CONF_WA = "Configuration data

EXCEPTIONS
NO_CONTRACT = 1
.




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_CONTRACT

KUNUM -

Data type: VIQMEL-KUNUM
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

KDAUF -

Data type: VIQMEL-KDAUF
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

KDPOS -

Data type: VIQMEL-KDPOS
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

HIER - With sup. objects

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

CONF - With configuration data

Data type: CSDATA-XFELD
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

SELMOD - Selection session

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

CUOBJ -

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

SEL_SCREEN -

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

TPLNR - Functional location

Data type: VIQMEL-TPLNR
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EQUNR - Equipment

Data type: VIQMEL-EQUNR
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

MATNR -

Data type: VIQMEL-MATNR
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

VKORG -

Data type: VIQMEL-VKORG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

VTWEG -

Data type: VIQMEL-VTWEG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

SPART -

Data type: VIQMEL-SPART
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

DATE - Date

Data type: SY-DATUM
Default: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)

UZEIT - Time

Data type: SY-UZEIT
Default: SY-UZEIT
Optional: Yes
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for PM_SD_CONTRACT

VEDA_WA - Contract data

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

CONF_WA - Configuration data

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

EXCEPTIONS details

NO_CONTRACT -

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

Copy and paste ABAP code example for PM_SD_CONTRACT 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_kunum  TYPE VIQMEL-KUNUM, "   SPACE
lt_veda_wa  TYPE STANDARD TABLE OF RIHVEDA, "   
lv_no_contract  TYPE RIHVEDA, "   
lv_kdauf  TYPE VIQMEL-KDAUF, "   SPACE
lv_kdpos  TYPE VIQMEL-KDPOS, "   SPACE
lv_hier  TYPE RIHEA-EQHIE, "   'X'
lv_conf  TYPE CSDATA-XFELD, "   SPACE
lv_selmod  TYPE RIHEA-SELMO, "   'D'
lv_cuobj  TYPE VBAP-CUOBJ, "   
lv_sel_screen  TYPE RIHEA-SELMO, "   SPACE
lv_tplnr  TYPE VIQMEL-TPLNR, "   SPACE
lt_conf_wa  TYPE STANDARD TABLE OF RIHCONF, "   
lv_equnr  TYPE VIQMEL-EQUNR, "   SPACE
lv_matnr  TYPE VIQMEL-MATNR, "   SPACE
lv_vkorg  TYPE VIQMEL-VKORG, "   SPACE
lv_vtweg  TYPE VIQMEL-VTWEG, "   SPACE
lv_spart  TYPE VIQMEL-SPART, "   SPACE
lv_date  TYPE SY-DATUM, "   SY-DATUM
lv_uzeit  TYPE SY-UZEIT. "   SY-UZEIT

  CALL FUNCTION 'PM_SD_CONTRACT'  "Reading contracts for equipment
    EXPORTING
         KUNUM = lv_kunum
         KDAUF = lv_kdauf
         KDPOS = lv_kdpos
         HIER = lv_hier
         CONF = lv_conf
         SELMOD = lv_selmod
         CUOBJ = lv_cuobj
         SEL_SCREEN = lv_sel_screen
         TPLNR = lv_tplnr
         EQUNR = lv_equnr
         MATNR = lv_matnr
         VKORG = lv_vkorg
         VTWEG = lv_vtweg
         SPART = lv_spart
         DATE = lv_date
         UZEIT = lv_uzeit
    TABLES
         VEDA_WA = lt_veda_wa
         CONF_WA = lt_conf_wa
    EXCEPTIONS
        NO_CONTRACT = 1
. " PM_SD_CONTRACT




ABAP code using 7.40 inline data declarations to call FM PM_SD_CONTRACT

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 KUNUM FROM VIQMEL INTO @DATA(ld_kunum).
DATA(ld_kunum) = ' '.
 
 
 
"SELECT single KDAUF FROM VIQMEL INTO @DATA(ld_kdauf).
DATA(ld_kdauf) = ' '.
 
"SELECT single KDPOS FROM VIQMEL INTO @DATA(ld_kdpos).
DATA(ld_kdpos) = ' '.
 
"SELECT single EQHIE FROM RIHEA INTO @DATA(ld_hier).
DATA(ld_hier) = 'X'.
 
"SELECT single XFELD FROM CSDATA INTO @DATA(ld_conf).
DATA(ld_conf) = ' '.
 
"SELECT single SELMO FROM RIHEA INTO @DATA(ld_selmod).
DATA(ld_selmod) = 'D'.
 
"SELECT single CUOBJ FROM VBAP INTO @DATA(ld_cuobj).
 
"SELECT single SELMO FROM RIHEA INTO @DATA(ld_sel_screen).
DATA(ld_sel_screen) = ' '.
 
"SELECT single TPLNR FROM VIQMEL INTO @DATA(ld_tplnr).
DATA(ld_tplnr) = ' '.
 
 
"SELECT single EQUNR FROM VIQMEL INTO @DATA(ld_equnr).
DATA(ld_equnr) = ' '.
 
"SELECT single MATNR FROM VIQMEL INTO @DATA(ld_matnr).
DATA(ld_matnr) = ' '.
 
"SELECT single VKORG FROM VIQMEL INTO @DATA(ld_vkorg).
DATA(ld_vkorg) = ' '.
 
"SELECT single VTWEG FROM VIQMEL INTO @DATA(ld_vtweg).
DATA(ld_vtweg) = ' '.
 
"SELECT single SPART FROM VIQMEL INTO @DATA(ld_spart).
DATA(ld_spart) = ' '.
 
"SELECT single DATUM FROM SY INTO @DATA(ld_date).
DATA(ld_date) = SY-DATUM.
 
"SELECT single UZEIT FROM SY INTO @DATA(ld_uzeit).
DATA(ld_uzeit) = SY-UZEIT.
 


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!