ITPub博客

首页 > Linux操作系统 > Linux操作系统 > [转载]ABAP中有关BAPI的介绍

[转载]ABAP中有关BAPI的介绍

原创 Linux操作系统 作者:TerryWangYR 时间:2008-07-12 00:48:17 0 删除 编辑

 ABAP中有关BAPI的介绍
1.BAPI – business application programming interface
2.它实际上是一种特殊的Remote Function Modules (RFC)是为了提供使用外部程序来进行交易活动
3.它提供的基于企业目标(Business Object) 技术的接口应用界面
4.SAP采用了Object-oriented技术,逻辑定义了SAP R/3系统的所有功能目标,并且将所有的目标(Objects) 和BAPIs存储于企业目标库BOR(Business Objects Repository).
5.SAP R/3 企业目标的目标类型(Object Type) 相当于目标设计语言中类(Class) 的概念,其定义结构由以下几部分组成:基本数据,接口界面,键(Key Fields),方法(Methods),特征(Attributes),事件(Events)

--如何创建BAPI程序
1.定义BAPI Structure (Structure不能在BAPI中重复使用,因为一旦BAPI被释放,其Structure被冻结)
2.创建FUNCTION MODULE
每个BAPI必须有自己的Function Group,Function Group属性必须为RFC
3.创建Business Object
4.使用BAPI WIZARD创建API Method
这样BAPI可以被外部程序调用
5.Function Module符合BOR Method
4.释放BAPI Function Module,
释放Business Object Type,
释放BAPI作为BOR的一种Method


简单应用一段代码,希望得到各位大虾指点指点...

Calling a BAPI From within the R/3 system

report zwes_test_bapi.

parameters order like bapivbeln-vbeln.
data: return like bapireturn,
statusinfo like standard table of bapisdstat initial size 0.

call function 'BAPI_SALESORDER_GETSTATUS'
exporting
salesdocument = order
importing
return = return
tables
statusinfo = statusinfo.

if return-type = 'S'.
* Process the returned information
else.
write: 'Error:', return-message.
endif.

report zwes_test_bapi.

parameters order like bapivbeln-vbeln.
data: return like bapireturn,
statusinfo like standard table of bapisdstat initial size 0.

call function 'BAPI_SALESORDER_GETSTATUS'
destination 'HP2'
exporting
salesdocument = order
importing
return = return
tables
statusinfo = statusinfo.

if return-type = 'S'.
* Process the returned information
else.
write: 'Error:', return-message.
endif.

Dim CompanyCode As Object

Set CompanyCode = BapiControl.GetSAPObject(ObjectName, _
"1234", "COMP_CODE"))

CompanyCode.ZCCGetDetail Return:=Result, CompanyList:=Detail

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9333231/viewspace-376659/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: SAP Client copy
请登录后发表评论 登录
全部评论

注册时间:2008-05-17

  • 博文量
    41
  • 访问量
    41223