日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

SAP BAPI的一些初级资料

發布時間:2025/3/19 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 SAP BAPI的一些初级资料 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
周圍的人都比較忙,一切得靠自己學,慢慢摸索。

BAPI有的是類,有的是函數。'Business?application?programming?interface'的簡稱。?

BAPI?is?'Business?application?programming?interface',?similar?to?API.?which?are?stable,?standardized?methods?to?access?data?in?R/3?

To?use?BAPIs?to?access?SAP?business?objects?you?will?need?a?good?understanding?of?object-oriented?programming.?You?should?also?have?a?basic?knowledge?of?the?R/3?System.?

BAPIs?can?be?accessed?from?various?programming?environments,?for?example,?Delphi/Connect?from?Inprise?(formerly?Borland),?Microsoft’s?Visual?Studio,?C++?and?Java?platforms.?You?must?be?familiar?with?the?development?environment?used?to?access?BAPIs.?

BAPIs?are?available?from?development?platforms?external?to?R/3?that?support?the?Remote?Function?Call?(RFC)?protocol.?If?you?are?developing?your?application?in?a?non-object?oriented?programming?language,?you?need?to?have?RFC?programming?skills?to?call?BAPIs?via?RFC.?In?particular,?you?need?to?know?how?to?perform?RFC?calls.

==========
BAPI的簡單實現步驟
一,創建Function?Module?

1,在SM11,創建需要的structure?

2,在SE80,建Function?group?

3,在SE37,創建Function?Module?


Note:一個Function?Group只能包含一個BAPI;參數傳值;必須有有一個BAPIRETURN類型的EXPORT參數?


二,封裝?

1,在SWO1,建Object?Type?

2,把Function?Module作為一個Method加入,utilities->API?Methods->Add?Method?

3,release?Object和Module。使在BAPI?Browser?中可以看到。也就是外部能夠調用。?


三,調用?

1,如在另一系統中用ABAP調用,先在SM59中建RFC聯到有BAPI的R/3,(ZGOGO)?

在SE38的程序中調用,Call?Function?"ZBAPIXXXXX"?DESTINATION?ZGOGO?EXPORTING?...?


2,如用JAVA調用?

引入包;(不一定要用IBM的)?

import?com.sap.rfc.*;?

import?com.sap.rfc.exception.*;?

import?com.ibm.sap.bapi.*;?

import?com.ibm.sap.bapi.generated.*;?


建立連接;調用。。。(See?CALL_BAPI.java)?

VBA?for?SAP?

Private?Sub?CommandButton1_Click()
Set?oFunction?=?CreateObject("SAP.LogonControl.1")
Set?oConnection?=?oFunction.NewConnection
oConnection.Client?=?"500"
oConnection.Language?=?"EN"
oConnection.User?=?"user"
oConnection.Password?=?"pasword"
oConnection.ApplicationServer?=?"sap1.yok.com.cn"
oConnection.SystemNumber?=?"01"
result?=?oConnection.Logon(0,?True)
Set?ofun?=?CreateObject("SAP.FUNCTIONS")
Set?ofun.Connection?=?oConnection
Set?func?=?ofun.Add("RFC_READ_TABLE")
func.Exports("QUERY_TABLE")?=?"MARA"
If?func.Call?=?True?Then
Set?oline?=?func.tables.Item("DATA")
Row?=?oline.rowcount
i?=?1
Do?While?i?<=?Row
???Cells(i,?1)?=?Mid(Trim(oline.Value(i,?1)),?4,?22)
?????i?=?i?+?1
???Loop
???Else
???MsgBox?"FAIL"
End?If
End?Sub

VBA2Private?Sub?CommandButton1_Click()
Dim?sapFunctionCtrl?As?Object?????????'Function?Control?(Collective?object)
Dim?sapConnection?As?Object???????????'Connection?object
Dim?theFunc?As?Object?????????????????'Function?object
????
Set?sapFunctionCtrl?=?CreateObject("SAP.Functions")
Set?sapConnection?=?sapFunctionCtrl.ConnectionsapConnection.Client?=?"800"
sapConnection.user?=?"user"
sapConnection.Language?=?"EN"If?sapConnection.logon(0,?False)?<>?True?Then
MsgBox?"No?connection?to?R/3!"End?IfSet?theFunc?=?sapFunctionCtrl.Add("ZRFCPING")
If?theFunc.call?Then?'?call?the?RFC?FM
MsgBox?"RFC?call?is?okay"
End?If
sapFunctionCtrl.Connection.logoff
Set?sapConnection?=?Nothing
Set?sapFunctionCtrl?=?Nothing
End?Sub

其他還有很多,有幾個demo~?



'引用自http://hi.baidu.com/bobylou/blog/item/b3a9b90ee8cc37e436d122de.html

轉載于:https://blog.51cto.com/zhouying/168813

總結

以上是生活随笔為你收集整理的SAP BAPI的一些初级资料的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。