PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
SAPExecute (Function)
In French: SAPExécute
Calls a synchronous function or BAPI on a SAP system.
Note: we recommend that you use the wizards to run a function (or BAPI). Two wizards are available for generating the necessary code:
  • wizard for SAPExecute: enter "SAPExecute(" in the code editor and specify the requested information.
  • wizard for using a SAP function ("Workshop .. SAP .. Use a SAP function"): this wizard generates the global procedures containing the code required to use BAPIs. This method is recommended. See Native SAP Access for more details.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 this wizard, on the "Project" pane, in the "Project" group, expand "Import" and select "A SAP function".
    See Native SAP Access for more details.
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_sRETURN is STRETURN

SAPExecute(IDSAP, "BAPI_CURRENCY_GETLIST", "CURRENCY_LIST", tCURRENCY_LIST)
// End of generated code

Trace(st_sRETURN:_MESSAGE)

nNbLines is int = ArrayInfo(tCURRENCY_LIST, tiTotalNumber)
Trace(nNbRow)
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 details about the problem.
<Connection Identifier>: Integer
Connection identifier, returned by SAPConnect.
<Function Name>: Character string (with quotes)
Name of the function to call.
<List of Parameters>: Character string (with quotes)
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.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230mess.dll
Minimum required version
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment