VeloX Docs

Client-side plugins

Document Info Record plugin

Create or update SAP document info records (DIRs), including object links, classification, originals and long texts.

Overview

Document Info Record plugin can be found in SAP Targets tab on the left panel of Designer Section. Use it as a target to create new document info records (DIRs) in SAP Document Management or to update existing ones. The plugin header shows DIR.

It is a client (target) plugin: map fields from any source plugin of the project to it. For each record the plugin fills the DIR header and its objects (object links, classification, originals, document structures, components, descriptions, long texts) and sends them to SAP in one BAPI call.

Configuration

Click Connection on the plugin to open the Connection Parameters panel.

Application Server

To configure the plugin, on the Application Server tab fill the following fields:

  • Server Host
  • System Number
  • User
  • Password
  • Client
  • Language

Message Server

To connect through a message server, on the Message Server tab fill the following fields:

  • SID
  • Server Host
  • Logon Group
  • Server Service
  • User
  • Password
  • Client
  • Language

Connect

After you enter the connection parameters:

  1. Select the operation (see Operation settings).
  2. Click Connect.
  3. Select the DIR type from the list. The plugin structure is built for the selected document type.

On Connect the plugin reads the document types defined in SAP (tables TDWA and TDWAT, with descriptions in the logon Language). When you select a DIR type, the plugin reads:

  • the header fields of the DIR (structure BAPI_DOC_DRAW2). Fields that the document type defines as required in its field selection (for example description, document status, change number, authorization group) are marked as mandatory;
  • the object types that can be linked to this document type (BAPI_DOCUMENT_GETDOCTYPEDETAIL) and their key fields (table TCLO);
  • the class assigned to the document type, if there is one, with its characteristics.

Operation settings

Field Description
Operation Create New Document creates new DIRs. Update Existing Document changes existing DIRs.
Version Assigned Automatically Shown for Create New Document. SAP assigns the document version automatically. The option is available only when the selected document type allows automatic version assignment.
Ignore Document Status Shown for Update Existing Document. Updates the document even if its status would normally block changes (the plugin calls BAPI_DOCUMENT_LOAD).
DIR type Appears after you connect. The list shows each document type with its description.

Settings

Expand Settings in the Connection Parameters panel to change the SAP connection pool settings:

Field Description Default
IDLE_TIMEOUT Time after which an idle connection is closed. 2
POOL_SIZE Number of idle connections kept open in the pool. 10
MAX_POOL_SIZE Maximum number of connections that can be open at the same time. 100

Click Notes to add your own notes to the plugin.

Fields

Click Fields on the plugin and select the fields and objects you need:

Tab Content
Document data Header fields of the DIR (structure BAPI_DOC_DRAW2), for example document number, part, version and description. The document type is taken from the selected DIR type and isn't shown as a field.
Objects Object Links, Classifications, Originals, Doc Structures, Components, Descriptions, Longtexts and Additional Parameters.

Use Select Fields on an object item to choose its fields.

Each object is filled from the SAP structure of the matching BAPI table. Mandatory fields are shown on the canvas by default:

Object SAP structure Mandatory fields
Object Links BAPI_DOC_DRAD OBJECTKEY, DOCUMENTDIRECTION
Classifications BAPI_CHARACTERISTIC_VALUES CHARVALUE
Originals BAPI_DOC_FILES2 STORAGECATEGORY, DOCFILE
Doc Structures BAPI_DOC_STRUCTURE DOCUMENTTYPE, DOCUMENTNUMBER, DOCUMENTPART, DOCUMENTVERSION
Components BAPI_DOC_COMP DOCUMENTTYPE, DOCUMENTNUMBER, DOCUMENTPART, DOCUMENTVERSION
Descriptions BAPI_DOC_DRAT LANGUAGE, DESCRIPTION
Longtexts BAPI_DOC_TEXT LANGUAGE, TEXTLINE

Additional Parameters are passed as import parameters of the BAPI: ACCEPT_EMPTY_BOM, CAD_MODE, DOCBOMCHANGENUMBER, DOCBOMREVISIONLEVEL, DOCBOMVALIDFROM, PF_FTP_DEST, PF_HTTP_DEST and SENDCOMPLETEBOM. A parameter is sent only if the called BAPI has it.

The plugin also returns these export fields, which you can map to a target: DOCUMENTTYPE, DOCUMENTNUMBER, DOCUMENTPART and DOCUMENTVERSION of the processed DIR, and RETURN_NUMBER and RETURN_MESSAGE with the SAP message.

For Object Links, use Select Object Link to choose the linked object type. Only the object types allowed for the selected DIR type are listed. The object key fields of that object appear on the canvas. DOCUMENTDIRECTION is preset to the default value A with Ignore Source..

If the object key has more than one key field (for example a material with plant), choose how to fill it:

  • Multi-Field Key Mode: selected (the default): map each key field to its own source field.
  • Multi-Field Key Mode: cleared: map one source field that contains all key values, and enter in Separator: the character that separates them. The plugin splits the value at the separator and assigns the parts to the key fields in order.

In both cases the plugin builds the SAP object key from the key fields with BAPI_OBJCL_CONCATENATEKEY. A link whose object key is empty isn't sent.

Classification

For Classifications, use Select Class, check the Class Type: and Class Number:, and click Add Class. Then use Select Characteristic to choose the characteristics to fill. The characteristic details show whether it accepts single or multiple values and whether Interval Values Allowed applies.

The plugin reads the class and its characteristics from SAP when you add the class. At run time, every class that has at least one characteristic value is assigned to the document, and the values are passed with the class type, class number and characteristic name.

Originals

Map STORAGECATEGORY (the storage category, for example a content repository) and DOCFILE (full path of the file to check in). Rows with an empty DOCFILE are skipped when you create documents.

If WSAPPLICATION (workstation application) is empty, the plugin finds it from the file extension using the workstation application settings in SAP (table TDWP).

Long texts

A TEXTLINE value longer than 132 characters is split into several lines of up to 132 characters. Rows without text are skipped.

Field options

Import fields have these options:

Option Description
Default Value: A value to use instead of, or in addition to, the source value. Choose No Default Value., Ignore Source. (always use the default value) or Only If Source Empty. (use the default value only when the source value is empty). A D marker shows that a default value is set.
Convert To Upper Case: Converts the value to upper case. Marked with U.
Add Leading Zeros: Pads the value with leading zeros to the field length. Marked with Z. Selected by default for DOCUMENTNUMBER and ECNUMBER.

Mandatory fields are marked with M, for example OBJECTKEY for object links and STORAGECATEGORY and DOCFILE for originals. Export fields have a Remove Zeros: option that removes leading zeros from the returned value.

Project check

When the project is analyzed, the plugin reports an error if no DIR type is selected ("Select DIR Type."). With Create New Document, every mandatory field must be mapped to a source field or have a default value.

Run-time behavior

  • Create New Document calls BAPI_DOCUMENT_CREATE2. Update Existing Document calls BAPI_DOCUMENT_CHANGE2, or BAPI_DOCUMENT_LOAD when Ignore Document Status is selected. Changes are committed with BAPI_TRANSACTION_COMMIT.
  • The plugin checks whether the document exists with BAPI_DOCUMENT_EXISTENCECHECK:
    • With Update Existing Document (without Ignore Document Status), an existing document is changed and a document that doesn't exist yet is created.
    • With Create New Document (without Version Assigned Automatically), an existing document isn't changed. The entry fails with the message "Document ... exist."
    • With Version Assigned Automatically or Ignore Document Status, no existence check is made.
  • With Ignore Document Status, the plugin sets the FORCE_UPDATE flag of BAPI_DOCUMENT_LOAD. Doc Structures aren't sent in this mode.
  • When a document is updated, every document data field you added to the plugin is marked as changed. A field that is added but has no value for a record clears that field in SAP.
  • The commit is made only when the BAPI returns no error. The plugin waits for the update to finish before it continues.
  • When originals are sent, the plugin opens the SAP connection with SAP GUI support so that SAP can read the files.
  • In simulation mode, the plugin calls SAP but doesn't commit the changes.
  • The log shows a DIR Key column (document type, number, part and version) and a DIR Description column.

When you update documents, add to the plugin only the document data fields you want to change. Empty values of added fields overwrite the values in SAP.

Log

For each record the plugin writes the operation, the Ignore Document Status or Version Assigned Automatically setting, the result of the existence check, and the import and export parameters of every function module it calls. See Log section.

  • A successful record gets the DIR Key and DIR Description values. Click DIR Key to open the document in SAP. This requires SAP GUI on the computer where you use the Designer.
  • A failed record gets the SAP message as its error.
  • If SAP returns a runtime error about attaching SAP GUI (SYSTEM_PREPARE_ATTACH_GUI or SYSTEM_FINISH_ATTACH_GUI), the error refers to SAP Note 1258724 and the run stops.

Prerequisites

  • An SAP user with authorizations for the document management BAPIs above, for RFC_READ_TABLE (tables TDWA, TDWAT, TCLO, TDWP and the key tables of the linked objects), and for reading class data.
  • To check in originals, SAP must be able to read the files at the paths in DOCFILE, and SAP GUI must be installed on the machine that runs the project.
Esc