如何使用VB .NET从SAP读取BAPIRET2 [英] How to read BAPIRET2 from SAP using VB .NET

查看:133
本文介绍了如何使用VB .NET从SAP读取BAPIRET2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我需要在VB .NET上使用SAP RFC导出一些数据



我设法登录到sap服务器,但当我传递参数时,我得到返回代码4,这意味着我有一些错误。所以我需要阅读BAPIRET2表来找出我失败的地方。

我的问题是我不知道如何阅读这些数据。

任何人?

提前致谢

解决方案

您如何连接到SAP?

ERPConnect? SAP.NET.Connector?


你好Scubapro,



多数民众赞成一个好问题...老实说,我创建了一个类似的对象:



RFC = CreateObject(SAP.Functions)

之后:



RFC.Connection。[parameter] = [value] ......依此类推。



但是,我的问题在这一点上是另一回事。我设法导入表格使用



RFC_Return = RFC.Tables(RETURN)

但是,如果我在VB .Net中读取 RFC_Return.Value(1,4),我不会收到消息但是它的地址和参数[E:ZSMN:63 0.000 1.000]。另一方面,如果我在Excel中运行它,我得到的消息就像我想要的那样。



唯一的区别是我必须添加一些'set'而以excel编码:



设置RFC_Return = RFC.Tables(RETURN)





有什么想法吗?



问候


你好,



我现在正在努力解决同样的问题。但是,你的尝试对我来说似乎很奇怪。我刚开始熟悉SAP和RFC / BAPI。 RFC_Return = RFC.Tables(RETURN)是指什么?它基本上是说Sap.Functions.Tables(RETURN)。我没有看到Return引用的RFC调用。请记住,我自己也是业余爱好者,可能完全错了,但这是我到目前为止(R3相当于你的RFC):



CO13 = R3.add(BAPI_PRODORDCONF_CANCEL)

CO13.exports(CONFIRMATION)=确认

CO13.exports(CONFIRMATIONCOUNTER)= cnfrmcnt
Bapi_return = CO13.imports(返回)



现在我已经在Bapi_return获得了BAPIRET表,但我不知道怎么做访问Bapi_return中的数据。



您的解决方案在RFC_Return = RFC.Tables(RETURN)行中让我外部组件导致异常

Hello,

I need to export some data using SAP RFC on VB .NET

I managed to logon to sap server but when i pass the parameters I get return code 4 that means i have some kind of error. So i would need to read the BAPIRET2 table to figure out where I´m failing.
My problem is that i dont have a clue how to read that data.
Anyone?
Thanks in advance

解决方案

How are you connecting to SAP?
ERPConnect? SAP.NET.Connector?


Hi Scubapro,

thats a good question... honestly i create an object that goes like:

RFC = CreateObject("SAP.Functions")
after that:

RFC.Connection.[parameter]=[value]...and so on.

But well, my problem is another at this point. I managed to import the table using

RFC_Return = RFC.Tables("RETURN")
But if I read RFC_Return.Value(1,4) in VB .Net i dont get the message but its address and the parameters [E:ZSMN:63 0.000 1.000]. On the other way if i run this in Excel I get the message just like i wanted it.

The only difference i had to make was adding some 'set' while coding in excel:

Set RFC_Return = RFC.Tables("RETURN")


Any idea?

Regards


Hello,

I'm struggling with the same problem as you right now. However, your attempt seems very strange to me. I have just started getting familiar with SAP and RFCs/BAPIs. What does "RFC_Return = RFC.Tables("RETURN")" refer to? It basically says Sap.Functions.Tables("RETURN"). I don't see which RFC call the Return refers to. Keep in mind that I am an amateur myself and might be completely wrong with this, but this is what I have so far (R3 is the equivalent to your RFC):

CO13 = R3.add("BAPI_PRODORDCONF_CANCEL")
CO13.exports("CONFIRMATION") = confirmationnr
CO13.exports("CONFIRMATIONCOUNTER") = cnfrmcnt
Bapi_return = CO13.imports("RETURN")

Now I've got the BAPIRET table in Bapi_return, but I don't know how do access the data within Bapi_return.

Your solution gets me "an external component has caused an exception" at the "RFC_Return = RFC.Tables("RETURN")" line


这篇关于如何使用VB .NET从SAP读取BAPIRET2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆