Show TOC

Importing Data Model from FileLocate 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
  • 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 is 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 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 is selected by default for empty models.
  4. Click Browse to select an xml or edmx file and click Next.
    Note If 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 is displayed under the Data model in the tree region. The OData artifacts available in the imported model file populates 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 loose your data 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 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 Display-Change(Display-Change) on the tool bar. 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 is 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 file (file that is being imported) has some changes, then these artifacts have the status 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 remain unchanged.
    New(New) If the imported file contains an artifact that is not present in the Data Model, then that artifact is displayed with the status New . On selecting that artifact, a new entry is created in the Data model.
    Delete(Delete) If the file does not contain the artifact that exists in the data model, then it displays Delete status. If you select the artifact, it is deleted from the data model. If this option is not selected, then data model 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 is disabled for selection. These artifacts are 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.
You can perform an OData consistency check on the project to report any OData compliance errors. The OData artifacts along with the vocabulary annotations available in the imported model file is populated under the respective folders under the project. Also referenced vocabularies, if any, is added to the data model.
Note Annotations supported by SAP 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 is populated under the respective folders under the project.
  2. Double-click the artifacts to view the details in the mass edit view.
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 (SAP 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).

  • Import more properties in your project by right clicking the entity and selecting Start of the navigation path Import Next navigation step Properties End of the navigation path. This opens a wizard to select the required properties.
  • Generate the runtime objects. For more information, seeGenerate Runtime Objects.

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