on 07-23-2007 8:56 AM
I am not able to read data from a BAPIRETURN type to a datatable.
Precedently, we used to read values from a Recordset to use them in Visual Basic for our application (DCOM CONNECTOR) but, to my knowledge, it is not possible to read values directly from a BAPIRETURN type (NET CONNECTOR 2.0) and BAPIRETURNTable is Missing.
How can I fix that ?
, I read from Moderator Reiner.
May you explain clearly how this can be fixed for VB code, constraint being data from BAPIRETURN is not intended to be a table but a status check, therefore do we really need BAPIRETURNTable, if yes, how?
Cordially,
Manuel.
I have SAP 2.0.1 but I realized the proxy may have been built with an older version.
v2.0.1 fix.
Good afternoon,
<u>every other type work like this for me:</u>
<i> dim rsReturn as New MEMBERS
dim rsReturnTable as New MEMBERSTable
dim dtReturn as Datatable
...
conn = New connector
conn.setconnection()
conn.Z_Rfcp_MEMBERS_CC(...rsReturn)
conn.Dispose()
conn = Nothing
...
rsReturnTable.add(rsReturn)
dtReturn = rsReturn.toADOdatatable
dtReturn.rows(0)(0) ' retrieve data from MEMBERS Type.</i>
<u>Here is the code I try to fix (bapireturn type):</u>
<i>Dim webAccess As Integer
Dim rsreturn As New BAPIRETURN
conn = New connector
conn.setconnection()
conn.Z_Rfcp_Get_Data(BD, CStr(costNum).PadLeft(10, "0"), ED, Nothing, webAccess, _
rsreturn, rsDays_Tab, rsGeneral_Tab)
conn.Dispose()
conn = Nothing
If Not rsreturn Is Nothing Then
'??????????? How to retrieve data from BAPIRETURN ?
'???????????
rsreturn = Nothing
End If</i>
Cordially,
Manuel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there a better way to do that ? Can we avoid to use BAPIRERETURNTable ?
BAPIRETURNTable is not available with my proxy.
#Objects
<i>dim rsReturn as New BAPIRERETURN
dim rsReturnTable as NewME MBERSTable
dim dtReturn as Datatable</i>
#Add BAPIRERETURN into table
<i>rsReturnTable.add(rsReturn)
dtReturn = rsReturn.toADOdatatable</i>
Read data
<i>dtReturn.rows(0)(0) </i>
Cordially,
Manuel.
Hi Manuel,
thank you for the very helpful reward points
to retrieve data from the structure rsreturn [type : BAPIRETURN]
use the equivalent switch case in VB
-
switch(rsreturn.Type)
{
case "E":
case "A":
case "W":
// do error / warning handling
break;
case "S":
case "":
default:
// process results from RFC, as result was extracted successfully
break;
}.
-
if the RFC returns a structure with BAPIRETURNTable : say brtReturn
then all you need to do is treat it as an array of BAPIRETURN structures
and then do something like :
brtReturn[0].Type to extract the Type result
with respect,
amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Although I have v2.0.1 I am unable to use any data in a BAPIRETURN type and I can't use toADOdatatable because BAPIRETURNTable is missing.
Can someone help me ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Manuel,
how are you doing ?
i need to understand a few things abit clearer in your task :
when you mention "i am not able to use any data iin a BAPIRETURN", i do not understand the limitation, please be more specific here ...
for any class that returns an object of type BAPIRETURN
you will need to create an instance of that class :
BAPIRETURN brtReturn = new BAPIRETURN();
then call RFC -
X-----
then when you want to read it, you can do :
if(brtReturn!=null)
{
switch(brtReturn.Type)
{
case "E"
case "A"
case "W"
// do error / warning handling
break;
case "S"
default:
// process results from RFC
break;
}.
}
etc ....
plz refer :
/people/andre.fischer/blog/2007/02/07/exception-handling-for-web-services-based-on-business-apis-bapi-using-visual-studio-2005
with respect,
amit
gonna check my proxy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I used SAP NET CONNECTOR 2.0.1 for the proxy which should have fixed the BAPIRETURNTable issue, see below, but I can't see, use it.
v2.0.1 bug fix:
- Built-in type BAPIRETURNTable required by some BAPIs is added.
I use Visual studio 2003 .NET with vb code and I am migrating from DCOM to .NET CONNECTOR, trying.
Have you any idea about this issue ?
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.