SAP C14SX_BAPI_DOC_CREATE2 Function Module for NOTRANSL: EHS: Dokument anlegen
C14SX_BAPI_DOC_CREATE2 is a standard c14sx bapi doc create2 SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: EHS: Dokument anlegen 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 c14sx bapi doc create2 FM, simply by entering the name C14SX_BAPI_DOC_CREATE2 into the relevant SAP transaction such as SE37 or SE38.
Function Group: C14SX
Program Name: SAPLC14SX
Main Program: SAPLC14SX
Appliation area: C
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function C14SX_BAPI_DOC_CREATE2 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 'C14SX_BAPI_DOC_CREATE2'"NOTRANSL: EHS: Dokument anlegen.
EXPORTING
DOCUMENTDATA = "Document Data
* HOSTNAME = "Name of Front End
* DOCBOMCHANGENUMBER = "Change Number
* DOCBOMVALIDFROM = "Valid-From Date
* DOCBOMREVISIONLEVEL = "Revision Level
* CAD_MODE = ' ' "CAD FLag for Document Structure
* PF_FTP_DEST = ' ' "Logical Destination (Specified when Calling Function)
* PF_HTTP_DEST = ' ' "Logical Destination (Specified when Calling Function)
* I_API_HEADER = "EHS: Report Header
IMPORTING
DOCUMENTTYPE = "Document Type
DOCUMENTNUMBER = "Document Number
DOCUMENTPART = "Document Part
DOCUMENTVERSION = "Document Version
RETURN = "Return Structure
TABLES
* CHARACTERISTICVALUES = "Assigned Characteristic Values
* CLASSALLOCATIONS = "Classifications
* DOCUMENTDESCRIPTIONS = "Descriptions
* OBJECTLINKS = "Object links
* DOCUMENTSTRUCTURE = "Document-Based Structure
* DOCUMENTFILES = "Originals
* LONGTEXTS = "Long Texts
* COMPONENTS = "Additional Files for Originals (in future development)
IMPORTING Parameters details for C14SX_BAPI_DOC_CREATE2
DOCUMENTDATA - Document Data
Data type: BAPI_DOC_DRAW2Optional: No
Call by Reference: No ( called with pass by value option)
HOSTNAME - Name of Front End
Data type: BAPI_DOC_AUX-HOSTNAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
DOCBOMCHANGENUMBER - Change Number
Data type: BAPI_DOC_DRAW2-ECNUMBEROptional: Yes
Call by Reference: No ( called with pass by value option)
DOCBOMVALIDFROM - Valid-From Date
Data type: BAPI_DOC_DRAW2-VALIDFROMDATEOptional: Yes
Call by Reference: No ( called with pass by value option)
DOCBOMREVISIONLEVEL - Revision Level
Data type: BAPI_DOC_DRAW2-REVLEVELOptional: Yes
Call by Reference: No ( called with pass by value option)
CAD_MODE - CAD FLag for Document Structure
Data type: CSDATA-XFELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PF_FTP_DEST - Logical Destination (Specified when Calling Function)
Data type: RFCDES-RFCDESTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PF_HTTP_DEST - Logical Destination (Specified when Calling Function)
Data type: RFCDES-RFCDESTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_API_HEADER - EHS: Report Header
Data type: ESPRE_APIDH_WA_TYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for C14SX_BAPI_DOC_CREATE2
DOCUMENTTYPE - Document Type
Data type: BAPI_DOC_AUX-DOCTYPEOptional: No
Call by Reference: No ( called with pass by value option)
DOCUMENTNUMBER - Document Number
Data type: BAPI_DOC_AUX-DOCNUMBEROptional: No
Call by Reference: No ( called with pass by value option)
DOCUMENTPART - Document Part
Data type: BAPI_DOC_AUX-DOCPARTOptional: No
Call by Reference: No ( called with pass by value option)
DOCUMENTVERSION - Document Version
Data type: BAPI_DOC_AUX-DOCVERSIONOptional: No
Call by Reference: No ( called with pass by value option)
RETURN - Return Structure
Data type: BAPIRET2Optional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for C14SX_BAPI_DOC_CREATE2
CHARACTERISTICVALUES - Assigned Characteristic Values
Data type: BAPI_CHARACTERISTIC_VALUESOptional: Yes
Call by Reference: No ( called with pass by value option)
CLASSALLOCATIONS - Classifications
Data type: BAPI_CLASS_ALLOCATIONOptional: Yes
Call by Reference: No ( called with pass by value option)
DOCUMENTDESCRIPTIONS - Descriptions
Data type: BAPI_DOC_DRATOptional: Yes
Call by Reference: No ( called with pass by value option)
OBJECTLINKS - Object links
Data type: BAPI_DOC_DRADOptional: Yes
Call by Reference: No ( called with pass by value option)
DOCUMENTSTRUCTURE - Document-Based Structure
Data type: BAPI_DOC_STRUCTUREOptional: Yes
Call by Reference: No ( called with pass by value option)
DOCUMENTFILES - Originals
Data type: BAPI_DOC_FILES2Optional: Yes
Call by Reference: No ( called with pass by value option)
LONGTEXTS - Long Texts
Data type: BAPI_DOC_TEXTOptional: Yes
Call by Reference: No ( called with pass by value option)
COMPONENTS - Additional Files for Originals (in future development)
Data type: BAPI_DOC_COMPOptional: Yes
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for C14SX_BAPI_DOC_CREATE2 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_documentdata | TYPE BAPI_DOC_DRAW2, " | |||
| lv_documenttype | TYPE BAPI_DOC_AUX-DOCTYPE, " | |||
| lt_characteristicvalues | TYPE STANDARD TABLE OF BAPI_CHARACTERISTIC_VALUES, " | |||
| lv_hostname | TYPE BAPI_DOC_AUX-HOSTNAME, " | |||
| lv_documentnumber | TYPE BAPI_DOC_AUX-DOCNUMBER, " | |||
| lt_classallocations | TYPE STANDARD TABLE OF BAPI_CLASS_ALLOCATION, " | |||
| lv_documentpart | TYPE BAPI_DOC_AUX-DOCPART, " | |||
| lv_docbomchangenumber | TYPE BAPI_DOC_DRAW2-ECNUMBER, " | |||
| lt_documentdescriptions | TYPE STANDARD TABLE OF BAPI_DOC_DRAT, " | |||
| lt_objectlinks | TYPE STANDARD TABLE OF BAPI_DOC_DRAD, " | |||
| lv_docbomvalidfrom | TYPE BAPI_DOC_DRAW2-VALIDFROMDATE, " | |||
| lv_documentversion | TYPE BAPI_DOC_AUX-DOCVERSION, " | |||
| lv_return | TYPE BAPIRET2, " | |||
| lt_documentstructure | TYPE STANDARD TABLE OF BAPI_DOC_STRUCTURE, " | |||
| lv_docbomrevisionlevel | TYPE BAPI_DOC_DRAW2-REVLEVEL, " | |||
| lv_cad_mode | TYPE CSDATA-XFELD, " SPACE | |||
| lt_documentfiles | TYPE STANDARD TABLE OF BAPI_DOC_FILES2, " | |||
| lt_longtexts | TYPE STANDARD TABLE OF BAPI_DOC_TEXT, " | |||
| lv_pf_ftp_dest | TYPE RFCDES-RFCDEST, " SPACE | |||
| lt_components | TYPE STANDARD TABLE OF BAPI_DOC_COMP, " | |||
| lv_pf_http_dest | TYPE RFCDES-RFCDEST, " SPACE | |||
| lv_i_api_header | TYPE ESPRE_APIDH_WA_TYPE. " |
|   CALL FUNCTION 'C14SX_BAPI_DOC_CREATE2' "NOTRANSL: EHS: Dokument anlegen |
| EXPORTING | ||
| DOCUMENTDATA | = lv_documentdata | |
| HOSTNAME | = lv_hostname | |
| DOCBOMCHANGENUMBER | = lv_docbomchangenumber | |
| DOCBOMVALIDFROM | = lv_docbomvalidfrom | |
| DOCBOMREVISIONLEVEL | = lv_docbomrevisionlevel | |
| CAD_MODE | = lv_cad_mode | |
| PF_FTP_DEST | = lv_pf_ftp_dest | |
| PF_HTTP_DEST | = lv_pf_http_dest | |
| I_API_HEADER | = lv_i_api_header | |
| IMPORTING | ||
| DOCUMENTTYPE | = lv_documenttype | |
| DOCUMENTNUMBER | = lv_documentnumber | |
| DOCUMENTPART | = lv_documentpart | |
| DOCUMENTVERSION | = lv_documentversion | |
| RETURN | = lv_return | |
| TABLES | ||
| CHARACTERISTICVALUES | = lt_characteristicvalues | |
| CLASSALLOCATIONS | = lt_classallocations | |
| DOCUMENTDESCRIPTIONS | = lt_documentdescriptions | |
| OBJECTLINKS | = lt_objectlinks | |
| DOCUMENTSTRUCTURE | = lt_documentstructure | |
| DOCUMENTFILES | = lt_documentfiles | |
| LONGTEXTS | = lt_longtexts | |
| COMPONENTS | = lt_components | |
| . " C14SX_BAPI_DOC_CREATE2 | ||
ABAP code using 7.40 inline data declarations to call FM C14SX_BAPI_DOC_CREATE2
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 DOCTYPE FROM BAPI_DOC_AUX INTO @DATA(ld_documenttype). | ||||
| "SELECT single HOSTNAME FROM BAPI_DOC_AUX INTO @DATA(ld_hostname). | ||||
| "SELECT single DOCNUMBER FROM BAPI_DOC_AUX INTO @DATA(ld_documentnumber). | ||||
| "SELECT single DOCPART FROM BAPI_DOC_AUX INTO @DATA(ld_documentpart). | ||||
| "SELECT single ECNUMBER FROM BAPI_DOC_DRAW2 INTO @DATA(ld_docbomchangenumber). | ||||
| "SELECT single VALIDFROMDATE FROM BAPI_DOC_DRAW2 INTO @DATA(ld_docbomvalidfrom). | ||||
| "SELECT single DOCVERSION FROM BAPI_DOC_AUX INTO @DATA(ld_documentversion). | ||||
| "SELECT single REVLEVEL FROM BAPI_DOC_DRAW2 INTO @DATA(ld_docbomrevisionlevel). | ||||
| "SELECT single XFELD FROM CSDATA INTO @DATA(ld_cad_mode). | ||||
| DATA(ld_cad_mode) | = ' '. | |||
| "SELECT single RFCDEST FROM RFCDES INTO @DATA(ld_pf_ftp_dest). | ||||
| DATA(ld_pf_ftp_dest) | = ' '. | |||
| "SELECT single RFCDEST FROM RFCDES INTO @DATA(ld_pf_http_dest). | ||||
| DATA(ld_pf_http_dest) | = ' '. | |||
Search for further information about these or an SAP related objects