ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / SAP functions
  • Overview
  • A wizard for using SAP functions
  • Wizard of the SAPExecute function
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
Native Access to SAP
Overview
SAP is a widely used ERP. Many SAP users implement add-on applications in addition to their software.
The native support of SAP by WINDEV and WEBDEV allows you to easily implement these applications.
A "BAPI" (Business API) is a function that allows you to interact with a SAP system. Some BAPIs are provided with SAP, other are written by other developers or software publishers.
Several WLangage functions can be used to establish a connection with authentication and to call BAPIs by passing parameters.
A wizard helps you import the structures used.
There is no need to install the SAP GUI module. Only the SAP client or the librfc32.dll file are required (library supplied by SAP and found in the executable directory).
This gives you the ability to create WINDEV windows and to use them instead of SAP GUI. Furthermore, "Reports & Queries" can be used to create reports and queries on the data found in the SAP database.
Remark: You cannot connect to SAP Business Object via the protocol of SAP BO (UI API and DI API) via the native SAP access. In this case, you must use a DLL (C# or Visual Basic) called by a WLanguage code.
A wizard for using SAP functions
To use SAP functions, we recommend that you use the wizard for importing SAP functions. This wizard generates the WLanguage code required in a set of procedures (for better reusability). A global procedure is created for each imported function. This procedure contains an example of call with empty parameters. To use the function, all you have to do is copy this example of call in the requested code and enter the value of the different parameters.
To use the wizard for importing function module/BAPI:
  1. On the "Project" tab, in the "Project" group, expand "Import" and select "A SAP function".
  2. The wizard starts. Go to the next step.
  3. Specify the parameters for connecting to the SAP application server:
    • the application server.
    • the system number.
    • the client number.
    • the user.
    • the password associated with the user.
  4. The next step is used to select the function module to import. You can:
    • retrieve the entire list of available functions to select the requested function. This operation can take quite a long time.
    • filter the functions to retrieve the ones corresponding to the filter (the user functions starting with "Z" for example).
      The "Start the search" button is used to display the functions found.
  5. The next step allows you to select the requested function.
  6. You can now select the parameters that must be passed to the function. For each parameter, the wizard indicates:
    • the name of the parameter.
    • whether the parameter is an input or output parameter.
    • whether the parameter is optional.
    • the default value of the parameter. This value will be used if the parameter is not passed to the function.
  7. Specify the name of the set of procedures that will host the SAP procedure. This set of procedures is named "SAP" by default. You can choose another name. This name will be automatically proposed during the next import of a SAP function.
    Remark: The set of procedures is automatically created if it does not exist.
  8. In the code of the created global procedure, an example of code used to call the created global procedure is available in comments. Simply:
    • copy this code to the requested location.
    • remove the comments.
    • give a value to the different parameters expected by the function.
Remark: the connection and the disconnection of the application to/from the SAP application server must be managed by SAPConnect and SAPDisconnect.

Wizard of the SAPExecute function

The method presented in the previous paragraph is the method that shoud be used to handle SAP BAPIs. However, you also have the ability to use the wizard of SAPExecute, available in the code editor. This wizard is used to generate the code for calling the requested BAPI function.
Related Examples:
The SAP functions Unit examples (WINDEV): The SAP functions
[ + ] Using the WLanguage SAPXxx functions.
These functions allow you to use the SAP BAPIs in native mode in WINDEV and in WEBDEV.
This allows you to access your SAP data directly from your WINDEV applications.
See also
Minimum version required
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help