SAP /IPRO/SAVE_DOCUMENT Function Module for Save Document









/IPRO/SAVE_DOCUMENT is a standard /ipro/save document SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Save Document 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 /ipro/save document FM, simply by entering the name /IPRO/SAVE_DOCUMENT into the relevant SAP transaction such as SE37 or SE38.

Function Group: /IPRO/BUSINESS_OBJECT
Program Name: /IPRO/SAPLBUSINESS_OBJECT
Main Program: /IPRO/SAPLBUSINESS_OBJECT
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function /IPRO/SAVE_DOCUMENT 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 '/IPRO/SAVE_DOCUMENT'"Save Document
EXPORTING
PIV_DOC = "The WML
PIV_DETAILS = "XML representing the document data
PIT_AUTH_USERS = "Authorized users
PIT_AUTH_ORGS = "Authorized organizations
PIV_ACTION = "3-Byte field
PIT_REVIEWERS = "WF reviewers
PIT_APPROVERS = "WF Approvers

IMPORTING
PEV_DOC_ID = "Globally Unique Identifier
PET_MESSAGE = "Return Parameter

CHANGING
PCV_DOCHDR = "Document Details
.



IMPORTING Parameters details for /IPRO/SAVE_DOCUMENT

PIV_DOC - The WML

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

PIV_DETAILS - XML representing the document data

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

PIT_AUTH_USERS - Authorized users

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

PIT_AUTH_ORGS - Authorized organizations

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

PIV_ACTION - 3-Byte field

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

PIT_REVIEWERS - WF reviewers

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

PIT_APPROVERS - WF Approvers

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

EXPORTING Parameters details for /IPRO/SAVE_DOCUMENT

PEV_DOC_ID - Globally Unique Identifier

Data type: /IPRO/TDOCMNT-DOCMNT
Optional: No
Call by Reference: No ( called with pass by value option)

PET_MESSAGE - Return Parameter

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

CHANGING Parameters details for /IPRO/SAVE_DOCUMENT

PCV_DOCHDR - Document Details

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

Copy and paste ABAP code example for /IPRO/SAVE_DOCUMENT 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_piv_doc  TYPE XSTRING, "   
lv_pcv_dochdr  TYPE /IPRO/SDOCUMENT_DETAILS, "   
lv_pev_doc_id  TYPE /IPRO/TDOCMNT-DOCMNT, "   
lv_pet_message  TYPE BAPIRET2_T, "   
lv_piv_details  TYPE XSTRING, "   
lv_pit_auth_users  TYPE /IPRO/TT_AUTH_USERS, "   
lv_pit_auth_orgs  TYPE /IPRO/TT_KEY_VALUE_PAIR, "   
lv_piv_action  TYPE CHAR3, "   
lv_pit_reviewers  TYPE /IPRO/TT_KEY_VALUE_PAIR, "   
lv_pit_approvers  TYPE /IPRO/TT_KEY_VALUE_PAIR. "   

  CALL FUNCTION '/IPRO/SAVE_DOCUMENT'  "Save Document
    EXPORTING
         PIV_DOC = lv_piv_doc
         PIV_DETAILS = lv_piv_details
         PIT_AUTH_USERS = lv_pit_auth_users
         PIT_AUTH_ORGS = lv_pit_auth_orgs
         PIV_ACTION = lv_piv_action
         PIT_REVIEWERS = lv_pit_reviewers
         PIT_APPROVERS = lv_pit_approvers
    IMPORTING
         PEV_DOC_ID = lv_pev_doc_id
         PET_MESSAGE = lv_pet_message
    CHANGING
         PCV_DOCHDR = lv_pcv_dochdr
. " /IPRO/SAVE_DOCUMENT




ABAP code using 7.40 inline data declarations to call FM /IPRO/SAVE_DOCUMENT

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 DOCMNT FROM /IPRO/TDOCMNT INTO @DATA(ld_pev_doc_id).
 
 
 
 
 
 
 
 


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!