Entering content frameFunction documentation Programming SAPforms Forms  Locate the document in its SAP Library structure

Use

In the case of Microsoft Visual Basic Forms, the SAPforms Designer puts a few lines in the source code of your SAPforms form to let the SAPforms form communicate with the SAP System. This source code is sufficient to support communication with the SAP System. For more information, see Source Code Inserted by the SAPforms Designer.

For more complex SAPforms forms, however, you may need to insert your additional source code. Typical situations where you may have to add source code are:

Example

Input Checks

In the Process notification of absence example (Workflow Examples), the system checks whether a leave request was accepted or rejected. For this purpose, a specific value (A for "Accept", R for "Reject") is assigned to a container variable (CheckResult) in the Microsoft Visual Basic source code. The assignment is made using the following source code:

Syntax

objSAPForm.sapdata.Value("CheckResult") = "A"

and

ObjSAPForm.sapdata.Value("CheckResult") = "R"

This variable is interrogated when the workflow is executed and is evaluated accordingly.

Example

Data Retrieval

In the example Creating a Customer Master Record, information is needed for the BAPI call that is not to be entered using the SAPforms form. It is read using a Microsoft Visual Basic Routine from a local file called CUSTOMER.TXT.

For more information, see Error Handling Routines.

You can also call the SAPforms interface directly. In this case, you add the required operations (initialize interface, define binding) directly in the source code of the SAPforms form.

Prerequisites

You need a thorough knowledge of programming with Microsoft Visual Basic.

If the source code you want to insert refers to SAPforms objects, you also need to be extremely familiar with the properties and methods of these objects.

Note

Detailed explanations of the properties and methods is available under the Object Browser in Microsoft Visual Basic (View ® Object Browser). You must include the references to the required SAPforms components in your project (Project ® References). The most important properties and methods are also explained in this documentation. For more information, see Plug-Ins.

Leaving content frame