SAP /SAPAPO/DM_SUBST_ORDER_DELETE Function Module for Delete Substitution Orders
/SAPAPO/DM_SUBST_ORDER_DELETE is a standard /sapapo/dm subst order delete SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Delete Substitution Orders 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 /sapapo/dm subst order delete FM, simply by entering the name /SAPAPO/DM_SUBST_ORDER_DELETE into the relevant SAP transaction such as SE37 or SE38.
Function Group: /SAPAPO/DM_SUBST
Program Name: /SAPAPO/SAPLDM_SUBST
Main Program: /SAPAPO/SAPLDM_SUBST
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function /SAPAPO/DM_SUBST_ORDER_DELETE 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 '/SAPAPO/DM_SUBST_ORDER_DELETE'"Delete Substitution Orders.
EXPORTING
IT_COLS = "Table Type: Column Index for Planning Matrix of Application
IV_SUBST_CAT_DEM = "Kategorie des Bestandes / Zuganges / Bedarfes / Prognose
IV_SIMSESSION = "GUID for Identifying Transactional Simulation Session
IS_PROD_TSTMP = "UTC Time Stamp in Short Form (YYYYMMDDhhmmss)
IS_SHIP_TSTMP = "UTC Time Stamp in Short Form (YYYYMMDDhhmmss)
* IV_SUBST_TRPID = "
IV_TSTTO_END = "UTC Time Stamp in Short Form (YYYYMMDDhhmmss)
IV_TSTFR_START = "UTC Time Stamp in Short Form (YYYYMMDDhhmmss)
IS_LOCMAT = "Get: Storage Resources for Product at a Location
IS_LOC = "Get: Handling resources at a location
IV_KEYFIG = "InfoObject
IV_SNPDLTHEU = "Heuristic: Delta Mode for Order Update
IV_VERSION = "Transaction Data Version
IV_SUBST_CAT = "Category of Stock/Receipt/Requirement/Forecast
CHANGING
CT_SUBST_OLD = "Substitution Orders
CT_SUBST_TMP = "Substitution Orders
EXCEPTIONS
MATERIAL_NOT_SUPPLIED = 1 LOCATION_NOT_SUPPLIED = 2 MATERIAL_NOT_IN_LOCATION = 3 ERROR_FINDING_PEGID = 4
IMPORTING Parameters details for /SAPAPO/DM_SUBST_ORDER_DELETE
IT_COLS - Table Type: Column Index for Planning Matrix of Application
Data type: /SAPAPO/MSDP_APP_COLS_TABOptional: No
Call by Reference: Yes
IV_SUBST_CAT_DEM - Kategorie des Bestandes / Zuganges / Bedarfes / Prognose
Data type: /SAPAPO/ATPCATOptional: No
Call by Reference: Yes
IV_SIMSESSION - GUID for Identifying Transactional Simulation Session
Data type: /SAPAPO/OM_SIMSESSIONOptional: No
Call by Reference: Yes
IS_PROD_TSTMP - UTC Time Stamp in Short Form (YYYYMMDDhhmmss)
Data type: TIMESTAMPOptional: No
Call by Reference: Yes
IS_SHIP_TSTMP - UTC Time Stamp in Short Form (YYYYMMDDhhmmss)
Data type: TIMESTAMPOptional: No
Call by Reference: Yes
IV_SUBST_TRPID -
Data type: /SAPAPO/OM_SUBST_TRPIDOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_TSTTO_END - UTC Time Stamp in Short Form (YYYYMMDDhhmmss)
Data type: TIMESTAMPOptional: No
Call by Reference: Yes
IV_TSTFR_START - UTC Time Stamp in Short Form (YYYYMMDDhhmmss)
Data type: TIMESTAMPOptional: No
Call by Reference: Yes
IS_LOCMAT - Get: Storage Resources for Product at a Location
Data type: /SAPAPO/MSNP_LOCMATOptional: No
Call by Reference: Yes
IS_LOC - Get: Handling resources at a location
Data type: /SAPAPO/MSNP_LOCOptional: No
Call by Reference: Yes
IV_KEYFIG - InfoObject
Data type: /SAPAPO/IOBJNMOptional: No
Call by Reference: Yes
IV_SNPDLTHEU - Heuristic: Delta Mode for Order Update
Data type: /SAPAPO/SNPDLTHEUOptional: No
Call by Reference: Yes
IV_VERSION - Transaction Data Version
Data type: /SAPAPO/SNPVERSIONOptional: No
Call by Reference: Yes
IV_SUBST_CAT - Category of Stock/Receipt/Requirement/Forecast
Data type: /SAPAPO/ATPCATOptional: No
Call by Reference: Yes
CHANGING Parameters details for /SAPAPO/DM_SUBST_ORDER_DELETE
CT_SUBST_OLD - Substitution Orders
Data type: /SAPAPO/MSNP_SUBST_TABOptional: No
Call by Reference: Yes
CT_SUBST_TMP - Substitution Orders
Data type: /SAPAPO/MSNP_SUBST_TABOptional: No
Call by Reference: Yes
EXCEPTIONS details
MATERIAL_NOT_SUPPLIED -
Data type:Optional: No
Call by Reference: Yes
LOCATION_NOT_SUPPLIED -
Data type:Optional: No
Call by Reference: Yes
MATERIAL_NOT_IN_LOCATION -
Data type:Optional: No
Call by Reference: Yes
ERROR_FINDING_PEGID -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for /SAPAPO/DM_SUBST_ORDER_DELETE 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_it_cols | TYPE /SAPAPO/MSDP_APP_COLS_TAB, " | |||
| lv_ct_subst_old | TYPE /SAPAPO/MSNP_SUBST_TAB, " | |||
| lv_material_not_supplied | TYPE /SAPAPO/MSNP_SUBST_TAB, " | |||
| lv_iv_subst_cat_dem | TYPE /SAPAPO/ATPCAT, " | |||
| lv_iv_simsession | TYPE /SAPAPO/OM_SIMSESSION, " | |||
| lv_is_prod_tstmp | TYPE TIMESTAMP, " | |||
| lv_is_ship_tstmp | TYPE TIMESTAMP, " | |||
| lv_iv_subst_trpid | TYPE /SAPAPO/OM_SUBST_TRPID, " | |||
| lv_ct_subst_tmp | TYPE /SAPAPO/MSNP_SUBST_TAB, " | |||
| lv_iv_tstto_end | TYPE TIMESTAMP, " | |||
| lv_location_not_supplied | TYPE TIMESTAMP, " | |||
| lv_iv_tstfr_start | TYPE TIMESTAMP, " | |||
| lv_material_not_in_location | TYPE TIMESTAMP, " | |||
| lv_is_locmat | TYPE /SAPAPO/MSNP_LOCMAT, " | |||
| lv_error_finding_pegid | TYPE /SAPAPO/MSNP_LOCMAT, " | |||
| lv_is_loc | TYPE /SAPAPO/MSNP_LOC, " | |||
| lv_iv_keyfig | TYPE /SAPAPO/IOBJNM, " | |||
| lv_iv_snpdltheu | TYPE /SAPAPO/SNPDLTHEU, " | |||
| lv_iv_version | TYPE /SAPAPO/SNPVERSION, " | |||
| lv_iv_subst_cat | TYPE /SAPAPO/ATPCAT. " |
|   CALL FUNCTION '/SAPAPO/DM_SUBST_ORDER_DELETE' "Delete Substitution Orders |
| EXPORTING | ||
| IT_COLS | = lv_it_cols | |
| IV_SUBST_CAT_DEM | = lv_iv_subst_cat_dem | |
| IV_SIMSESSION | = lv_iv_simsession | |
| IS_PROD_TSTMP | = lv_is_prod_tstmp | |
| IS_SHIP_TSTMP | = lv_is_ship_tstmp | |
| IV_SUBST_TRPID | = lv_iv_subst_trpid | |
| IV_TSTTO_END | = lv_iv_tstto_end | |
| IV_TSTFR_START | = lv_iv_tstfr_start | |
| IS_LOCMAT | = lv_is_locmat | |
| IS_LOC | = lv_is_loc | |
| IV_KEYFIG | = lv_iv_keyfig | |
| IV_SNPDLTHEU | = lv_iv_snpdltheu | |
| IV_VERSION | = lv_iv_version | |
| IV_SUBST_CAT | = lv_iv_subst_cat | |
| CHANGING | ||
| CT_SUBST_OLD | = lv_ct_subst_old | |
| CT_SUBST_TMP | = lv_ct_subst_tmp | |
| EXCEPTIONS | ||
| MATERIAL_NOT_SUPPLIED = 1 | ||
| LOCATION_NOT_SUPPLIED = 2 | ||
| MATERIAL_NOT_IN_LOCATION = 3 | ||
| ERROR_FINDING_PEGID = 4 | ||
| . " /SAPAPO/DM_SUBST_ORDER_DELETE | ||
ABAP code using 7.40 inline data declarations to call FM /SAPAPO/DM_SUBST_ORDER_DELETE
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.Search for further information about these or an SAP related objects