Posted: Mon Dec 22, 2008 11:47 am Post subject: BAPI_DOCUMENT_CREATE2
BAPI_DOCUMENT_CREATE2 - Create document
Functionality
You can use this function module to create documents and all data that belongs to it. You can create a document info
record with the following data:
Langauge dependent short and long texts Any number of originals Object links Classification characteristics
Document structures
You can also check in the original application files into the R/3 Database, vault, or archive.
Restrictions:
Additional files supported only as interface parameters COMPONENTS for future development. Valuations of
object links are not supported.
Code:
**..... Document data
DATA: ls_doc LIKE bapi_doc_draw2.
**..... Bapi-Returnstruktur
ls_return LIKE bapiret2.
**.... Key feilds of the document
DATA: lf_doctype LIKE bapi_doc_draw2-documenttype,
lf_docnumber LIKE bapi_doc_draw2-documentnumber,
lf_docpart LIKE bapi_doc_draw2-documenttype,
lf_docversion LIKE bapi_doc_draw2-documenttype.
**.... Originals that are checked in simultaneously
DATA: lt_files LIKE bapi_doc_files2 OCCURS 0 WITH HEADER LINE,
**.... Short texts
lt_drat LIKE bapi_doc_drat OCCURS 0 WITH HEADER LINE,
**.... Object links
lt_drad LIKE bapi_doc_drad OCCURS 0 WITH HEADER LINE.
**----------------------------------------------------------------------
** Did an error occur ??
IF ls_return-type CA 'EA'.
ROLLBACK WORK.
MESSAGE ID '26' TYPE 'I' NUMBER '000'
WITH ls_return-message.
ELSE.
COMMIT WORK.
ENDIF.
Notes
You can insert the following data in addition to document data:
Object links Classifications and characteristic valuation Language dependent document descriptions Long text
documents Document structure Originals
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.