SAP /SAPAPO/DM_PROD_ORDER_CHANGE Function Module for Write Routine for SNP Manufacturing Orders









/SAPAPO/DM_PROD_ORDER_CHANGE is a standard /sapapo/dm prod order change SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Write Routine for SNP Manufacturing 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 prod order change FM, simply by entering the name /SAPAPO/DM_PROD_ORDER_CHANGE into the relevant SAP transaction such as SE37 or SE38.

Function Group: /SAPAPO/DM_PROD
Program Name: /SAPAPO/SAPLDM_PROD
Main Program: /SAPAPO/SAPLDM_PROD
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function /SAPAPO/DM_PROD_ORDER_CHANGE 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_PROD_ORDER_CHANGE'"Write Routine for SNP Manufacturing Orders
EXPORTING
IC_DATABASE = "
* IV_INTERACTIVE = ' ' "
* IV_USE_CTM = ' ' "Mit CTM-Logik auflösen
* IV_INBOUND = ' ' "TRUE: Aufruf im OLTP->APO Inbound
* IV_NETCH = "True: Create planning file entries
* IV_ACCID = "
* IV_SEQ_DEP_EXPLOSION = "Sequence Dependent Explosion switch
* IS_CIFORD = "Structure for Order Header Data
* IT_CIFIN = "Table of Order Input Nodes
* IT_CIFOUT = "Table of Order Output Nodes
* IV_LOGSYS = "Logical system
IC_APPLICATION = "Applikation im APO
* IV_SIMSESSION = "
IT_PROD = "
* IT_COLS = "Tabellentyp: Externer Spaltenindex Planungsmatrix
* IT_ORDMAPS = "Tabelle von Einträgen aus der Mappingtabelle für Aufträge
* IV_EVENT = 'X' "allgemeines flag
* IV_BATCH = "allgemeines flag

IMPORTING
ET_RC = "
ET_PROD = "Ergebnistabelle SNP-Produktion
ET_PROT = "Tabelle mit BAPI Return Informationen
ET_PROD_ERR = "SNP results table - Production

EXCEPTIONS
MATERIAL_NOT_SUPPLIED = 1 LC_UNKNOWN_ERROR = 10 CONVERSION_ERROR = 11 PPM_NOT_FOUND = 12 R3_BOM_NOT_FOUND = 13 ORDER_NOT_FOUND = 14 ERROR = 15 LOCATION_NOT_SUPPLIED = 2 ACCOUNT_NOT_SUPPLIED = 3 SOURCE_SYSTEM_NOT_SUPPLIED = 4 MATID_NOT_FOUND = 5 LOCATION_NOT_FOUND = 6 LC_CONNECT_FAILED = 7 LC_COM_ERROR = 8 LC_APPL_ERROR = 9
.



IMPORTING Parameters details for /SAPAPO/DM_PROD_ORDER_CHANGE

IC_DATABASE -

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

IV_INTERACTIVE -

Data type: /SAPAPO/FLAG
Default: SPACE
Optional: Yes
Call by Reference: Yes

IV_USE_CTM - Mit CTM-Logik auflösen

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

IV_INBOUND - TRUE: Aufruf im OLTP->APO Inbound

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

IV_NETCH - True: Create planning file entries

Data type: /SAPAPO/BOOLEAN
Optional: Yes
Call by Reference: Yes

IV_ACCID -

Data type: /SAPAPO/ACCID
Optional: Yes
Call by Reference: Yes

IV_SEQ_DEP_EXPLOSION - Sequence Dependent Explosion switch

Data type: /SAPAPO/BOOLEAN
Optional: Yes
Call by Reference: Yes

IS_CIFORD - Structure for Order Header Data

Data type: /SAPAPO/CIF_ORDER_HEAD
Optional: Yes
Call by Reference: Yes

IT_CIFIN - Table of Order Input Nodes

Data type: /SAPAPO/CIF_ORDER_INPUT_TAB
Optional: Yes
Call by Reference: Yes

IT_CIFOUT - Table of Order Output Nodes

Data type: /SAPAPO/CIF_ORDER_OUTPUT_TAB
Optional: Yes
Call by Reference: Yes

IV_LOGSYS - Logical system

Data type: LOGSYS
Optional: Yes
Call by Reference: Yes

IC_APPLICATION - Applikation im APO

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

IV_SIMSESSION -

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

IT_PROD -

Data type: /SAPAPO/MSNP_PROD_TAB
Optional: No
Call by Reference: Yes

IT_COLS - Tabellentyp: Externer Spaltenindex Planungsmatrix

Data type: /SAPAPO/TS_COLS_EXT_TAB
Optional: Yes
Call by Reference: Yes

IT_ORDMAPS - Tabelle von Einträgen aus der Mappingtabelle für Aufträge

Data type: /SAPAPO/ORDMAP_TAB
Optional: Yes
Call by Reference: Yes

IV_EVENT - allgemeines flag

Data type: FLAG
Default: 'X'
Optional: Yes
Call by Reference: Yes

IV_BATCH - allgemeines flag

Data type: FLAG
Optional: Yes
Call by Reference: Yes

EXPORTING Parameters details for /SAPAPO/DM_PROD_ORDER_CHANGE

ET_RC -

Data type: /SAPAPO/OM_LC_RC_TAB
Optional: No
Call by Reference: Yes

ET_PROD - Ergebnistabelle SNP-Produktion

Data type: /SAPAPO/MSNP_PROD_TAB
Optional: No
Call by Reference: Yes

ET_PROT - Tabelle mit BAPI Return Informationen

Data type: BAPIRETTAB
Optional: No
Call by Reference: Yes

ET_PROD_ERR - SNP results table - Production

Data type: /SAPAPO/MSNP_PROD_TAB
Optional: No
Call by Reference: Yes

EXCEPTIONS details

MATERIAL_NOT_SUPPLIED -

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

LC_UNKNOWN_ERROR -

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

CONVERSION_ERROR -

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

PPM_NOT_FOUND -

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

R3_BOM_NOT_FOUND -

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

ORDER_NOT_FOUND -

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

ERROR -

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

LOCATION_NOT_SUPPLIED -

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

ACCOUNT_NOT_SUPPLIED -

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

SOURCE_SYSTEM_NOT_SUPPLIED -

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

MATID_NOT_FOUND -

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

LOCATION_NOT_FOUND -

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

LC_CONNECT_FAILED -

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

LC_COM_ERROR -

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

LC_APPL_ERROR -

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

Copy and paste ABAP code example for /SAPAPO/DM_PROD_ORDER_CHANGE 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_et_rc  TYPE /SAPAPO/OM_LC_RC_TAB, "   
lv_ic_database  TYPE /SAPAPO/SNPDBFLAG, "   
lv_material_not_supplied  TYPE /SAPAPO/SNPDBFLAG, "   
lv_iv_interactive  TYPE /SAPAPO/FLAG, "   SPACE
lv_lc_unknown_error  TYPE /SAPAPO/FLAG, "   
lv_iv_use_ctm  TYPE FLAG, "   SPACE
lv_conversion_error  TYPE FLAG, "   
lv_iv_inbound  TYPE FLAG, "   SPACE
lv_ppm_not_found  TYPE FLAG, "   
lv_iv_netch  TYPE /SAPAPO/BOOLEAN, "   
lv_r3_bom_not_found  TYPE /SAPAPO/BOOLEAN, "   
lv_iv_accid  TYPE /SAPAPO/ACCID, "   
lv_order_not_found  TYPE /SAPAPO/ACCID, "   
lv_error  TYPE /SAPAPO/ACCID, "   
lv_iv_seq_dep_explosion  TYPE /SAPAPO/BOOLEAN, "   
lv_is_ciford  TYPE /SAPAPO/CIF_ORDER_HEAD, "   
lv_it_cifin  TYPE /SAPAPO/CIF_ORDER_INPUT_TAB, "   
lv_it_cifout  TYPE /SAPAPO/CIF_ORDER_OUTPUT_TAB, "   
lv_et_prod  TYPE /SAPAPO/MSNP_PROD_TAB, "   
lv_iv_logsys  TYPE LOGSYS, "   
lv_location_not_supplied  TYPE LOGSYS, "   
lv_et_prot  TYPE BAPIRETTAB, "   
lv_ic_application  TYPE /SAPAPO/OM_APO_APPLI, "   
lv_account_not_supplied  TYPE /SAPAPO/OM_APO_APPLI, "   
lv_et_prod_err  TYPE /SAPAPO/MSNP_PROD_TAB, "   
lv_iv_simsession  TYPE /SAPAPO/OM_SIMSESSION, "   
lv_source_system_not_supplied  TYPE /SAPAPO/OM_SIMSESSION, "   
lv_it_prod  TYPE /SAPAPO/MSNP_PROD_TAB, "   
lv_matid_not_found  TYPE /SAPAPO/MSNP_PROD_TAB, "   
lv_it_cols  TYPE /SAPAPO/TS_COLS_EXT_TAB, "   
lv_location_not_found  TYPE /SAPAPO/TS_COLS_EXT_TAB, "   
lv_it_ordmaps  TYPE /SAPAPO/ORDMAP_TAB, "   
lv_lc_connect_failed  TYPE /SAPAPO/ORDMAP_TAB, "   
lv_iv_event  TYPE FLAG, "   'X'
lv_lc_com_error  TYPE FLAG, "   
lv_iv_batch  TYPE FLAG, "   
lv_lc_appl_error  TYPE FLAG. "   

  CALL FUNCTION '/SAPAPO/DM_PROD_ORDER_CHANGE'  "Write Routine for SNP Manufacturing Orders
    EXPORTING
         IC_DATABASE = lv_ic_database
         IV_INTERACTIVE = lv_iv_interactive
         IV_USE_CTM = lv_iv_use_ctm
         IV_INBOUND = lv_iv_inbound
         IV_NETCH = lv_iv_netch
         IV_ACCID = lv_iv_accid
         IV_SEQ_DEP_EXPLOSION = lv_iv_seq_dep_explosion
         IS_CIFORD = lv_is_ciford
         IT_CIFIN = lv_it_cifin
         IT_CIFOUT = lv_it_cifout
         IV_LOGSYS = lv_iv_logsys
         IC_APPLICATION = lv_ic_application
         IV_SIMSESSION = lv_iv_simsession
         IT_PROD = lv_it_prod
         IT_COLS = lv_it_cols
         IT_ORDMAPS = lv_it_ordmaps
         IV_EVENT = lv_iv_event
         IV_BATCH = lv_iv_batch
    IMPORTING
         ET_RC = lv_et_rc
         ET_PROD = lv_et_prod
         ET_PROT = lv_et_prot
         ET_PROD_ERR = lv_et_prod_err
    EXCEPTIONS
        MATERIAL_NOT_SUPPLIED = 1
        LC_UNKNOWN_ERROR = 10
        CONVERSION_ERROR = 11
        PPM_NOT_FOUND = 12
        R3_BOM_NOT_FOUND = 13
        ORDER_NOT_FOUND = 14
        ERROR = 15
        LOCATION_NOT_SUPPLIED = 2
        ACCOUNT_NOT_SUPPLIED = 3
        SOURCE_SYSTEM_NOT_SUPPLIED = 4
        MATID_NOT_FOUND = 5
        LOCATION_NOT_FOUND = 6
        LC_CONNECT_FAILED = 7
        LC_COM_ERROR = 8
        LC_APPL_ERROR = 9
. " /SAPAPO/DM_PROD_ORDER_CHANGE




ABAP code using 7.40 inline data declarations to call FM /SAPAPO/DM_PROD_ORDER_CHANGE

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_iv_interactive) = ' '.
 
 
DATA(ld_iv_use_ctm) = ' '.
 
 
DATA(ld_iv_inbound) = ' '.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
DATA(ld_iv_event) = 'X'.
 
 
 
 


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!