saperion ecm fastlink for sap - kofax · pdf filesaperion ecm fastlink for sap 1 introduction...
TRANSCRIPT
SAPERION ECM FastLink for SAP
Copyright © 2016 Lexmark. All rights reserved.
Lexmark is a trademark of Lexmark International, Inc., registered in the U.S. and/or other countries. All other trademarksare the property of their respective owners. No part of this publication may be reproduced, stored, or transmitted in anyform without the prior written permission of Lexmark.
Table of Contents
1 Introduction ......................................................................................................... 2
2 Product Description and Contents ..................................................................... 2
2.1 Contents ........................................................................................................... 2
2.1.1 Database Definitions (.DDC) ......................................................................... 2
2.1.2 Forms (.QBE) .................................................................................................. 2
2.1.3 SaFastlink.dll: (ActiveX.dll) ............................................................................. 3
2.2 Working with SAPERION FastLink ................................................................. 5
3 Installing FastLink ............................................................................................... 5
4 Configuring FastLink ........................................................................................... 6
4.1 Configuring the Start Macro ........................................................................... 6
4.1.1 Setting Profiles: Sample Macro (Call in Client Context) ................................ 6
4.1.2 Setting Document Type: Sample Macro (Call in Client Context) .................. 6
4.1.3 Initiating Linking to an Existing Archive: Sample Macro .............................. 7
4.2 Configuring Default Settings .......................................................................... 9
4.2.1 Configuration Tables ....................................................................................... 9
5 Logging ................................................................................................................ 14
2
SAPERION ECM FastLink for SAP
1 Introduction
SAPERION ECM FastLink for SAP ( in the following "FastLink") is a module to link SAP documents that
were, for example, generated by an output management system, with documents that are already in
an archive. This is done in the batch mode. FastLink can be freely configured for various SAP business
objects and documents.
The connection to SAP is accomplished by employing only standard SAP RFC functional elements so
that no additional installation is necessary in the SAP system. The prerequisite for successfully linking
documents in an archive with an SAP document is the basic customization of the ArchiveLink interface.
! Using the FastLink in a multi-client system is not supported.
2 Product Description and Contents
2.1 Contents
Included in the product are configuration tables, corresponding forms, the module "saFastlink.dll" and
sample configurations for the program call.
Database Definitions (.DDC)
Database Definitions
LUT_SAPLOGON Configuration of the SAP sign-on
LUT_SAP_INSERT Configuration of the business objects and document types
LUT_SAP_QUERY Configuration of the business objects key fields
LUT_SAP_RULE Configuration for the creation of profile IDs in SAPERION
Forms (.QBE)
The following forms support customizing the corresponding settings:
+ LUT_SAPLOGON_I
+ LUT_SAPLOGON_Q
+ LUT_SAP_INSERT_I
+ LUT_SAP_INSERT_Q
+ LUT_SAP_QUERY_I
+ LUT_SAP_QUERY_Q
+ LUT_SAP_RULE_I
+ LUT_SAP_RULE_Q
2 Product Description and Contents 3
SaFastlink.dll: (ActiveX.dll)
The "saFastlink.dll" must be registered in the directory of your choice after installation.
The DLL contains the following three classes:
1. Set Profile
This class defines which document is to be linked with which business object in SAP (multiple links are
allowed).
Sub SetFastLinkProfile()
'*****************************************************************************
' Start der Funktion Profil setzen
' Aufruf in der Version 7.1
' im Kontext des Saperion Client
'*****************************************************************************
Dim myProfile As Object
Set myProfile = CreateObject("saFastLink.Profile_Setting")
'myProfile.SYSINDEXSTATE = 10
If Not myProfile Is Nothing Then
myProfile.DeleteLog = True
myProfile.setProfile "Fastlink", "Profil", Application
End If
Set myProfile = Nothing
End Sub
Parameters of "setProfile"
Parameter Description
DDC The archive that contains the existing documents to be linked with SAP objects
Profil_Field The field in the DDC above that is to be filled with profile IDs (a string separated by semi-
colons, e.g. "1;3;5")
Application SAPERION.Application Object
All documents of the existing archive with empty Profil_Feld indices are assigned index values in the
field Profil_Field according to the configuration.
i This indexing does not generate a revision, but only makes a change in the database.
2. Setting the document property SAPDOCTYPE
Every document can be assigned the property SAPDOCTYPE. We recommend doing this in order to set
the document type on documents going to SAP that corresponds to the SAP protocol settings for the
document type.
Sub DocTypeSetting()
Dim myFastLink As Object
Set myFastLink = CreateObject("saFastLink.SAP_DocType_Setting")
If Not myFastLink Is Nothing Then
4
myFastLink.Set_SAP_DocType "Fastlink", "Profil", Application
End If
Set myFastLink = Nothing
End Sub
Parameters of "Set_SAP_DocType"
Parameter Description
DDC Name of the DDC containing the documents
Profil_Field Field name with the profile for FastLink
Application SAPERION.Application Object
3. FastLink
Sub StartFastLink()
Dim myFastLink As Object
Set myFastLink = CreateObject("saFastLink.FastLink")
myFastLink.SYSINDEXSTATE = 2
myFastLink.LogLevel = 3
myFastLink.LogChange = "D"
myFastLink.LogDir = "D:\Fastlink"
myFastLink.Field_AR_date = "AR_DATE"
myFastLink.UpdateExistingEntries = True
myFastLink.USER_Condition = "SELECT [*] FROM [$],TESTSYSACLUSERLIST WHERE [@ProfilId] <> '0'"
If Not myFastLink Is Nothing Then
myFastLink.DeleteLog = True
myFastLink.checkFormat = False
myFastLink.Start "TEST", "ProfilID", "2", False, Application,
End If
Set myFastLink = Nothing
End Sub
Parameters of "Start"
Parameter Beschreibung
DDC The archive that contains the existing documents to be linked with SAP objects.
The DDC must contain the system field "SYSINDEXSTATE" (integer, 4) and also the profile
field (String).
In cases the DDC is containing the field SYSACLUSERLIST the search condition has to be
enhanced as follows: "SELECT [*] FROM [$],<name>SYSACLUSERLIST“.
When additionally the search for a multivalue field should be executed
the search condition has to be enhanced as follows: "SELECT [*] FROM
[$],<name>SYSACLUSERLIST,<name><multi value column> WHERE
([$].XHDOC=<name><multi value column>.HDOC) AND (<name><multi value
column>.MULTIVAL = `value`)“
Profil_Field The field in the DDC above that was filled with profile IDs by script or manually.
Logon The ID with SAP login information that is configured in LUT_SAPLOGON see also "Confi-
guration")
3 Installing FastLink 5
Parameter Beschreibung
bCheck TRUE: the presence of the SAP object is checked in advance.
Application SAPERION.Application Object
At the start of the program run the parameters listed above are passed on. The program reads the
necessary values from the configuration tables and queries the SAP system for all relevant documents
in the DDC (if bCheck=TRUE).
If a corresponding SAP object is present, the document is linked to the SAP object. If the "linking" was
successful, the corresponding profile ID is deleted from the profile field. If there is no profile ID, the
value "0" is entered in the field.
As a rule, after the start the query for all data record in which the configured profile field is not empty
and which does not contain the value "0" will be generated.
i Only data record whose SYSINDEXSTATE < 65000 are considered; by doing so the access to
already deleted documents is avoided.
saApp.SelectSQL(myDDC, "( " & strProfile & " is NOT NULL) AND (SYSINDEXSTATE < 65000) AND ( " & strProfile & "
<> '0')")
Due to the reason that these queries may cause performance problems in systems with huge data
amount you have the possibility of transferring own queries to the FastLink module. Please note that the
parameter "USER_Condition" must begin with the following string: "SELECT [*] FROM [$]" (the syntax
is verified according to it). If this string is not available the standard query will be executed.
2.2 Working with SAPERION FastLink
The table containing the documents to be linked to SAP must be expanded to include the field
SYSINDEXSTATE and an index field for a profile ID. The field SYSINDEXSTATE is a SAPERION system
field for the configuration of the Broker’s index service. (You can find additional information on the field
SYSINDEXSTATE in the SAPERION administrator’s manual.) The profile ID defines which document is
linked with which document type and SAP object. FastLink finds all documents in the given archive that
have a profile field with the value <> ‘0’ or NULL.
Subsequently FastLink attempts to create an entry for this document in the SAP link table. This entry
can only be made if the customizing for the given document type is complete. In addition, FastLink can
check whether the selected SAP business object (configurable option) is present before creating the link
entry. If a link entry was created, the profile ID is deleted. If the document has no further profile IDs, a
‘0’ is entered in the profile field. This prevents the document from being processed at the next FastLink
program run.
3 Installing FastLink
1. To install FastLink, copy the supplied macros, forms and lookup tables to the appropriate SAPERION
directories.
6
2. Register the "Fastlink.dll" supplied.
3. Finally, edit the registry entry for "Fastlink.dll": change the Threading Model from "Apartment" to
"Free".
4. Now you can configure the module (see next chapter).
4 Configuring FastLink
4.1 Configuring the Start Macro
Setting Profiles: Sample Macro (Call in Client Context)
You can automate setting the profile ID that the FastLink module requires to create the link entry in
the SAP system. Certain prerequisites with regard to the index values of the archived documents are
necessary. The documents must have been archived with characteristic index values like for example
document type. In this case, existing index values can be used to automatically be assigned to the field
"Profile-ID.’’
Sample
Sub SetFastlinkProfile()
Dim myProfile As Object
Set myProfile=CreateObject(<saFastlink.Profile_Setting>)
If Not myProfile is Nothing Then
myProfile.deleteLog=true
’myProfile.setProfile "String_DDC-Name",<String_Profilfeld>,Application
End If
Set myProfile=nothing
End Sub
In order to use the sample macros, you must adapt the index table and the profile ID field to your
environment.
This indexing does not create a revision, it only makes a change in the database.
Setting Document Type: Sample Macro (Call in Client Context)
The document type is necessary in SAP to manage the viewers. For different types of documents (e.g.
PDF, TIF, DOC),different viewers are employed, depending on the settings in the ArchiveLink interface.
Sample
Sub SetSapDocType()
Dim myFastlink As Object
Set myFastlink=CreateObject(<saFastlink.SAP_DocType_Setting>)
If Not myFastlink is Nothing Then
myFastlink.Set_SAP_DOCTYPE "String_DDC-Name",<String_Profilfeld>,Application
End If
4 Configuring FastLink 7
Set myFastlink=nothing
End Sub
In order to use the sample macros, you must adapt the index table and the profile ID field to your
environment.
Initiating Linking to an Existing Archive: Sample Macro
Sample
1 Sub StartFastLink6.0()
2 Dim myFastLink As Object
3 Set myFastLink = CreateObject("saFastLink.FastLink")
4 myFastLink.LogLevel = 3
5 myFastLink.LogChange = "D"
6 myFastLink.LogDir = "D:\Fastlink"
7 myFastLink.Field_AR_date = "AR_DATE"
8 myFastLink.UpdateExistingEntries = True
9 myFastLink.USER_Condition = "SELECT [*] FROM [$],TESTSYSACLUSERLIST WHERE [@ProfilId] <> '0'"
10 If Not myFastLink Is Nothing Then
11 myFastLink.DeleteLog = True
12 myFastLink.checkFormat = False
13 myFastLink.Start "TEST", "ProfilID", "2", False, Application,
14 End If
15 Set myFastLink = Nothing
Explanation of the macro
Explanation of the macro
Line Parameter Description
4 LogLevel Three log levels are available, 1-3; log level 3 is the most extensive.
5 LogChange Set the interval for creating a new log file: d=daily, m=monthly, w=weekly.
6 LogDir Define the log directory. The directory must already exist.
7 AR_Date This SAPERION index field contains the archival date.
NOTE: Please be aware that this does not convert the date. We recommend that this field be of the "character"
type and be defined in the following format: "DD.MM.YYYY".
8 UpdateExistingEntries You can define what should happen with the profile ID in SAPERION in case of an already existing entry in
SAP.
FALSE: Profile-ID will not be changed
TRUE: the value "0" will be set
9 USER_Condition Creation of an own query for the FastLink module.
Must begin with the string: "SELECT [*] FROM [$]" (according to that the syntax will be checked). If this string
is not contained exactly the standard query will be used.
11 DeleteLog TRUE: the log will be deleted after each cycle
FALSE: the log will be attached after each cycle
8
Line Parameter Description
12 checkFormat TRUE: the existing SAPERION documents are checked for the presence of the document property „SAPDOC-
TYPE" or for format name.
1. The macro must be run in the R/Link Server context.
2. Define a task for the R/ Link Server in the Microsoft Management Console (MMC).
3. Select the FastLink macro and define the options.
The task should be run at regular intervals. The frequency depends on the number of documents
that need to be linked.
4. When using the sample macro, customize the macro according to your requirements (see table
"Explanation of the macro" above).
5. Assign a SAPERION user to the macro. You do this in the SAPERION client: ribbon DESIGN > group
MODEL > command SCRIPTS:
4 Configuring FastLink 9
i The module the script calls sends queries to the lookup table included in the FastLink package.
You can rename these tables. In this case you must set the corresponding property in the macro
calling the module.
Sample
myFastlink.LUT_INSERT="<changed name of the insert table>"
myFastlink.LUT_LOGON="<changed name of the logon table>"
myFastlink.LUT_QUERY="<changed name of the query table>"
4.2 Configuring Default Settings
Configuration Tables
The FastLink package contains the configuration tables LUT_SAPLOGON, LUT_SAP_INSERT,
LUT_SAP_QUERY, and LUT_SAP_RULE.
Logging On to the SAP System: LUT_SAPLOGON
A CPIC user is utilized to log on to the SAP system. This CPIC user is entered while customizing the
R/Link Server for the respective content repository. This is where you define which CPIC user FastLink
should select. The content server, the content repository and the client are taken from the R/Link
configuration.
Fig. 4–1: LUT_SAPLOGON: Index Form
In this form you enter the description for the user in the R/ Link configuration, not a user name and
password.
LUT_SAPLOGON: Index Form
Parameter Description
ID unique consecutive number
10
Parameter Description
ContServer content server named in the R/Link configuration
ContRepos archive named in the R/Link configuration
Mandt client in the SAP system
Fig. 4–2: Content Repository in the R/Link-Servers
Fig. 4–3: Archive and Client in the R/Link-Server
Configuring Profiles
Name of the configuration table: LUT_SAP_INSERT.DDC
Use this table to configure which document is to be linked to which business object in SAP. Only those
documents are linked that have the index field Profil_ID filled out. Because documents can be assigned
any number of profiles, multiple linking is possible.
Multiple linking is obtained when the profile-ID field is filled for example as follows: "12;13;16". Here,
three SAP objects are linked to the SAPERION document. The links are processed consecutively and in
the case of success the profile-IDs are removed from the index field. Only after the last link has been
processed successfully the value in the field is set to "0".
Fig. 4–4: LUT_SAP_INSERT: Query Form for the Lookup Table
4 Configuring FastLink 11
Fig. 4–5: LUT_SAP_INSERT: Index Form for the Lookup Table
Index Form for the Lookup Table
Parameter Description
Profile-ID consecutive profile ID
SAP_Object business object in SAP
SAP_DOC_KIND document class in SAP (e.g. invoice, shipping order)
SAP_DOCTYPE Document type of the document class (e.g. DOC, TIF, PDF)
SAP_ARCHIV_ID content repository ID in SAP
SAP_TAB SAP business object table
MANDT_FIELD_NAME Name of the field of the SAP table for client (e.g., MANDT or CLIENT)
This configuration must be identical with the entries of the transaction "OAC3" in SAP.
LUT_SAP_QUERY.DDC: Definition of the SAP Query (Key Fields)
There are certain key fields in the SAP tables to enable unique identification of a business object in SAP.
The values in these fields must also be present in the SAPERION index table.
Here you define in which SAPERION fields the index information for these fields is located. In the event
of compound key fields you can also specify a sequence of these fields.
Fig. 4–6: LUT_SAP_QUERY: Query Form for the Lookup Table
12
Fig. 4–7: LUT_SAP_QUERY: Index Form for the Lookup Table
You can define several SAP object for a DDC. Here you configure in which SAPERION index fields contain
the information to enable unique identification on an SAP object. The index fields in SAPERION must
be filled identically to the index fields in SAP. This means that leading zeros and spaces are absolutely
necessary to assure unique identification of the business object. Depending on the configuration
FastLink can insert zeros or spaces left or right-justified with regard to the index values.
FastLink can set the field Profil_ID to correspond to existing index values in an initial run. In this case
the configuration fields MIN_BORDER and MAX_BORDER are of special importance.
LUT_SAP_QUERY: Index Form for the Lookup Table
Parameter Description
Business-Object business object in SAP
DDC_NAME name of the DDC in SAPERION (without ".ddc")
RANK position of the field for compound keys in SAP (e.g. for the business object BKPF, the key is
composed of the fields BUKRS, BELNR and GJAHR in the table BKPF)
DDC_FIELD field name in SAPERION
SAP_FIELD field name in SAP
MIN_BORDER lower limit for a range of numbers (for setting the Profil_ID)
MAX_BORDER upper limit for a range of numbers (for setting the Profil_ID)
Field_Length length of the index field in SAP
Spaces fill the SAPERION field with spaces (YES/NO)
Zeros fill the SAPERION field with zeros (YES/NO)
RightAlign fill the SAPERION field with zeros/spaces right-justified
LeftAlign fill the SAPERION field with zeros/spaces left-justified
4 Configuring FastLink 13
LUT_SAP_RULE: Creating the Profile Index
Every document to be linked requires a "Profile" index. If it does not exist, FastLinks can automatically
create it.
SAP objects can be configured with various SAP document classes.
The document class can vary from document to document. The tabular information above offers the
opportunity to configure unambiguity.
Option 1:
The index field "AR_OBJECT_FIELD" is filled with the name of the index field that contains the
document’s document class.
In this case, enter the name of this field here. The document class (SAP_DOC_KIND) that is listed in
that field is compared to the configuration in the table LUT_SAP_INSERT. The corresponding profile ID
is selected and entered in the Profile ID field in the SAPERION index table.
Fig. 4–8: LUT_SAP_RULE: Index Form for the Lookup Table
SAP_OBJ: business object
Option 2:
The field "AR_OBJECT_FIELD" has not been filled.
Using the fields Felder RULE_FIELD,MIN_BORDER,MAX_BORDER,SAP_DOC_KIND, you can define a
rule that decides the document class in use. Here you can assign profile IDs based on number ranges.
Example:
A document from the "SAPERION-Archive" has the document number 9100000001. According to the
lookup table, it is a document of the document class "ZSDIORDER." This corresponds to the profile "1"
in LUT_SAP_INSERT. For the document number 9200000000, on the other hand, no document class
can be determined, and therefore no value is written to the field "Profil_ID." No link entry can be created
in SAP for this document.
14
Fig. 4–9: LUT_SAP_RULE: Index Form for the Lookup Table
5 Logging
The FastLink module generates a log at runtime. The system events are recorded according to the
settings. The files "Fastlink_JJJJMMTT.log" and "OK_Fastlink_JJJJMMTT.log" are created in the specified
directory. Loglevel "3" generates the most extensive log. For the documents that were linked you can see
the index values that were used for the link entry:
"13.12.2007|12:59:56||CreateQueryArray|strSearch=BKPFBKPFFastlink1 strErg : CompanyCode;BUKRS;1;0;0"
"13.12.2007|12:59:56||CreateQueryArray|strSearch=BKPFBKPFFastlink2 strErg : DocumentNumber;BELNR;2;0;0"
"13.12.2007|12:59:56||CreateQueryArray|strSearch=BKPFBKPFFastlink3 strErg : FiscalYear;GJAHR;3;0;0"
"13.12.2007|12:59:56|0|Startnachverlinken|SAPKey : 000119000002712007"
"13.12.2007|12:59:56||InsertALinkConnection|ContSrv=B1 ContRep : B1 RFC_Connect successful"
"13.12.2007|12:59:56||InsertALinkConnection|parmMandant=800"
"13.12.2007|12:59:56||InsertALinkConnection|parmSapObject=BKPF "
"13.12.2007|12:59:56||InsertALinkConnection|strArchivID=B1"
"13.12.2007|12:59:56||InsertALinkConnection|strArcDocID=SAPRRXXX#yv/)hOQUIPAAEAAACMAAAAAAAAAA "
"13.12.2007|12:59:56||InsertALinkConnection|strSapObjectID=000119000002712007 "
"13.12.2007|12:59:56||InsertALinkConnection|strArcObject=ZB1FASTLK "
"13.12.2007|12:59:56||InsertALinkConnection|strSAPdocType=PDF "
At the end of the log file there is a summary of how many documents were successfully linked.