Accessing BAPI Using Visual Basic 6.0
1. Start Visual Basic new project as Standerd EXE (as shown in picture).
• Select Properties Window or press F4.
• Type property Value as shown below.
• Name: FrmBAPIUpload
• Caption: BAPI Upload Accounting Document
• Height 9180
• Width 14805
• From the tool bar given drag & drop controls on the form & place them such that it appears as below
• Go into code window of the form by pressing F7 & declare the following variables in the General Declaration area.
• Place the following code in Command1->Click Section of code window.
• Subroutine for logging on to SAP.
• Subroutine for setting SAP Objects
• Subroutine for Transferring Data to SAP
• Subroutine for Filling Header Data into Document Header Structure which is to be passed to the BAPI to post & check the data.
• Subroutine for Filling Detail Data into AccountGL Internal table which is to be passed to the BAPI to post & check the data.
• Subroutine for Filling currency Amount Internal table which is to be passed to the BAPI to post & check the data.
• Subroutine for resetting SAP Objects.
• 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.
• Some other subroutines used for filling data in Flex Grid & for common functionality.
You must beto download file