ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / SAP functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
SAPExecute (Function)
In french: SAPExecute
Calls a synchronous function or BAPI on a SAP system.
Remark: we recommend that you use the wizards to run a function (or BAPI). Two wizards are available for generating the necessary code:
  • SAPExecute wizard: enter "SAPExecute(" in the code editor and specify the requested information.
  • wizard for using a SAP function: this wizard generates the global procedures containing the code required to use BAPIs. This method is recommended.
    To start the wizard, go to the "Project" tab, "Project" group, expand "Import" and select "A SAP function".
    For more details, see Native SAP Access.
Example
// Code generated by the wizard for SAPExecute
STRETURN is Structure
TYPE is string
CODE is string
_MESSAGE is string
LOG_NO is string
LOG_MSG_NO is string
MESSAGE_V1 is string
MESSAGE_V2 is string
MESSAGE_V3 is string
MESSAGE_V4 is string
END
 
STBAPI1090_2 is Structure
_CURRENCY is string
CURRENCYISO is string
ALT_CUR is string
VALID_TO  is Date
LONG_TEXT is string
END
 
tCURRENCY_LIST is array of 0 STBAPI1090_2
st_RETURN is STRETURN
 
st_sRETURN is STRETURN
IF NOT SAPExecute(SAPID, "BAPI_CURRENCY_GETLIST", "RETURN,CURRENCY_LIST",st_RETURN,tCURRENCY_LIST) THEN
Error("Error getting currency",ErrorInfo())
   RETURN
END
// End of generated code
 
Trace(st_RETURN:_MESSAGE)
 
nNbLines is int = ArrayInfo(tCURRENCY_LIST, tiTotalNumber)
Trace(nNbLines)
stCurr is STBAPI1090_2
FOR i = 1 TO nNbLines
stCurr = tCURRENCY_LIST[i]
Trace(stCurr:CURRENCYISO + ": " + stCurr:LONG_TEXT + " date= " + stCurr:VALID_TO.Year)
END
Syntax
<Result> = SAPExecute(<Connection identifier> , <Function name> , <List of parameters> [, <Value of parameter 1> [... [, <Value of parameter N>]]])
<Result>: Boolean
  • True if the function was run,
  • False if an error occurred. ErrorInfo returns more information on the error.
<Connection identifier>: Integer
Connection identifier, returned by SAPConnect.
<Function name>: Character string
Name of the function to call.
<List of parameters>: Character string
List of ABAP names of parameters, separated by a comma.
<Value of parameter 1>: Expected type
Value of the parameters, in the order of <List of parameters>. For the output parameters, a variable must be specified. When a parameter is passed without value, SAP does not take the default value but the "empty" value corresponding to the type.
<Value of parameter N>: Expected type
Value of the parameters, in the order of <List of parameters>. For the output parameters, a variable must be specified. When a parameter is passed without value, SAP does not take the default value but the "empty" value corresponding to the type.
Component: wd290mess.dll
Minimum version required
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/14/2023

Send a report | Local help