Fonction SAP BAPI_DOCUMENT_CHECKIN - Check Document In

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
DOCUMENTNUMBER BAPI_DOC_AUX-DOCNUMBER C 25 Document number
DOCUMENTPART BAPI_DOC_AUX-DOCPART C 3 Document Part
DOCUMENTTYPE BAPI_DOC_AUX-DOCTYPE C 3 Document Type
DOCUMENTVERSION BAPI_DOC_AUX-DOCVERSION C 2 Document Version
HOSTNAME BAPI_DOC_AUX-HOSTNAME C 20 SPACE X Name of Frontend
STATUSEXTERN BAPI_DOC_DRAW-STATUSEXTERN C 2 SPACE X External Status
STATUSINTERN BAPI_DOC_DRAW-STATUSINTERN C 2 SPACE X Internal Status
STATUSLOG BAPI_DOC_DRAW-STATUSLOG C 20 SPACE X Status Log Entry

Paramètre Reférence Type Long. Description
RETURN BAPIRET2 u 548 BAPI Return

Paramètre Reférence Long. Facultatif Description
DOCUMENTFILES BAPI_DOC_FILES 336 Originals to Check In
DOCUMENTSTRUCTURE BAPI_DOC_STRUCTURE 64 X Document-Based Structure

Functionality

This function module is obsolete. Use Bapi_Document_Change2instead.
This function module is out of date. Use Bapi_Document_Checkin2.
You can use this method to check a document into an archive, a vault, orthe SAP database. You can check both original application files (1 and2) in at the same time.
When you check a document in, you can set a new status.
Restrictions:

  • Additional files are not supported

  • **..... Document key
    DATA: lf_doctype LIKE bapi_doc_draw-documenttype,
    lf_docnumber LIKE bapi_doc_draw-documentnumber,
    lf_docpart LIKE bapi_doc_draw-documentpart,
    lf_docversion LIKE bapi_doc_draw-documentversion,
    lf_status LIKE bapi_doc_draw-statusextern,
    **.... Bapi return structure
    ls_return LIKE bapiret2.
    **.... Originals
    DATA: lt_files LIKE bapi_doc_files OCCURS 0 WITH HEADER LINE.
    **----------------------------------------------------------------------
    ** Allocate document data
    lf_doctype = 'DRW'.
    lf_docnumber = '4711'.
    lf_docversion = '000'.
    lf_docpart = '00'.
    lf_status = 'RE'.
    ** Check original 1 into the SAP database
    REFRESH lt_files.
    CLEAR lt_files.
    lt_files-originaltype = '1'. " Original 1
    lt_files-datacarrier = 'SAP-SYSTEM'. " Check in = SAPDB
    lt_files-docfile = 'c:\temp\drawing1.dwg'. " Original file
    APPEND lt_files.
    **----------------------------------------------------------------------
    ** Check in document
    **----------------------------------------------------------------------
    CALL FUNCTION 'BAPI_DOCUMENT_CHECKIN'
    EXPORTING: documenttype = lf_doctype
    documentnumber = lf_docnumber
    documentpart = lf_docpart
    documentversion = lf_docversion
    hostname = ''
    statusintern = ''
    statusextern = lf_status
    statuslog = ''
    IMPORTING: return = ls_return
    TABLES: documentfiles = lt_files.
    ** Error occurred ??
    IF ls_return-type CA 'EA'.
    ROLLBACK WORK.
    MESSAGE ID '26' TYPE 'I' NUMBER '000'
    WITH ls_return-message.
    ELSE.
    COMMIT WORK.
    ENDIF.

    Description
    Return structure for messages.

    Description
    Computer name of the front end computer that the BAPI is called from.This is only necessary if the function module call takes place from anexternal system. The appropriate front end type is determined from DMSCustomizing using this computer name.

    Description
    New (external) status abbreviation for the document.
    If the internal status is transferred, it always has priority over the
    external status abbreviation.

    Description
    New (internal) status for the document.
    If the internal status is transferred, it always has priority over the
    external status abbreviation.

    Description
    Entry in the status log.

    Description

    Originals for document
    You can check in originals 1 and 2 at the same time. The ORIGINALTYPEparameter controls whether original 1 or 2 is checked in.
    ORIGINALTYPE: original 1 or original 2
    SOURCEDATACARRIER: data carrier name of server where the original isstored
    DATACARRIER: name of data carrier where the original is to be checkedin. The function module uses the data carrier name to determine thestorage location, that is, the SAP database, vault, or archive
    DOCFILE: file name of original
    WSAPPLICATION: name of the work station application. This is a requiredentry if no work station application has been allocated to the documentinfo record, or if the new original is of a different type.
    STATUSINTERN: New (internal) status for the document after check-in.
    STATUSEXTERN: New (external) status for the document after check-in.
    If the internal status is copied, it always has priority. Otherwise theexternal status abbreviation is read.

    Description
    Document structure for document
    You can use this to represent document structures for a headerdocument, for example assembly structures for 3D models. A documentstructure is always copied comnpletely. This means that an existingstructure is always overwritten with the new one. If you want to deletespecific items in a structure or BOM, you must explicitly set the"DELETEVALUE" deletion indicator for the item(s) in question.
    All the documents that are copied in the structure must have already