Fonction SAP BAPI_SRM_DOC_CHECKIN_CONT_TAB - SRM BAPI: Set Document Content in Tables with Length 255

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
AS_NEW_VERSION BAPISRMDOC-BOOLEAN C 1 X 'X': Check In as New Version
DOCUMENTCLASS BAPISRMDOC-DOCCLASS C 10 '' Location of Document
DOC_CONTEXT BAPIDOCCONTEXT u 64 X Access Context: RMS ID and SPS ID
DO_COMMIT BAPISRMDOC-BOOLEAN C 1 X 'X': Commit by Checkin
OBJECTID BAPISRMDOC-GUID C 32 Internal Document ID

Paramètre Reférence Type Long. Description
RETURN BAPIRET2 u 548 Return Parameter
X_NEW_DOC_CREATED BAPISRMDOC-BOOLEAN C 1 'X': Check In Content for New Document

Paramètre Reférence Long. Facultatif Description
ASCII_CONTENT BAPIASCONT255 255 X ASCII Content
BIN_CONTENT BAPICONTENT255 255 X Binary Content
COMPONENTS BAPIDOCCOMP 400 Document Components

Functionality
Transfers the content of a document to the Records Managementback end by specifying internal tables. The document content issent in tables with a row length of 255.
Note:

  • If the document contains more than one file, then the content of
  • all components can be transported in text format or binary formatonly. A new component must always start with a new row in the tableASCII_CONTENT or BIN_CONTENT. A parameter error exception is raisedif bothASCII_CONTENT and BIN_CONTENT are filled when a function is called.
    • The file size must be specified.
    • It is specified with the field COMP_SIZE of thestructure BAPIDOCCOMP. The file size is always given in bytes.

      Example
      DATA:
      objectid TYPE bapisrmdoc-guid,
      documentclass TYPE bapisrmdoc-docclass,
      wa_comp TYPE bapidoccomp,
      lt_comp TYPE TABLE OF bapidoccomp,
      wa_bin TYPE bapicontent255,
      it_bin TYPE TABLE OF bapicontent255,
      wa_ascii TYPE bapiascont255,
      lt_ascii TYPE TABLE of bapiascont255.
      ...
      * ASCII content
      * Specifies in which order a component appears in the content table
      * The field comp_count is not saved persistently in the backendrepository.
      wa_comp-comp_count = 1.
      wa_comp-comp_id = 'my.txt'.
      wa_comp-mimetype = 'text/plain'. " Always lowercase
      wa_comp-comp_size = filelen. "File size in bytes
      wa_comp-binary_flag = ''.
      * Numbering of a component in the document, saved persistently in thebackend repository
      wa_comp-com_num = 1.
      append wa_comp to lt_comp.
      wa_ascii-line = 'This is my first text'.
      append wa_ascii to lt_ascii.
      CALL FUNCTION 'BAPI_SRM_DOC_CHECKIN_VIA_TAB'
      EXPORTING
      objectid = objectid
      documentclass = documentclass
      as_new_version = 'X' " Create new logical version
      do_commit = 'X'
      * IMPORTING
      * return = return
      TABLES
      components = lt_comp
      ascii_content = lt_ascii
      .
      * Binary content
      wa_comp-comp_count = 1.
      wa_comp-comp_id = 'my_ms.doc'.
      wa_comp-mimetype = 'application/msword'. " Must be lowercase
      wa_comp-comp_size = filelen. "File sizes in bytes
      wa_comp-binary_flag = 'X'.
      wa_comp-com_num = 1.
      APPEND wa_comp TO lt_comp.
      wa_bin-line = bin_line.
      APPEND wa_bin TO lt_bin.
      CALL FUNCTION 'BAPI_SRM_DOC_CHECKIN_VIA_TAB'
      EXPORTING
      objectid = objectid
      documentclass = documentclass
      as_new_version = 'X' " Create new logical version
      do_commit = 'X'
      * IMPORTING
      * return = return
      TABLES
      components = lt_comp
      bin_content = lt_bin
      .

      Description
      Result of the BAPI call

      Description
      This field is set to 'X' if the content of a new document is beingchecked in for the first time. The document did not have aprevious physical version, and therefore no content.

      Description
      This parameter is optional.
      If you set an "X", a new logical version is created and the content ischecked in for this new version.
      If you set an empty space, the content of the current version isoverwritten.

      Description
      Storage location of the document (content model)

      Description
      Context for accessing documents. If the document is stored on a WebDAVserver, you must specify the RMS ID and SPS ID in the document context.

      Description
      'X': Execute commit work after the document has been checked in
      '': no commit

      Description
      Internal ID of the document

      Description
      Table for document content in ASCII format

      Description
      Table for document content in binary format

      Description
      Table for describing the components of the document
      comp_count: Specifies the order of the components in the specifiedcontent table. This field is not saved persistently in the back-endrepository.
      comp_id: Name of the component
      mimetype: MIME type
      comp_size: File size of the component in bytes
      binary_flag: 'X' - Component has binary format; ' ' - ASCII format
      comp_num: Numbering of the component in the document. Savedpersistently in the back-end repository.

      Value range
      Suggestion: When you check in a document, we recommend thatfor each componentyou give the fields comp_count and comp_num the same number.