Sie sind auf Seite 1von 5

Exercise 4 Proxy to BAPI Overview This exercise introduces the generation and execution of ABAP proxies in a Web Application

n Server 6.40 or above. We will demonstrate the reusability of objects in the XI Repository, and emphasize the outside-in approach for interface development, offered by XI.

SAP R/3 4.6C

RF C BAPI Z_BAPI_PO_CREATE XML / Proxy Order Data

SAP Web AS 6.40 Purchasing Application

Prerequisites Good understanding of basic XI 3.0 features Basic knowledge of ABAP-OO programming

Description This is similar to the previous exercise, where the plain HTTP client was used to post XML data to XI, first synchronously then asynchronously. In this case, instead of an HTTP client, an ABAP program will send the message via the proxy framework. The assumption, of course, is that there is a client available in a SAP WebAS 6.40 or above for this purpose. The instructor will explain the outside-in development approach which is a fundamental concept behind SAP Exchange Infrastructure. We will fully re-use the existing Repository objects and generate a synchronous proxy in the ABAP client. During this process we will deal with naming conflicts for the generated proxy, and learn how to address them. Then we will explore the ABAP proxy runtime and send a message from an application program. Exercise steps Step 1 Repository Since we are reusing the PO-related objects created in the previous exercise, nothing needs to be done in the Integration Repository. Step 2 ABAP client 2.1 Generate an outbound synchronous proxy for your message interface PurchaseOrder_out 2.1.1 Log on to the SAP Web AS 6.40 client available for this workshop (ask instructor for details). 2.1.2 Enter transaction SPROXY. In the list of Software Components, expand your own Software Component. Rightclick on the interface name, PurchaseOrder_out, and click on Create.

2.1.3

A window will pop up to allow entries for Package Name and Prefix. Enter the following: Package: $TMP Prefix: ZGROUP[XX]. Please use individual prefix!

2.1.4

When generating the proxy, you may get a warning message regarding naming problems. You will have to select the tab Name Problems and examine the situation. The names of the ABAP proxy objects are limited to 30 characters. Because of the prefix and the long names for the repository objects, the system has truncated them, which in turn led to duplicates. Resolve the naming conflicts, using the suggested values below: Name in Integration Builder PurchaseOrder_out header item PurchaseOrderRequest PurchaseOrderResponse Recordset Return Recordset (table type) Return (table type) Item (table type)

2.1.5

ABAP Name ZGROUPXXCO_PURCHASE_ORDER_OUT ZGROUPXXPO_OUT_HEADER ZGROUPXXPO_OUT_ITEM ZGROUPXXPO_OUT_POREQUEST ZGROUPXXPO_OUT_PORESPONSE ZGROUPXXPO_OUT_RECORDSET ZGROUPXXPO_OUT_RETURN ZGROUPXXPO_OUT_RECORDSET_TAB ZGROUPXXPO_OUT_RETURN_TAB ZGROUPXXPO_OUT_ITEM_TAB 2.1.6 2.1.7

Examine the rest of the ABAP class and generated DDIC objects. Then, save and activate your proxy (ignore warnings about reserver fields key and return.) There is nothing more to be done with the proxy. The classes and structures generated for an outbound proxy cannot be changed. They can only be referenced and executed. To execute the proxy, we will write an ABAP report. This will be presented in a later step.

Step 3 Directory

The Integration Directory configuration steps should be identical to Exercise 2, the only exception is the sender information. In this case the Sender Service name should be the Business System of the WebAS system defined in the System Landscape Directory.

Step 4 Test To test the ABAP proxy, we will use an ABAP report. 4.1 In SAPGUI, use transaction SE38 and create an ABAP report, with the name: Z_XIWS_[XX]_SEND_PO 4.2 Examine file Z_XIWS_XX_SEND_PO.abap, provided to you. In the type definition section, adjust the type names according to your own proxy types in the system. Replace all occurrences of [XX] with your group number. 4.3 In transaction SE38, create a report with the same name Z_XIWS_[XX]_SEND_PO (type: executable program). Assign the program to package $TMP (local object). Cut and paste the contents of your file into the source code area. 4.4 Perform a syntax check. Save and activate the report.

4.5 Execute/test the report. Change the vendor to your assigned vendor id.

4.6 In transaction SXMB_MONI, you can view the status of the message. Notice that you see 4 entries for your message, representing the request and response in integration engine: Integration Engine located in the main integration server client Integration Engine located in the application client where the proxy resides. Step 5 Optional For additional practice, generate and run an outbound asynchronous proxy for interface based on the asynchronous interface used in the exercise 1.

Appendix: naming conventions and terminology Exercise 4 Area SLD Int. Rep. Obj. type n/a NS XSD Msg.type Msg.type Msg.int. Msg.int. XSLT XSLT Archive Int.map Int.map. Context scenario service Prefix proxy Object name n/a urn:xiworkshop:groupXX[00..30]:webapp PurchaseOrderCombined PurchaseOrderRequest PurchaseOrderResponse PurchaseOrder_out PurchaseOrder_out_async POReq__Z_BAPI_PO_CREATE_req.xsl ZBAPI_PO_CREATE_resp__POResp.xsl PurchaseOrder__Z_BAPI_PO_CREATE PO_out__Z_BAPI_PO_CREATE PO_out_async__Z_BAPI_PO_CREATE Vendor xiworkshop_groupXX[00..30] XIWS_web_purchasing_XX ZGROUPXX ZGROUPXXCO_PURCHASE_ORDER_OUT ZGROUPXXPO_OUT_HEADER ZGROUPXXPO_OUT_ITEM ZGROUPXXPO_OUT_POREQUEST ZGROUPXXPO_OUT_PORESPONSE ZGROUPXXPO_OUT_RECORDSET ZGROUPXXPO_OUT_RETURN ZGROUPXXPO_OUT_RECORDSET_TAB ZGROUPXXPO_OUT_RETURN_TAB ZGROUPXXPO_OUT_ITEM_TAB Z_XIWS_[XX]_SEND_PO Z_XIWS_XX_SEND_PO.abap ZBAPI_PO_CREATE Description No SLD objects All objects same as exercise 2

Int. Dir 640-cli

File sys R/3

Program Program RFC

Reuse scenario container Business service no party Prefix for proxy objects PurchaseOrder_out header item PurchaseOrderRequest PurchaseOrderResponse Recordset Return Recordset (table type) Return (table type) Item (table type) Program for testing the proxy Source code template for program RFC wrapper

Das könnte Ihnen auch gefallen