Skip to Content

When there is a requirement to copy a particular gateway service from one server to another server, the most time consuming part is to copy the data model manually by creating all the entities, entity sets, associations and navigation paths.

Now to overcome this big trouble, there is a better way given by SAP. There is an option called “Data Model From File”.

The goal of this document is to provide the steps to use this option “Data Model from File”.


Steps:

    1.    Generate METADATA:

Suppose we want to copy the Gateway Service “ZTEST_SALESORDER”. Then first of all we have to generate the $metadata of this service. For this we        have to go to Service Maintenance and select the System for which the Service Registration has already been done. Then click the button “Maintain”.

Image1.png

This will give a pop-up message, click yes.

Image2.png

This will open the “Activate and Maintain Services” screen.

Image3.png

Here click on the button “Gateway Client”. This will open SAP NetWeaver Gateway Client screen.

To directly open SAP NetWeaver Gateway Client screen one can use the Tcode /iwfnd/gw_client

Image4.png

Now to get the METADATA add $metadata at the end of the URI as below:

/sap/opu/odata/sap/ZTEST_SALESORDER_SRV/$metadata

Click F8.

Now the entire METADATA of the data model will be displayed inside the HTTP response section.

Image5.png

2.    Create EDMX file

Copy the entire metadata from the previous step and paste it in a text file. After that save the text file with the extension .edmx

    3.    Use EDMX File to copy the data model into a new service

Now we will create a new Project from transaction SEGW (SAP NewtWeaver Gateway Service Builder).

Image6.png

Now right click on Data Model and select the option Import -> Data Model From File

Image7.png

Chose the EDMX file that we have saved in the previous step.

Image8.png

    Click “Open”.

    Now check the service in SEGW. All the entity, entity sets, associations, association sets, navigation paths are automatically copied into the newly      created service.

    Image9.png

    After that the Runtime Objects can be generated for the service and accordingly the Service Implementations can be copied.

  Appendix(Copy Standard Service):

    Here in the above example I have considered a custom service to be copied.  If you want to copy any standard service then you should follow the below      steps to get the metadata of the service.

    Open the TCODE /iwfnd/maint_service

    This will display the entire service catalog of the system. Select the one that you want to copy from the service catalog and then click on the button      Gateway Client.

Image10.png

After that please follow the previously discussed steps.

To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

  1. A J

    Hi,

    How to create edmx file from txt file?

    I’m not getting the file type .edmx in my system.

    Leads are appreciated..

    Regards,

    A J

    (0) 
  2. Sean Machado

    This is great, but I would like to make one comment.

    Copying the metadata and pasting into a file which we would then rename with an EDMX extension did not work for us.

    Instead, we right-clicked in the HTTP Response preview screen and selected “Select All”. Then we right-clicked again to “Save Target as”. When the “Save As” prompt popped up, we changed the Save As Type from XML to All Files. Then we made sure the File name had the EDMX file extension.

    Then it imported fine for us.

    Regards,

     

     

    (0) 

Leave a Reply