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

Function /SAPAPO/DM_STOCK_MAINTAIN 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_STOCK_MAINTAIN'"Inbound Module for Stock Data.
EXPORTING
* IF_SIMSESSION = "GUID zur Identifikation transaktionale Simulations-Session
* IF_SIMID = '000' "Planversion (operativ oder eine Simulationsversion)
IF_LOGQS = "
IF_SYN_POST = "
IF_LOGSYS = "Logisches System
* IV_NEWWAY = ' ' "Dummy Datenlement für Boolean-Felder
* IV_CIFTRIGGER = "Application that Triggered a Data Transfer
* IV_APPLICATION = ' ' "RRP Application: (B)ackground, (A)tp, C(I)F, Default dialog
IMPORTING
ET_DELETED_FIX_PEGGING = "Tabelle mit Pegginginfos
TABLES
IT_STOCK = "
* ET_STOCK_STRUC = "Struktur zur Übergabe der Bestände an LC/DB
ET_RETURN = "
* IT_STOCK_CUS = "Kundenerweiterungsstruktur zu /SAPAPO/CIF_STOCK
* IT_STOCK_REF = "Struktur zur Übergabe der Vorgängerbelege zu Beständen
* IT_DLEX = "Empfangsstruktur für AFS Inbound Monitor (Bestände)
EXCEPTIONS
POSTING_FAILED = 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_/SAPAPO/SAPLDM_STOCK_001 Post Customer-Specific Stock Fields
IMPORTING Parameters details for /SAPAPO/DM_STOCK_MAINTAIN
IF_SIMSESSION - GUID zur Identifikation transaktionale Simulations-Session
Data type: /SAPAPO/OM_SIMSESSIONOptional: Yes
Call by Reference: Yes
IF_SIMID - Planversion (operativ oder eine Simulationsversion)
Data type: /SAPAPO/VRSIOIDDefault: '000'
Optional: Yes
Call by Reference: Yes
IF_LOGQS -
Data type: /SAPAPO/LOGQSOptional: No
Call by Reference: No ( called with pass by value option)
IF_SYN_POST -
Data type: XFELDOptional: No
Call by Reference: No ( called with pass by value option)
IF_LOGSYS - Logisches System
Data type: LOGSYSOptional: No
Call by Reference: Yes
IV_NEWWAY - Dummy Datenlement für Boolean-Felder
Data type: /SAPAPO/BOOLEANDefault: SPACE
Optional: Yes
Call by Reference: Yes
IV_CIFTRIGGER - Application that Triggered a Data Transfer
Data type: /SAPAPO/CIFTRIGGEROptional: Yes
Call by Reference: Yes
IV_APPLICATION - RRP Application: (B)ackground, (A)tp, C(I)F, Default dialog
Data type: /SAPAPO/RRP_APPLICATIONDefault: SPACE
Optional: Yes
Call by Reference: Yes
EXPORTING Parameters details for /SAPAPO/DM_STOCK_MAINTAIN
ET_DELETED_FIX_PEGGING - Tabelle mit Pegginginfos
Data type: /SAPAPO/OM_TAB_PEGGINGOptional: No
Call by Reference: Yes
TABLES Parameters details for /SAPAPO/DM_STOCK_MAINTAIN
IT_STOCK -
Data type: /SAPAPO/CIF_STOCKOptional: No
Call by Reference: No ( called with pass by value option)
ET_STOCK_STRUC - Struktur zur Übergabe der Bestände an LC/DB
Data type: /SAPAPO/STOCK_STRUCOptional: Yes
Call by Reference: Yes
ET_RETURN -
Data type: BAPIRET2Optional: No
Call by Reference: No ( called with pass by value option)
IT_STOCK_CUS - Kundenerweiterungsstruktur zu /SAPAPO/CIF_STOCK
Data type: /SAPAPO/CIF_STOCK_CUSOptional: Yes
Call by Reference: Yes
IT_STOCK_REF - Struktur zur Übergabe der Vorgängerbelege zu Beständen
Data type: /SAPAPO/STOCK_REFOptional: Yes
Call by Reference: Yes
IT_DLEX - Empfangsstruktur für AFS Inbound Monitor (Bestände)
Data type: /SAPAPO/CIF_STK_DEL_EXOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
POSTING_FAILED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for /SAPAPO/DM_STOCK_MAINTAIN 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: | ||||
| lt_it_stock | TYPE STANDARD TABLE OF /SAPAPO/CIF_STOCK, " | |||
| lv_if_simsession | TYPE /SAPAPO/OM_SIMSESSION, " | |||
| lv_posting_failed | TYPE /SAPAPO/OM_SIMSESSION, " | |||
| lv_et_deleted_fix_pegging | TYPE /SAPAPO/OM_TAB_PEGGING, " | |||
| lv_if_simid | TYPE /SAPAPO/VRSIOID, " '000' | |||
| lt_et_stock_struc | TYPE STANDARD TABLE OF /SAPAPO/STOCK_STRUC, " | |||
| lv_if_logqs | TYPE /SAPAPO/LOGQS, " | |||
| lt_et_return | TYPE STANDARD TABLE OF BAPIRET2, " | |||
| lv_if_syn_post | TYPE XFELD, " | |||
| lt_it_stock_cus | TYPE STANDARD TABLE OF /SAPAPO/CIF_STOCK_CUS, " | |||
| lv_if_logsys | TYPE LOGSYS, " | |||
| lt_it_stock_ref | TYPE STANDARD TABLE OF /SAPAPO/STOCK_REF, " | |||
| lt_it_dlex | TYPE STANDARD TABLE OF /SAPAPO/CIF_STK_DEL_EX, " | |||
| lv_iv_newway | TYPE /SAPAPO/BOOLEAN, " SPACE | |||
| lv_iv_ciftrigger | TYPE /SAPAPO/CIFTRIGGER, " | |||
| lv_iv_application | TYPE /SAPAPO/RRP_APPLICATION. " SPACE |
|   CALL FUNCTION '/SAPAPO/DM_STOCK_MAINTAIN' "Inbound Module for Stock Data |
| EXPORTING | ||
| IF_SIMSESSION | = lv_if_simsession | |
| IF_SIMID | = lv_if_simid | |
| IF_LOGQS | = lv_if_logqs | |
| IF_SYN_POST | = lv_if_syn_post | |
| IF_LOGSYS | = lv_if_logsys | |
| IV_NEWWAY | = lv_iv_newway | |
| IV_CIFTRIGGER | = lv_iv_ciftrigger | |
| IV_APPLICATION | = lv_iv_application | |
| IMPORTING | ||
| ET_DELETED_FIX_PEGGING | = lv_et_deleted_fix_pegging | |
| TABLES | ||
| IT_STOCK | = lt_it_stock | |
| ET_STOCK_STRUC | = lt_et_stock_struc | |
| ET_RETURN | = lt_et_return | |
| IT_STOCK_CUS | = lt_it_stock_cus | |
| IT_STOCK_REF | = lt_it_stock_ref | |
| IT_DLEX | = lt_it_dlex | |
| EXCEPTIONS | ||
| POSTING_FAILED = 1 | ||
| . " /SAPAPO/DM_STOCK_MAINTAIN | ||
ABAP code using 7.40 inline data declarations to call FM /SAPAPO/DM_STOCK_MAINTAIN
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.| DATA(ld_if_simid) | = '000'. | |||
| DATA(ld_iv_newway) | = ' '. | |||
| DATA(ld_iv_application) | = ' '. | |||
Search for further information about these or an SAP related objects