Entering content frameThis graphic is explained in the accompanying text Example: Creating a Customer Master Record

A model Microsoft Visual Basic project (CALLBAPI.VBP) for calling the BAPI_Customer_CreateFromData BAPI of the object type Customer (KNA1) is stored in the ...\SAPforms\Samples directory. This method is used to create a customer master record in the SAP System.

Process Flow

To use this example, you need to carry out the following steps:

  1. Start Microsoft Visual Basic and load the CALLBAPI.VBP project from the directory ...\SAPforms\Samples.
  2. Start the SAPforms Designer as a Microsoft Visual Basic add-in.
  3. The BAPI structure is displayed in the top screen area. The form controls are shown in the table displayed in the bottom screen area. The binding is already defined and generated. The steps for Maintaining Plug-Ins and Opening a Structure and Defining and Generating a Binding, therefore, have been completed.

    All of the parameters required for correct execution are listed in the following table:

    Name

    Parameter

    Values

    Name

    PI_ADDRESS.Name

    Any

    First name

    PI_ADDRESS.First_Name

    Any

    Street

    PI_ADDRESS.Street

    Any

    Postal code

    PI_ADDRESS.Postl_Code

    5 digit numeric

    City

    PI_ADDRESS.City

    Any

    Reference customer

    PI_COPYREFERENCE.Ref_Custmr

    "*"

    Country

    PI_ADDRESS.Country

    US"*"

    Language

    PI_ADDRESS.Langu

    US

    Sales organization

    PI_COPYREFERENCE.Salesorg

    "*"

    Division

    PI_COPYREFERENCE.Division

    "*"

    Distribution channel

    PI_COPYREFERENCE.Distr_Chan

    "*"

    Caution

    Not all attributes are filled by the SAPforms form. Instead, they are filled with initial values in the background by an import routine in Microsoft-Visual-Basic source text. These values are stored in the CUSTOMER.TXT file in the directories ...\SAPforms\Samples or ...\SAPforms\Forms. It is important that the file is in the same directory as the EXE file read for this purpose.

    It concerns the data for state, reference customer sales organization, division and distribution channel ("*"). Except for state this data is system-specific and must be determined separately. For the example to work, you must maintain the appropriate data for your system in the file CUSTOMER.TXT. For more information, see Determining a Reference Customer.

  4. Test your SAPforms form by choosing Run in Microsoft Visual Basic or generate and start an EXE file.
  5. Enter meaningful data (see above) and choose Start. You are then logged on to your SAP System automatically. After a short period of time, the message callbapi "The BAPI has been called successfully" is displayed.

A customer master record has been successfully created in your SAP System.

Leaving content frame