|
Purpose | With Call you can call a function from a GuiXT script or from an InputScript.
The function can either be a local dll-function (on the frontend PC), implemented in VC++ or a similar language, or an R/3 function module on the R/3 application server, implemented in ABAP. In this case SAP’s RFC (Remote Function Call) technology is used. Please observe that the Call-command via RFC requires the component “InputAssistant”. | ||
Examples | Call “ImgName” dll=“guiexits” In=“&F[Material]“ Out=“Matfilename” Call “ImgName” In=“&F[Material]“ Out=“Matfilename” In the first case the dll-function ImgName is called locally. In the second case the R/3 function module ImgName is called via RFC. | ||
Format | RFC call
old format: new format: Call "funcname" Destination="dest" In.Name1="par1" In.Name2="par2" ... Out.Name1="par1" Out.Name2="par2" ... ... Table.Name1=“tab1" Table.Name2=“tab2" ... dll call: Please observe that only up to 20 parameters (In+Out+Tables) are currently possible. | ||
Additional options |
| ||
How to use the output parameters in your script | The output parameters of a Call can be used in the format &[name] in all subsequent script lines.
Example: Call “ImgName” In=“&F[Material]“ Out=“MatFileName” | ||
Calling a dll function | The function declaration is as follows (example with 2 IN parameters and 3 OUT parameters):
__declspec(dllexport) int funcname(char* p1, char*p2, char* p3, char* p4, char* p5) All parameters (IN and OUT) are passed in the order specified in the script. The maximum length of each string is 255 characters. Please specify all parameters in your script, otherwise the dll-function gets an address exception. You can download some useful examples from our dll-download-page | ||
Calling an R/3 function module | Passing parameters There are 2 variants for parameter passing. You can either use positional parameters, without specifying a name: Call "funcname" In=“par1" In=“par2" ... Out=“par1" Out=“par2" ... In this case the importing parameters of the function must be named In1, In2, .., the exporting parameter Out1, Out2,… (R/3 function library, transaction SE37). Or you use named parameters: Call "funcname" In.Name1=“par1" In.Name2=“par2" ... Out.Name1=“par1" Out.Name2=“par2" ... Table.Name1=“tab1" Table.Name2=“tab2" ... In this case there is no restriction on parameter names. Restrictions
It is possible to call other function modules from your function module. Handling of tables
Example: Calling a BAPI Call “BAPI_USER_GET_DETAIL” In.Username=“&[_user]“ Out.LogonData=“UserLogonData” Now the variable &V[UserGroup] contains the R/3 user group. Explanation (see also the interface definition in transaction SE37):
Example: Displaying additional data with RFC | ||
Calling other systems | You can call functions in other systems (R/3 or R/2) as well, using the parameter Destination=… The destination must be described in the file saprfc .ini; please see the SAP RFC documentation for details. The file saprfc.ini is either in the sapgui working directory “…\SAPworkdir”, or you use the environment RFC_INI to name the saprfc.ini file. Using this technique you can easily integrate information from other systems into the R/3 screens. | ||
Tips & Tricks |
|