call

The call command is used to call a function in WS.

Functions called with this command are always SAP function modules on the SAP server itself. The call command is useful when users need to use a standard BAPI or when a user wishes to link a screen element to an action to be executed. This method also works well with functions. To use call, we would use the following syntax:

call('function_name', {"in.parameter":"value", "out.parameter":"value", "table.parameter":"value", "currentuser":true});

Options

The call command takes the following options:

in.parameter

The parameter beng sent to the BAPI by the call command. The syntax is as follows:

{"in.parameter":"value"}

This option is used to specify the data table from which information is to be called. Typically, only a single in parameter would be included in the call command. In the below example, we are calling the user credentials from the USERNAME table, so the code would be as follows:

call("BAPI_USER_GET_DETAIL",{"in.USERNAME":"&V[_user]",
"table.RETURN(width:3000)":"zguixt_return"});
out.parameter

The parameter or parameters being returned from the BAPI. The syntax is shown below:

{"out.parameter":"value"}

This option is used to specify the values returned from the data table and to identify the variable where that value will be stored. Multiple out parameters could be returned, as in the following example:

call("BAPI_USER_GET_DETAIL", {"in.USERNAME":"&V[_user]",
"out.ADDRESS":"address", "out.COMPANY":"company",
"table.RETURN(width:3000)":"zguixt_return",
"currentuser":true});
currentuser

Specifies that the RFC information for the current user's logon data will be used instead of the RFC logon information contained in the guixt.sjs configuration file. The syntax is as follows:

{"currentuser":true}

The call command can also be used to send the current SAP user's RFC credentials instead of the RFC data in the guixt.sjs configuration file. When used, this method will take precedence over an entry in the guixt.sjs for a single RFC user, but in turn is subordinate to an entry in the guixt.sjs configuration file for an rfcconnect array. See rfcconnect for more information.

Note: The currentuser option cannot be used with a single-sign on configuration.
table.parameter

If value returned from BAPI is formatted as a table structure, then table parameter is used. The syntax is:

{"table.parameter(width:value)":"value"}

This will specify the table that will be accessed. The value of each row in the table is stored into an array. Width option is used to get the value of each row in the table structure if the total characters in a single row is more than 255 characters. In the following example, we will return data from the table 'RETURN' into the variable 'zguixt_return' and we will specify that we will return row values up to 3000 characters in width:

call("BAPI_USER_GET_DETAIL",{"in.USERNAME":"&V[_user]",
"table.RETURN(width:3000)":"zguixt_return"});