Start transaction SE80.
Select SAP GW Data Model from the drop-down list.
Enter a Data Model name (in this case we choose ZSFLIGHT02) and then press Enter.
A popup tells you that this object does not exist and asks if you want to create it. Select Yes and the Create Data Model popup displays, with the model name you entered already filled in.
Note that you have to specify a name that is in the customer namespace such as Z* or you can use another customer namespace.
Enter a Type of PS (Public Solution) for the Data Model or press F4 to select it. This is the only type of Data Model you can create at this stage.
Choose Generate from Data Source Object to have the Data Model created by the Data Model generator. There are other ways to create a Data Model but we are concentrating on this, the easiest option.
Choose the green check mark to continue.
In the next popup, enter the following additional data:
Enter an explanatory text in Description.
Select the Data Source Type which can be BOR, Screen Scraping, or RFC. In this case we select 0 BOR.
For System Alias you specify the system from where the data is being retrieved. Since we are using the BOR data source and since the SFLIGHT data model is delivered with any SAP system, you can select the option LOCAL.
Note that in a real world example you would select the logical system name of a Business Suite backend system.
In the screen Create Object Directory Entry you have to provide information that will specify how the new Data Model (R3TR IWOM ZSFLIGHT02_0001_PS) will be handled by the Change and Transport System.
In our example we have selected a name that is part of the Z namespace. Since we do not want to transport the Data Model, we select Local Object (package $TMP) and choose Save.
From the data source (BOR) tree, select the BAPI that you want to publish as an SAP Gateway service.
Note that the BOR tree displayed is the one from the system that you have specified through its system alias in step 7.
In this example we select the GetDetail BAPI from the Business Object (BO) Flight and choose Create Mapping.
In the Map Operation screen, enter the following:
Select an Operation Type of Read.
Since you want to have an interface that is easier to consume than the original BAPI, deselect several values.
In this step you could also rename the Properties that will be used by the SAP Gateway service.
Choose Continue (Enter).
After the Data Model has been successfully generated, a log is displayed.
Choose Continue (Enter).