PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • A wizard for using SAP functions
  • Wizard for the SAPExecute function
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
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.
Note: 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 WLangage 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. Select "Workshop .. SAP .. Use a SAP function".On the "Project" pane, 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 may 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.
    Note: 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. All you have to do is:
    • copy this code to the requested location.
    • remove the comments.
    • give a value to the different parameters expected by the function.
Note: the connection and the disconnection of the application to/from the SAP application server must be managed by SAPConnect and SAPDisconnect.

Wizard for 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.
Minimum required version
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment