API_DOCUMENT_CREATEFROMSRC2 is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.
See here to view full function module documentation and code listing, simply by entering the name API_DOCUMENT_CREATEFROMSRC2 into the relevant SAP transaction such as SE37 or SE80.
Associated Function Group:
CVBAPI
Released Date:
Not Released
Processing type: Remote-Enabled
CALL FUNCTION 'API_DOCUMENT_CREATEFROMSRC2' "
EXPORTING
refdocumenttype = " bapi_doc_aux-doctype
refdocumentnumber = " bapi_doc_aux-docnumber
refdocumentpart = " bapi_doc_aux-docpart
refdocumentversion = " bapi_doc_aux-docversion
* newdocumenttype = " bapi_doc_aux-doctype
newdocumentnumber = " bapi_doc_aux-docnumber
newdocumentpart = " bapi_doc_aux-docpart
newdocumentversion = " bapi_doc_aux-docversion
* newdescription = " bapi_doc_draw2-description
* statusintern = " bapi_doc_draw-statusintern
* statusextern = " bapi_doc_draw-statusextern
* statuslog = " bapi_doc_draw-statuslog
* revlevel = " bapi_doc_draw2-revlevel
* aennr = " bapi_doc_draw2-ecnumber
* copyclassification = " bapi_doc_aux-flag
* copyoriginals = 'X' " bapi_doc_aux-flag
* copydocbom = 'X' " bapi_doc_aux-flag
* docbomchangenumberread = " bapi_doc_draw2-ecnumber
* docbomvalidfromread = " bapi_doc_draw2-validfromdate
* docbomrevlevelread = " bapi_doc_draw2-revlevel
* docbomchangenumberwrite = " bapi_doc_draw2-ecnumber
* docbomvalidfromwrite = " bapi_doc_draw2-validfromdate
* docbomrevlevelwrite = " bapi_doc_draw2-revlevel
IMPORTING
doctype = " bapi_doc_aux-doctype
docnumber = " bapi_doc_aux-docnumber
docpart = " bapi_doc_aux-docpart
docversion = " bapi_doc_aux-docversion
return = " bapiret2
* TABLES
* copyobjectlinks = " bapi_doc_drad_select
. " API_DOCUMENT_CREATEFROMSRC2
The ABAP code below is a full code listing to execute function module API_DOCUMENT_CREATEFROMSRC2 including all data declarations. The code uses 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 original method of declaring data variables up front. 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).
| ld_doctype | TYPE BAPI_DOC_AUX-DOCTYPE , |
| ld_docnumber | TYPE BAPI_DOC_AUX-DOCNUMBER , |
| ld_docpart | TYPE BAPI_DOC_AUX-DOCPART , |
| ld_docversion | TYPE BAPI_DOC_AUX-DOCVERSION , |
| ld_return | TYPE BAPIRET2 , |
| it_copyobjectlinks | TYPE STANDARD TABLE OF BAPI_DOC_DRAD_SELECT,"TABLES PARAM |
| wa_copyobjectlinks | LIKE LINE OF it_copyobjectlinks . |
The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.
DATA:
| ld_doctype | TYPE BAPI_DOC_AUX-DOCTYPE , |
| ld_refdocumenttype | TYPE BAPI_DOC_AUX-DOCTYPE , |
| it_copyobjectlinks | TYPE STANDARD TABLE OF BAPI_DOC_DRAD_SELECT , |
| wa_copyobjectlinks | LIKE LINE OF it_copyobjectlinks, |
| ld_docnumber | TYPE BAPI_DOC_AUX-DOCNUMBER , |
| ld_refdocumentnumber | TYPE BAPI_DOC_AUX-DOCNUMBER , |
| ld_docpart | TYPE BAPI_DOC_AUX-DOCPART , |
| ld_refdocumentpart | TYPE BAPI_DOC_AUX-DOCPART , |
| ld_docversion | TYPE BAPI_DOC_AUX-DOCVERSION , |
| ld_refdocumentversion | TYPE BAPI_DOC_AUX-DOCVERSION , |
| ld_return | TYPE BAPIRET2 , |
| ld_newdocumenttype | TYPE BAPI_DOC_AUX-DOCTYPE , |
| ld_newdocumentnumber | TYPE BAPI_DOC_AUX-DOCNUMBER , |
| ld_newdocumentpart | TYPE BAPI_DOC_AUX-DOCPART , |
| ld_newdocumentversion | TYPE BAPI_DOC_AUX-DOCVERSION , |
| ld_newdescription | TYPE BAPI_DOC_DRAW2-DESCRIPTION , |
| ld_statusintern | TYPE BAPI_DOC_DRAW-STATUSINTERN , |
| ld_statusextern | TYPE BAPI_DOC_DRAW-STATUSEXTERN , |
| ld_statuslog | TYPE BAPI_DOC_DRAW-STATUSLOG , |
| ld_revlevel | TYPE BAPI_DOC_DRAW2-REVLEVEL , |
| ld_aennr | TYPE BAPI_DOC_DRAW2-ECNUMBER , |
| ld_copyclassification | TYPE BAPI_DOC_AUX-FLAG , |
| ld_copyoriginals | TYPE BAPI_DOC_AUX-FLAG , |
| ld_copydocbom | TYPE BAPI_DOC_AUX-FLAG , |
| ld_docbomchangenumberread | TYPE BAPI_DOC_DRAW2-ECNUMBER , |
| ld_docbomvalidfromread | TYPE BAPI_DOC_DRAW2-VALIDFROMDATE , |
| ld_docbomrevlevelread | TYPE BAPI_DOC_DRAW2-REVLEVEL , |
| ld_docbomchangenumberwrite | TYPE BAPI_DOC_DRAW2-ECNUMBER , |
| ld_docbomvalidfromwrite | TYPE BAPI_DOC_DRAW2-VALIDFROMDATE , |
| ld_docbomrevlevelwrite | TYPE BAPI_DOC_DRAW2-REVLEVEL . |
Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name API_DOCUMENT_CREATEFROMSRC2 or its description.