SAP DOCB_DOCUMENT_SAVE Function Module for Save Document









DOCB_DOCUMENT_SAVE is a standard docb document save 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 docb document save FM, simply by entering the name DOCB_DOCUMENT_SAVE 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 DOCB_DOCUMENT_SAVE 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 'DOCB_DOCUMENT_SAVE'"Save Document
EXPORTING
PIV_DOC_BINARY = "The WML
PIV_DOC_XML = "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 DOCB_DOCUMENT_SAVE

PIV_DOC_BINARY - The WML

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

PIV_DOC_XML - 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: Yes
Call by Reference: No ( called with pass by value option)

PIT_AUTH_ORGS - Authorized organizations

Data type: /IPRO/TT_KEY_VALUE_PAIR
Optional: Yes
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: Yes
Call by Reference: No ( called with pass by value option)

PIT_APPROVERS - WF Approvers

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

EXPORTING Parameters details for DOCB_DOCUMENT_SAVE

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 DOCB_DOCUMENT_SAVE

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 DOCB_DOCUMENT_SAVE 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_pcv_dochdr  TYPE /IPRO/SDOCUMENT_DETAILS, "   
lv_pev_doc_id  TYPE /IPRO/TDOCMNT-DOCMNT, "   
lv_piv_doc_binary  TYPE XSTRING, "   
lv_pet_message  TYPE BAPIRET2_T, "   
lv_piv_doc_xml  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 'DOCB_DOCUMENT_SAVE'  "Save Document
    EXPORTING
         PIV_DOC_BINARY = lv_piv_doc_binary
         PIV_DOC_XML = lv_piv_doc_xml
         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
. " DOCB_DOCUMENT_SAVE




ABAP code using 7.40 inline data declarations to call FM DOCB_DOCUMENT_SAVE

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!