The function objects of the R / 3 are encapsulated in the business target library BOR (Business Objects Repository) of SAP R / 3. BOR can be accessed by BAPI (Business Application Programming Interface). BAPI is a special development interface dedicated to the R / 3 platform. From the perspective of system integration, BAPI can only support the integration between "SAP Application-SAP Application". In the integrated technology of SAP Applications - Non-SAP Applications, the R / 3 DCOM interface is relatively wide.
1. Introduction to R / 3 DCOM interface
The R / 3 DCOM interface is mainly used for applications for Windows platform access R / 3. In addition to accessing BAPI, R3 DCOM can also remotely call the ABAP program on R / 3 (requires version support after DCOM Connector 4.6D).
Among the SAP's Frontend CD, an R / 3 DCOM generated and administering tool came called DCOM Connector. The DCOM generated by the DCOM Connector contains two components, one is a service proxy component, which is used to call the R / 3 BAPI or remote method; the other is the SESSION component, used to manage the interaction of the business agent components and the R / 3 system.
R / 3 DCOM components are running in a COM environment (or MTS).
DCOM Access the R / 3 Application Server via the RFC protocol. RFC is the basic protocol of the R / 3 development interface. Not only DCOM uses the RFC protocol, IDOC and BAPI also use RFC access R / 3 application servers.
R / 3 DCOM can be accessed by desktop applications developed by C / C , VB, or embed VB Script, Java Script, and ASP pages to support web applications.
The architecture diagram of R / 3 DCOM is as follows:
Second, use DCOM Connector
1. Install the operating environment. If it is Win2000, only the VC6 development environment is required. If it is NT / 98/95, you need IE5.0 or later, and Microsoft's database access component MDAC2.5 is installed. It is recommended to use Win2000.
2, install the DCOM Connector. All the way the default installation, if you don't need COM4abap, then nothing is used without anything in the Configure COM4abap property page. The installed DCOM Connector is a Windows MMC program.
3. Open the DCOM Connector, go to the node Destination, configure the Destination. Save after filling in various parameters and tested the connection.
4. In the DCOM Connector, go to the node Object Builder, select the Destination that has just been saved, enter the password to log in. Then select the BAPI or remote method to export or deploy DCOM.
have to be aware of is:
1. If the R / 3 client is installed on the same machine, it is possible to conflict with the DESTINATION with the DCOM Connector. At this point, you can reconfigure the Destination with another name.
2. In the Object Builder of the DCOM Connecctor, you can choose whether to create a session. About Session will be described below.
3, DCOM Connecctor Exports C code of the COM standard, including the MAK file, and then compile with the local compiler nmake.exe to generate a COM standard DLL. Therefore, the unit must install the C / C compilation environment, and the author uses VC6.
4. Specify an MTS Package name in Object Builder, then deploy COM automatically installed. It is recommended to deploy COM manually in "Component Services".
5. In the DCOM Connector, you can monitor and find R / 3 DCOM components that have been deployed on this unit, and similar Windows components. Third, use R / 3 DCOM components
1, session components
The interface of the Session component is ISAPSession, including two functions of login verification and transaction management.
Typical R / 3 landing code:
DIM STRERR AS STRING
DIM BLNRET As Boolean
Objsapsession as mygoodsmvtlib.goodsmvtsessionComponent
Objsapsession = creteObject ("Sap.goodsmvtSessionComponent.1")
Objsapsession.putsessionInfo (_Destination, _USERNAME, _Password, _language, _organization)
BRESULT = Objsapsession.logon (strerrorMessage)
Typical transaction submission code:
Try
// Operation of a business agent component
Objsapsession.commitwork ()
Objsapsession = Nothing
Objgoodsmvt = Nothing
Catch
Objsapsession.rollbackwork ()
Objsapsession = Nothing
Objgoodsmvt = Nothing
END TRY
The Session component can manage one or a group of business proxy components. Session can submit a business method of multiple service proxy components in the same transaction or share RFC connections in multiple service proxy components.
However, the Session component is not necessary. In fact, the method of transaction management is packaged in the IsapConnector interface. The ISAPSession interface of the Session component has transactional features due to inheriting IsapConnector. Similarly, the business agent components also inherit from IsapConnector, so the business agent components can also be submitted separately. Different, the service agent component uses the respective independent RFC connections and cannot submit multiple components methods in a transaction.
2, business agent components
Business agent components are Proxy of R / 3 BAPI and R / 3 remote methods. The application uses this proxy to call the R / 3 BO as transparent as local locally. Different business objects in R / 3 correspond to different business agents.
The business agent component can be created by the Session component:
ET ORIDERS = OSession.CreateInstance ("Sam.Goodsmovement.1))
Different business proxy components have realized a common interface in addition to the business interfaces that implement their respective functions: isapcatalog. DCOM Connector uses this interface to manage and monitor business agent components.
l PutseesionInfo () - Set the target parameters of the system call
l AdvicefcGuisink () - for situations for SAPGUI or Dubugging.
l CommitWork () - For data updates, no Implicit Commit.
l initKeys () - DCOM target key initialization
l DIMAS () - Returns the Microsoft Ado (Advanced Data Object) record (supporting cursor control).
Fourth, summary
R / 3 DCOM is more suitable for small R / 3 plug-in, or integrate with Windows-based small applications. For large R / 3 EAI, Tibco, WebMethod, BizTalk, Crossworld, etc. can be considered.