| Purpose |
With
Call
you can call a
function from a GuiXT script or from an InputScript. The function can
either be an SAP function module on the SAP application server,
or a local DLL function (on the frontend PC), implemented in VC++ or a
similar language. For function modules we use SAP's RFC (Remote Function Call)
interface technology. Please observe that the Call-command via RFC requires the component "InputAssistant". Further functions (like automatic format conversion, bundling of calls) are provided by the "Open Call" interface of GuiXT, see below. |
|||||||||||||||||||||||||||
|
Examples
Further examples |
GuiXT
The SAP function module "BAPI_USER_GET_DETAIL" is called via RFC. GuiXT
The dll-function ImgName is called locally. |
|||||||||||||||||||||||||||
| Format | RFC call
Call "funcname" in.Name1="value1" in.Name2="value1" ... out.Name1="vname1" out.Name2="vname2"... table.Name1="tab1" table.Name2="tab2" ...
dll call: Please observe:
|
|||||||||||||||||||||||||||
| Format of the OpenCall Interface | Call
"functionname"
export.Name1="vname1"
export.name2="vname2"
...
import.Name3="vname3"
Please note:
When converting existing call instructions to the Open Call interface, please note the following:
|
|||||||||||||||||||||||||||
| Format of the OpenCall Interface for ABAP OO Remote Method Call |
Call
"classname.methodname"
object="objname"
export.name1="vname1"
export.name2="vname2"
... import.Name3="vname3"
import.name4="vname4"
....
Calls the method "methodname" of the specified object. The object
must belong to the class "classname". If object= is not specified, a
static class method is called.
Example:
GuiXT
|
|||||||||||||||||||||||||||
| Additional options |
|
|||||||||||||||||||||||||||
| Additional options for the case of the Open Call interface |
|
|||||||||||||||||||||||||||
| Calling an SAP function module | Passing
parameters Call "funcname" in.Name1="value1" in.Name2="value2" ... out.Name1="vname1" out.Name2="vname2" ... table.Name1="tab1" table.Name2="tab2" ... Restrictions
Handling of tables
Example 1:
GuiXT
Now the variable V[UserGroup] contains the SAP user group. Explanation (see also the interface definition in transaction SE37):
Example 1:
GuiXT
|
|||||||||||||||||||||||||||
| DLL Call |
The function is defined, for example, with 2 IN and 3 OUT parameters of the type
__declspec(dllexport) int funcname(char* p1, char* p2, char* p3, char* p4, char* p5)
All parameters (in= and out=)
are passed in the specified order. The maximum length of each
individual string is 64000 bytes. Please make sure to specify enough parameters in the
script, otherwise the dll function will access an invalid address.
Calling a DLL function within a GuiXT script using the Call statement is only permitted if both the name of the DLL file and the called function are explicitly listed in the guixt.ini file under "AllowDLLAccess". This security restriction applies starting with GuiXT version 2025 Q2 4. Examples: AllowDLLAccess guixtstring.dll alphanum
The specified names must exactly match those used in the Call statement, except for case sensitivity. Without a defined path, the DLL is loaded according to standard Windows rules. Optionally, the full file path can be specified: AllowDLLAccess C:\guixt\utilities\guixtstring.dll StripQuotationMarks In this case, the Call statement must also reference the DLL using the full path. Example 1: Call "alphanum" Adds leading 0000... to a numeric field. Parameters:
Invocation: Call "alphanum" dll="guixtstring.dll" in="&[Material]" in="8" out="NumMaterial" Examples of results:
Example 2: Call "StripQuotationMarks" Removes the quotation marks from a string. Typically, when generating ASCII text files, double quotation marks are placed around the characters. In SAP, these quotation marks are undesirable. Parameters:
Example: Call "StripQuotationMarks" dll="guixtstring.dll" in="&[QMaterial]" out="SMaterial"
The standard C calling convention CDECL is used. For dll functions that require STDCALL, you can specify this using the additional option : Call "alphanum" dll="guixtstring.dll" -stdcall in="&[Material]" in="8" out="NumMaterial" Compiled DLL and Visual Studio Sample Project
You can download and freely use or extend the DLL and the source code.
Please note that you choose the correct target platform in the project depending on whether you want to build for the 32bit or 64bit
version of GuiXT or the SAP GUI.
|
|||||||||||||||||||||||||||
| Hints |
|
|||||||||||||||||||||||||||
| Components | GuiXT + InputAssistant (with dll: just GuiXT necessary) |