Show TOC

Importing a Data ModelLocate this document in the navigation structure

Introduction
The File Import function is developed to allow importing of the data model files defined by external model editors like Visual Studio (edmx files) and the metadata files types (xml) into the Service Builder to create a data model. The files can be imported into the Service builder for the following Project Types:
  • Service with SAP Annotations
  • Service with Vocabulary-Based Annotations
  • Annotation Model for Referenced Service
  • To import a metadata/edmx file for a new project. In instances where you create a project and import a file.
  • To import a metadata/edmx file for an existing project, which already has a data model created (re-import). In this case, the existing data model will be overwritten.
See Creating a Service Builder Project for more details.
Prerequisites
  • For model files with Vocabulary-Based Annotations, the used vocabulary definition should be available in the vocabulary repository maintained in service builder.
  • If the EDMX file has only the Reference URL for referencing the used vocabulary, then as a pre-requisite the used vocabularies should be imported manually into the data model before the file import.
  • Ensure that the virus scan profile /SCET/GUI_UPLOAD is Active and selected as Default Profile in the SAP system.
    Figure 1: Setting Virus Scan Profile
For more information, see http://help.sap.com/saphelp_nw74/helpdata/en/ae/ad1640033ae569e10000000a155106/frameset.html
More Information
For more information on Virus Scan Profile, see Related topics.
Importing a Data Model - New and Empty Project
To Import a model file proceed as follows:
  1. Open transaction SEGW. The SAP NetWeaver Gateway Service Builder appears.
  2. Create a new project by following the instructions in Creating a Service Builder Project. The Service Builder creates the new project together with an empty folder structure. You can see the newly-created project structure in the tree view in the left-hand screen area.
    Note For existing projects, these folders are already available and you have to just proceed with importing the data model file.
  3. Right click on the Start of the navigation path Data Model Next navigation step Import Next navigation step Data Model from File End of the navigation path to import a metadata/edmx type file. The Wizard Step 1 of 2: File Import page appears.
    Note In the Wizard Step 1 of 2: File Import page, Full Import radio button will be selected by default for empty models.
  4. Click Browse to select an xml or edmx file and click Next.
    Note When a file other than the xml or edmx type is selected, an error message displays.
    The Wizard Step 2 of 2 File Import page appears. The page displays the exact structure that will be displayed under the Data model in the tree region. The OData artifacts available in the imported model file will be populated under the respective folders under the project.
  5. ClickFinish. On successful import of the xml or edmx file a message displays in the Service Builder’s status bar confirming the status of the import.
  6. Double-click the artifacts to view their details in the mass edit area.
  7. Save the Project.
    Note If you do not save your newly-created project, your data will be lost when the Service Builder is closed.
Importing a Model File - Existing Project
To import a model file for existing project proceed as follows:
Note In case of project type Vocabulary based annotations, custom import is not supported.
  1. Open transaction SEGW. The SAP NetWeaver Gateway Service Builder opens.
  2. Click Open Project(Open Project) to open an existing project. The Open Project window appears.
  3. Either click the view cluster button or press F4 to view the available projects.
  4. Select the project and click Execute(Execute) to execute the project. The project displays in the Service Builder.
  5. Click the change Display-Change(Display-Change) on the tool bar.

    OR

    Right click on Data Model and choose Change . The project is now open for editing.
  6. Right click on Data Model and in the resulting submenu, select Start of the navigation path Import  Next navigation step Data Model from File End of the navigation path to import a metadata/edmx type file. An overwrite confirmation message displays. The Wizard Step 1 of 3: File Import appears.
    Note In case of existing project, Custom Import will be selected by default.
  7. Do the following in Wizard Step 1 of 3 :
    1. Select Custom Import to select the objects manually from the model.
    2. Select Full Import to overwrite the existing model. Follow the steps in the previous section "Importing a Data Model - New and Empty Project" to complete the full import.
    On selecting the Custom Import, follow below steps:
  8. Click Browse to select and import an xml or edmx file and click Next. The Wizard Step 2 of 3: File Import window appears.
    The window displays the following statuses for the artifacts:

    Status

    Description

    Edit(Edit) If an artifact is available in both the file and in the Data model, but if the one in the file (file that is being imported) has some changes, then these artifacts will have the status has changed . You can choose to adapt the file changes in the data model. If this option is not selected, then the artifact in the data model will remain unchanged.
    New(New) If the imported file contains an artifact that is not present in the Data Model, then that artifact will be displayed with the status New . On selecting that artifact, a new entry will be created in the Data model.
    Delete(Delete) If the file does not contain the artifact that exists in the data model, then it will be displayed with Delete status. If you select the artifact, it will be deleted from the data model. If this option is not selected, then data model will remain unchanged.
    Equal(Equal) If an artifact exist in both the data model and in the file and if it is equal, then the artifact will be disabled for selection. These artifacts will be displayed with the status Equal
    Note For “Service with SAP Annotations” project type, if the file to be imported is for OData version V3 or higher, the elements in higher version are ignored and only OData V2 elements are imported.
  9. Click Next when you have completed the selections. The Wizard Step 3 of 3: File Import page appears. This page displays the preview of the selected artifacts.
  10. Click Go Back to modify your selection or click Finish to confirm the selections. An OData consistency check is performed on the project to report any OData compliance errors.
  11. Double-click the artifacts to view the details in the mass edit view.
  12. Save the Project.
An OData consistency check is performed on the project to report any OData compliance errors The OData artifacts along with the vocabulary annotations available in the imported model file will be populated under the respective folders under the project. Also, any referenced vocabularies will be added to the data model.
Note Annotations supported by SAP NetWeaver Gateway runtime is supported by the File Importer for Project Type Service with Vocabulary-Based Annotations.
Result
  1. On successful import of the xml or edmx file a message displays confirming the import. The OData artifacts available in the imported model file will be populated under the respective folders under the project.
  2. Double-click the artifacts to view the details in the mass edit view.
  3. Click Save to save the project.
Activities
You can also perform the following activities in the Service Builder after importing the data model:
  • Make the required changes to the artifacts in the Service Builder. For more information, see Defining a Data Model .

  • Include a different OData service (GW) and create an Association. For information, see Including an OData Service.

  • Import entities from search help as a data source to enhance the model. For more information, see Importing Search Help as a Data Source

  • Import entities from a data source to enhance the model. For more information, see Importing a Data Source (RFC/BOR Interface).

  • Generate the runtime objects. For more information, seeGenerate Runtime Objects.

  • Register and maintain the service in the configured Gateway hub systems. For more information, see Service Maitenance.