|
|
|
|
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.
// 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.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|