Considerations specific to using the connector with DECS

DECS provides the equivalent to the Virtual Fields activity of HEI, incorporated into Domino. The DECS activity document is slightly different than the HEI activity document. The following sections describe the DECS forms and key initialization.

A DECS Virtual Fields activity allows you to intercept four document-related events:
  • Intercept Document Create
  • Intercept Document Open
  • Intercept Document Update
  • Intercept Document Delete

To create one activity that supports all four of the above events, write your own RFC/BAPI function that allows you to do so.

If you cannot get such an RFC/BAPI function, you need to create four different DECS Virtual Fields activities, where each activity supports one event only. The following sections provide examples of DECS Virtual Fields activity documents that support each type of event.
Note: In general, data integrity is fully covered by any ECC transaction. Do not enable any integrity checks in the activity. If you do, your Virtual Fields activity will fail.

Key initialization in DECS

With the SAP Connector, Key Initialization is only possible when you have a Document Open event activity already created. Document Open is the only event where the SAP Connector may send a result set back to Notes. Multiple events being watched in a single activity is not supported with the SAP Connector.

There are times when you may not use key initialization together with your Document Open activity. For example, when you want to call BAPI_REQUISITION_GETDETAIL to retrieve information from ECC for display in Notes. The input key to this BAPI is the requisition number.

However, this BAPI does not return a list of all available requisition numbers. In this example, you must read the requisition numbers from table EBAN. This means that either you need an HEI Direct Transfer activity to read the requisition numbers, or you must write LotusScript (LC LSX) to read the requisition numbers. Here is an example of such a script:
Sub GetAllRequisitions (source As LCConnection)
	Dim Ws As New NotesUIWorkspace
	Dim Vw As NotesUIView
	Set Vw=Ws.Currentview
	On Error Goto errorhandler	
	Dim target As New Lcconnection("notes")
	Dim sourcefieldlist As New Lcfieldlist
	Dim targetfieldlist As New Lcfieldlist
	Dim counter As Integer
	Dim selectstatement As String
	Call ConnectR3(source,"RFC_READ_TABLEEBAN")
	target.Server = ""
	target.Database = "getreq.nsf"
	source.Metadata = "EBAN"
	target.Metadata = "BAPI_REQ"
	selectstatement = |FIELDS.1.FIELDNAME="BANFN"|
	source.Fieldnames = "EBANBANFN"
	counter = source.Execute(selectstatement, sourcefieldlist)
	If (counter = 0) Then
		Msgbox "No records returned by ECC"
		Exit Sub
	End If
	Call targetfieldlist.MapName(sourcefieldlist,"EBANBANFN","Number")
	target.MapByName = True
	Dim counter2 As Integer
	counter2 = source.Fetch(sourcefieldlist,1,1)
	While (counter2 > 0)
		Call target.Insert(targetfieldlist, 1, 1)	
		counter2 = source.Fetch(sourcefieldlist, 1, 1)
	Call Vw.view.refresh
	Exit Sub
	Dim Msg As String
	Dim Msgcode As Long
	Dim status As Integer
	Dim result As String
	If session.status <> LCSUCCESS Then
		status = session.GetStatus(result, Msgcode, Msg)
	End If
	Msgbox result
End Sub

It would be a good idea to write such a script even if the RFC or BAPI did return the key information, as then you could create a periodic agent that could refresh your keys for you.

Procedure for initializing keys

  1. First create a DECS Document Open activity, such as that found in the Intercept Document Open section of the DECS specifics later in this section. While selecting RFC/BAPI in the open event (used for initializing keys) make sure that RFC/BAPI should return all keys after execution. For example, BAPI_CUSTOMER_GETLIST will return a list of all customers.
  2. From the Actions menu, select Initialize Keys.
  3. If required, enter a Select Statement, as in a Direct Transfer activity.
  4. Specify where the result set the key is found. At this point the keys should exist in the database.