Você está na página 1de 16

1. Create a new project ZGW100_XX_SO (SO stands for Sales Order).

XX is just a placeholder
for a group number and GW100 indicates the course number as the screen shots were taken
from the GW100 training course material that I have created.

2. Create the first entity by importing an RFC interface. For this right-click on Data Model and
choose Import -> RFC/BOR Interface

3. Enter the following values in the wizard and then choose Next:

Entity Type Name


Target System
Data Source Type
Data Source Name

SalesOrder
Local
Remote Function Calls
BAPI_EPM_SO_GET_LIST

4. Expand the SOHEADERDATA node and select the


SO_ID, NOTE, BUYER_ID, BUYER_NAME, CURRENCY_CODE,
NET_AMOUNT,
TAX_AMOUNT
Note that SOHEADERDATA is not selected. Choose Next.

following fields:
GROSS_AMOUNT,

5. In the first line, SO_ID, select the field Is Key and choose Finish:

6. Create the second entity again by importing an RFC interface. Right-click Data Model and
choose Import -> RFC/BOR Interface

7. Enter the following values in the wizard and choose Next:

Entity Type Name


Target System
Data Source Type
Data Source Name

SalesOrderItem
Local
Remote Function Calls
BAPI_EPM_SO_GET_LIST

8.
Expand
the
SOITEMDATA
node
and
select
the
following
fields:
SO_ID, SO_ITEM_POS, PRODUCT_ID, NOTE, CURRENCY_CODE, GROSS_AMOUNT,
NET_AMOUNT,
TAX_AMOUNT,
QUANTITY,
QUANTITY_UNIT
Note that SOITEMDATA is not selected. Choose Next.

9. In the first and second line, SO_ID, SO_ITEM_POS, select the field Is Key and choose Finish:

Now our project has 2 entities one for the Sales Order and one for the Sales Order Line Item.
As a next step we create entity-sets out of these entities.
1. Expand the node Data Model and double-click Entity Sets:

2. Click the Create button twice to add two new lines to the table:

3. Enter the following values:

Name
SalesOrderCollection
SalesOrderItemCollection

Entity Type Name


SalesOrder
SalesOrderItem

4. Choose Save:

Now the basic definition of the Model is done. As a next step we can generate the necessary
runtime artifacts.

1. Choose the Generate pushbutton:

2. Leave the default values and choose Enter:

Please note the Technical Service Name ZGW100_XX_SO_SRV is equal to the External Service
Name required to consume this service later on.

3. Choose Local Object:

4. Verify that the runtime objects have been generated successfully:

Now we can Register and Activate the Service.

1. Double-click Service Maintenance:

2. Select system ZME and choose the Register button. Please note that the entries listed here
depend on the System Alias configuration you have done in the SAP NetWeaver Gateway
Implementation Guide (IMG). In a local deployed environment (Backend and Hub components
deployed on the same box) you might also find LOCAL with the RFC destination NONE
here.

3. Confirm the warning message displayed in the popup:

4. Press F4 to select the system alias. Select ERP_EMEA from the input help. Please note that
you wont get any popup if there is only 1 System Alias maintained. As mentioned above,
depending on the deployment method and IMG configuration you possibly see an alias
LOCAL instead of the ones shown in the screen shot:

5. Confirm the Select System Alias popup:

6. Leave the default values and enter $tmp as the package and choose Enter:

The External Service Name is defaulted with the Technical Service Name from the Generation
Step.

7. Verify that the service has been registered and activated successfully:

Now we can run our service the first time. Please note that weve only maintained the basic
model data so far. As a consequence we can access the metadata of the service, but not yet any
business data (that will come in part 2).

1. Open a new window, start transaction /IWFND/GW_CLIENT.


2. Enter URI: /sap/opu/odata/sap/ZGW100_XX_SO_SRV/$metadata and choose Execute:

ZGW100_XX_SO_SRV is the External Service Name that was registered before.

Você também pode gostar