Show TOC

Importing Data Model from FileLocate this document in the navigation structure

Use

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:

This feature can be used in the following scenarios:

  • 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).

Prerequisites
  • For model files with Vocabulary-Based Annotations, the used vocabulary definition should be available in the vocabulary repository maintained in service builder. See Importing a Vocabulary File for more information.

  • 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. See Adding Vocabulary-Based Annotations to Data Model Artifacts for more details.

  • 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
More Information
Importing a Data Model - New and Empty Project

Procedure

To Import a model file proceed as follows:

  1. Open Service Builder and create a new project by following the instructions in the Creating a Service Builder Project section. 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.

    Note

    For existing projects, these folders are already available and you have to just proceed with importing the data model file.

  2. In Edit mode 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.

  3. 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 will be 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.

  4. Click Finish.

    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.

  5. Double-click the artifacts to view their details in the mass edit area.

  6. Save the Project.

Importing a Model File - Existing Project

Procedure

To import a model file for existing project proceed as follows:

Note

If the project type is “Vocabulary based annotations” then custom import is not supported.

  1. Start the Service Builder in transaction SEGW.

  2. Click Open Project to open an existing project.

    The Open Project window appears.

  3. Either click the view cluster button or press F4 from the key board to view the available projects.

  4. Select a project to modify and click Execute to execute the project.

    The project displays in the Service Builder.

  5. Click Display/Change on the tool bar.

    OR

    Right click on Data Model and select 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.

    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

    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

    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

    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

    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. 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.

  10. Double-click the artifacts to view the details in the mass edit view.

  11. 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: