SAP PM_ORDER_ARCHIVE_CREATE Function Module for PM Order: Create archive
PM_ORDER_ARCHIVE_CREATE is a standard pm order archive create SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for PM Order: Create archive 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 order archive create FM, simply by entering the name PM_ORDER_ARCHIVE_CREATE into the relevant SAP transaction such as SE37 or SE38.
Function Group: COAI
Program Name: SAPLCOAI
Main Program: SAPLCOAI
Appliation area: C
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function PM_ORDER_ARCHIVE_CREATE 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_ORDER_ARCHIVE_CREATE'"PM Order: Create archive.
EXPORTING
* ARCHIVE_HANDLE = "Handle for Archiving Session
* DELETE_FLAG = 'X' "Delete the Archived Data to Database?
* HIKO_CREATE = 'X' "
* PACKAGE_SIZE = 10 "Packet Size for Block Reading to Database
* P_SNAP = "ILM Snapshot Action
* P_DEST = "ILM Data Destruction Action
TABLES
IVIORA = "Table of Orders to be Archived
EXCEPTIONS
ARCHIVING_ERROR_OF_ITAB = 1 NOT_FOUND = 2 NO_AUTHORITY = 3 OTHERS = 4
IMPORTING Parameters details for PM_ORDER_ARCHIVE_CREATE
ARCHIVE_HANDLE - Handle for Archiving Session
Data type: SY-TABIXOptional: Yes
Call by Reference: No ( called with pass by value option)
DELETE_FLAG - Delete the Archived Data to Database?
Data type: RC27X-FLG_SELDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
HIKO_CREATE -
Data type: RC27X-FLG_SELDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
PACKAGE_SIZE - Packet Size for Block Reading to Database
Data type: COARCH-DBNUMDefault: 10
Optional: Yes
Call by Reference: No ( called with pass by value option)
P_SNAP - ILM Snapshot Action
Data type: ILM_WRITE_SNAPOptional: Yes
Call by Reference: No ( called with pass by value option)
P_DEST - ILM Data Destruction Action
Data type: ILM_WRITE_DESTOptional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for PM_ORDER_ARCHIVE_CREATE
IVIORA - Table of Orders to be Archived
Data type: VIORAOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
ARCHIVING_ERROR_OF_ITAB -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NOT_FOUND -
Data type:Optional: No
Call by Reference: Yes
NO_AUTHORITY -
Data type:Optional: No
Call by Reference: Yes
OTHERS -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for PM_ORDER_ARCHIVE_CREATE 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_iviora | TYPE STANDARD TABLE OF VIORA, " | |||
| lv_archive_handle | TYPE SY-TABIX, " | |||
| lv_archiving_error_of_itab | TYPE SY, " | |||
| lv_not_found | TYPE SY, " | |||
| lv_delete_flag | TYPE RC27X-FLG_SEL, " 'X' | |||
| lv_hiko_create | TYPE RC27X-FLG_SEL, " 'X' | |||
| lv_no_authority | TYPE RC27X, " | |||
| lv_others | TYPE RC27X, " | |||
| lv_package_size | TYPE COARCH-DBNUM, " 10 | |||
| lv_p_snap | TYPE ILM_WRITE_SNAP, " | |||
| lv_p_dest | TYPE ILM_WRITE_DEST. " |
|   CALL FUNCTION 'PM_ORDER_ARCHIVE_CREATE' "PM Order: Create archive |
| EXPORTING | ||
| ARCHIVE_HANDLE | = lv_archive_handle | |
| DELETE_FLAG | = lv_delete_flag | |
| HIKO_CREATE | = lv_hiko_create | |
| PACKAGE_SIZE | = lv_package_size | |
| P_SNAP | = lv_p_snap | |
| P_DEST | = lv_p_dest | |
| TABLES | ||
| IVIORA | = lt_iviora | |
| EXCEPTIONS | ||
| ARCHIVING_ERROR_OF_ITAB = 1 | ||
| NOT_FOUND = 2 | ||
| NO_AUTHORITY = 3 | ||
| OTHERS = 4 | ||
| . " PM_ORDER_ARCHIVE_CREATE | ||
ABAP code using 7.40 inline data declarations to call FM PM_ORDER_ARCHIVE_CREATE
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 TABIX FROM SY INTO @DATA(ld_archive_handle). | ||||
| "SELECT single FLG_SEL FROM RC27X INTO @DATA(ld_delete_flag). | ||||
| DATA(ld_delete_flag) | = 'X'. | |||
| "SELECT single FLG_SEL FROM RC27X INTO @DATA(ld_hiko_create). | ||||
| DATA(ld_hiko_create) | = 'X'. | |||
| "SELECT single DBNUM FROM COARCH INTO @DATA(ld_package_size). | ||||
| DATA(ld_package_size) | = 10. | |||
Search for further information about these or an SAP related objects