Free cookie consent management tool by TermsFeed

a!sapInvoke() Function

Function

a!sapInvoke( scsExternalSystemKey, usePerUserCredentials, hostname, clientNumber, systemNumber, connectionProperties, bapi, importParameters, tableParameters )

Invokes the given BAPI, returning the result. This function is intended for reads only. To write to SAP, use a!sapInvokeWriter.

Parameters

Keyword Type Description

scsExternalSystemKey

Text

The key from the Third Party Credentials admin console page that corresponds to the set of credentials that should be used to authenticate.

usePerUserCredentials

Boolean

If true the credentials set in the Third-Party Credentials settings page by the current user running the expression will be used. If false the site-wide credential values will be used.

hostname

Text

The application server host of the SAP server (ASHOST). The value can be an IP address, a fully-qualified domain name, or SAP's router string format. For example, "/H/sap_router/W/password/H/app_host/S/service_port".

clientNumber

Text

The SAP client. For example, "500".

systemNumber

Text

The SAP system number. For example, "10".

connectionProperties

Any Type

The connection properties to use when creating the connection to the SAP instance, given as a dictionary. The dictionary fields are the camel-cased names of the properties with '.'s removed, and the values are the properties values to use.

bapi

Text

The name of the SAP BAPI to invoke.

importParameters

Any Type

The import parameters to send to the BAPI function, given as a dictionary. The dictionary fields are the import parameter names, and the values are the parameter values to send.

tableParameters

Any Type

The table parameters to send to the BAPI function, given as a dictionary. The dictionary values can also be given as dictionaries, allowing for the requisite table structure to be defined.

Returns

The function returns the standard connector result dictionary described in the main Connectors page.

If successful, the function returns a dictionary representation of the return value of the invoked BAPI.

Usage considerations

If called multiple times in the same expression with the same parameters, only one query is made to SAP when the expression is evaluated and the result is reused for each identical call. This caching only applies within a single expression evaluation. Return values are not cached in separate expressions, or in separate evaluations of the same expression.

Examples

Copy and paste an example into an Appian Expression Editor to experiment with it.

Invoke a BAPI to read material details

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
=a!localVariables(
  local!material: a!sapInvoke(
    scsExternalSystemKey: cons!SAP_SCS_KEY,
    usePerUserCredentials: true,
    hostname: cons!SAP_HOSTNAME,
    clientNumber: cons!SAP_CLIENT_NUMBER,
    systemNumber: cons!SAP_SYSTEM_NUMBER,
    bapi: "BAPI_MATERIAL_GET_DETAIL",
    importParameters: {MATERIAL: "MATERIAL NAME"}
  ),
  {
    a!textField(
      label: "Material Type",
      readOnly: true
      value: local!material.result[2].MATERIAL_GENERAL_DATA.MATERIAL_GENERAL_DATA.MATL_TYPE
    ),
    a!textField(
      label: "Material Description",
      readOnly: true
      value: local!material.result[2].MATERIAL_GENERAL_DATA.MATERIAL_GENERAL_DATA.MATL_DESC
    )
  }
)

Connection properties

The table below lists the dictionary keys and their associated connection property.

Dictionary Key SAP Connection Property Description
jcoClientClient jco.client.client SAP client
jcoClientUser jco.client.user Logon user
jcoClientAlias_user jco.client.alias_user Alias user name
jcoClientPasswd jco.client.passwd Logon password
jcoClientLang jco.client.lang Logon language
jcoClientSysnr jco.client.sysnr SAP system number
jcoClientAshost jco.client.ashost SAP application server
jcoClientMshost jco.client.mshost SAP message server
jcoClientGwhost jco.client.gwhost Gateway host
jcoClientGwserv jco.client.gwserv Gateway service
jcoClientR3name jco.client.r3name R/3 name
jcoClientGroup jco.client.group Group of SAP application servers
jcoClientTpname jco.client.tpname Program ID of external server program
jcoClientTphost jco.client.tphost Host of external server program
jcoClientType jco.client.type Type of remote host 2 = R/2, 3 = R/3, E = External
jcoClientTrace jco.client.trace Enable/disable RFC trace (0 or 1)
jcoClientCodepage jco.client.codepage Initial codepage in SAP notation
jcoClientabap_debug jco.client.abap_debug Enable ABAP debugging 0 or 1
jcoClientUse_sapgui jco.client.use_sapgui Use remote SAP graphical user interface (0/1/2)
jcoClientGetsso2 jco.client.getsso2 Get/Don't get a SSO ticket after logon (1 or 0)
jcoClientMysapsso2 jco.client.mysapsso2 Use the specified SAP Cookie Version 2 as logon ticket
jcoClientX509cert jco.client.x509cert Use the specified X509 certificate as logon ticket
jcoClientLcheck jco.client.lcheck Enable/Disable logon check at open time, 1 (enable) or 0 (disable)
jcoClientGrt_data jco.client.grt_data Additional data for GUI
jcoClientUse_guihost jco.client.use_guihost Host to which to redirect the remote GUI
jcoClientUse_guiserv jco.client.use_guiserv Service to which to redirect of the remote GUI
jcoClientUse_guiprogid jco.client.use_guiprogid Program ID of the server which starts the remote GUI
jcoClient.Snc_mode jco.client.snc_mode Secure network connection (SNC) mode, 0 (off) or 1 (on)
jcoClientSnc_partnername jco.client.snc_partnername SNC partner, e.g. p:CN=R3, O=XYZ-INC, C=EN
jcoClientSnc_qop jco.client.snc_qop SNC level of security, 1 to 9
jcoClientSnc_myname jco.client.snc_myname SNC name. Overrides default SNC partner
jcoClientSnc_lib jco.client.snc_lib Path to library which provides SNC service
jcoClientDest jco.client.dest R/2 destination
jcoClientSaplogon_id jco.client.saplogon_id String defined for SAPLOGON on 32-bit Windows
jcoClientExtiddata jco.client.extiddata Data for external authentication (PAS)
jcoClientExtidtype jco.client.extidtype Type of external authentication (PAS)
jcoClientIdle_timeout jco.client.idle_timeout Idle timeout (in seconds) for the connection after which it will be closed by R/3.
Only positive values are allowed.
jcoClientDsr jco.client.dsr Enable/Disable dsr support (0 or 1)

Feature compatibility

The table below lists this function's compatibility with various features in Appian.
Feature Compatibility Note
Portals Partially compatible

Can be used with Appian Portals if it is connected using an integration and web API.

Offline Mobile Partially compatible

Can be used with offline mobile if it is loaded at the top of the form.

Sync-Time Custom Record Fields Incompatible
Real-Time Custom Record Fields Incompatible

Custom record fields that evaluate in real time must be configured using one or more Custom Field functions.

Process Reports Incompatible

Cannot be used to configure a process report.

Process Events Incompatible

Cannot be used to configure a process event node, such as a start event or timer event.

Feedback