Fonction SAP BAPI_DOCUMENT_CHECKOUTVIEW - Check out document for display

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
DOCUMENTNUMBER BAPI_DOC_AUX-DOCNUMBER C 25 Document Number of Header Document
DOCUMENTPART BAPI_DOC_AUX-DOCPART C 3 Document Part of Header Document
DOCUMENTTYPE BAPI_DOC_AUX-DOCTYPE C 3 Document Type of Header Document
DOCUMENTVERSION BAPI_DOC_AUX-DOCVERSION C 2 Document Version of Header Document
GETHEADER BAPI_DOC_AUX-FLAG C 1 'X' X Check out header document
GETSTRUCTURE BAPI_DOC_AUX-FLAG C 1 '1' X Check Out Document-Based Structure (0,1,2)
HOSTNAME BAPI_DOC_AUX-HOSTNAME C 20 SPACE X Name of Frontend
ORIGINALPATH BAPI_DOC_AUX-FILENAME C 255 SPACE X Path Where You Want to Check In Originals
ORIGINALTYPE BAPI_DOC_AUX-FLAG C 1 Original Number (1,2)

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 X Which Files Have Been Checked Out?
DOCUMENTSTRUCTURE BAPI_DOC_STRUCTURE 64 X Document-Based Structure (Check-Out Restrictions)

Functionality
You can use this method to check out a document and any existingdocument structure for display.
You can use the "GetStructure" button if you want to check out thedocument structure aswell. The "DocumentStructure" table is used todefine how many documents should be checked out in the documentstructure (certain documents may be checked out in current status).When the documents are transferred to the function module using the"DocumentStructure" table, only the documents that you have preselectedare checked out.
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-documenttype,
    lf_docversion LIKE bapi_doc_draw-documenttype,
    lf_pathname LIKE bapi_doc_draw-docfile1,
    **.... Bapi return structure
    ls_return LIKE bapiret2.
    **.... Originals that have been checked out
    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'.
    REFRESH lt_files.
    CLEAR lt_files.
    ** Define path where file is stored
    lf_pathname = 'c:\temp\'.
    ** Check out document (original 1) for viewing
    CALL FUNCTION 'BAPI_DOCUMENT_CHECKOUTVIEW'
    EXPORTING: documenttype = lf_doctype
    documentnumber = lf_docnumber
    documentpart = lf_docpart
    documentversion = lf_docversion
    originaltype = '1'
    getstructure = '1'
    originalpath = lf_pathname
    hostname = ' '
    IMPORTING: return = ls_return
    TABLES: documentfiles = lt_files.
    ** Errors 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
    Document structure with checking out
    - GetStructure = 0 document structure is not taken into account
    - GetStructure = 1 document structure is exploded on one level
    - GetStructure = 2 document structure is completely exploded

    Description
    Name of the front end computer that the BAPI is called from.
    You only need this if the function module call takesplace from anexternal system. The appropriate front end type is determined from DMSCustomizing using this computer name.

    Description
    Path or data carrier name of a server where the document is to bestored. If a document is checked out with a document structure, all thedocuments are stored under this path.
    You can only enter the directory here.

    Description
    Original that is to be checked out (1 or 2).

    Description
    Originals that have been checked out
    The document files table is filled with the data of the originals thathave been checked out. This means that the programmer can check whathas been checked out. If a document in the structure has not beenchecked in, the absolute file name showing where the file can be foundis here.

    Description
    Explicit entry determining which documents should be checked out.
    If a document structure exists for the document, you can use this todefine which documents are also checked out.
    - Document number = "" -> Check out all documents
    (according to the explosion level)
    - Document number = defined -> Check out documents entered
    Only if "GetStructure" is set appropriately.