BAPI_PROCORD_GET_DETAIL in Visual Basic

25 pts.
Tags:
ABAP
BAPI
BAPI_PROCORD_GET_DETAIL
SAP development
VB
Visual Basic
I want read data from SAP using VIsual Basic. I am Using "BAPI_PROCORD_GET_DETAIL" bapi for this purpose. While executing this BAPI in SAP , i am getting the records. But when I tried it from VB i am ubnable to Get data.
Following is the code i am trying in VB.Please check and give me feedback. Thanks in advance.


Set objList = objBAPIControl.Add ("BAPI_PROCORD_GET_DETAIL")
Dim tblHeader As Table
Dim tblComponent As Table
'Set export parameters i.e. for selection criteria
objList.exports("NUMBER") = "20001451"
objList.exports("ORDER_OBJECTS").Value(1) = "X"
objList.exports("ORDER_OBJECTS").Value(2) = "X"
objList.exports("ORDER_OBJECTS").Value(3) = "X"
objList.exports("ORDER_OBJECTS").Value(4) = "X"
objList.exports("ORDER_OBJECTS").Value(5) = "X"
objList.exports("ORDER_OBJECTS").Value(6) = "X"
objList.exports("ORDER_OBJECTS").Value(7) = "X"
' Execute Bapi object
ReturnFunc = objList.call

'Get the tables
 tblHeader = objList.TABLES("HEADER")
 tblComponent = objList.TABLES("COMPONENT")
 MsgBox (tblHeader.RowCount)
 MsgBox (tblComponent.RowCount)

Answer Wiki

Thanks. We'll let you know when a new response is added.

This may be a dated question, but thought I would try to answer in case anyone else is looking at the same issue..

The value for the .exports(“NUMBER”) must be left padded with zeros. Total length must be 12 characters.

Here is snippet of code that pulls all components records for a process order value from an excel spreadsheet.

objProcOrderDetail.exports(“NUMBER”) = String$(12 – Len(ActiveSheet.Cells(iSpreadSheetRow, iOrderIDColumn).Value), “0″) & ActiveSheet.Cells(iSpreadSheetRow, iOrderIDColumn).Value
objProcOrderDetail.exports(“ORDER_OBJECTS”).Value(“COMPONENTS”) = “X”

Hope it helps.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • BrentSheets
    Rujuta, you posted the same question three times. Please do not post identical questions - it does not speed up getting an answer. I've deleted the other two identical questions. Thanks for your cooperation.
    6,925 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following