You are on page 1of 14

Accessing BAPI

Using
Visual Basic 6.0

By
Vipul & Mangesh
Step 2
• Select Properties Window or press F4.

• Type property Value as shown below.

• Name: FrmBAPIUpload
• Caption: BAPI Upload Accounting
Document
• Height 9180
• Width 14805
Step 3
• From the tool bar given drag & drop controls on the form & place them such that it
appears as below
Step 3
• Go into code window of the form by pressing F7 & declare the following variables in the
General Declaration area.
Step 4
• Place the following code in Command1->Click Section of code window.
Step 5
• Subroutine for logging on to SAP.
Step 6
• Subroutine for setting SAP Objects
Step 7
• Subroutine for Transferring Data to SAP
Step 8
• Subroutine for Filling Header Data into Document Header Structure which is to be
passed to the BAPI to post & check the data.
Step 9
• Subroutine for Filling Detail Data into AccountGL Internal table which is to be passed to
the BAPI to post & check the data.
Step 10
• Subroutine for Filling currency Amount Internal table which is to be passed to the BAPI
to post & check the data.

Step 11
• Subroutine for resetting SAP Objects.
Step 12
• Subroutine for commiting transaction in case of Success or rollbacking in case of error.It
also include code for filling error messages into text file from the return parameter.In
return parameter Message type is ‘E’ for Error & ‘S’ for success.
Step 13
• Some other subroutines used for filling data in Flex Grid & for common functionality.

You might also like