How to copy an existing Service Builder project for a similar use case to save time and
effort.
Context
To reduce development effort and save time, you can create a new Service Builder project
by copying an existing project together with its data model and service implementation.
Note that while you can copy the mapping information contained in a project's service
implementation, you cannot copy the generated ABAP classes since these have to be
generated explicitly for the project created as a copy. It can be particularly helpful
to copy a project if a project has already been created for a similar use case and you
can reuse its artifacts with minimal changes. To copy an existing Service Builder
project, proceed as follows:
- Ensure the project you want to copy is open in the tree view. To open a project, click
(Open Project) and enter the project name or use the input help
available.
- In the tree view, right-click on the name of the project you want to copy and
select Copy Project. Alternatively, click from Service Builder menu.
- In the Create Project dialog box, overwrite the name of
the existing project with the name of the new project you want to create as a
copy. Enter the new name in the Project
field.
Example If you want to create a new version of an existing
project, you can simply append a version number, for example, 0001, to the
original project name. In this way, it is apparent, that the new project is
based on an earlier version of the project of the same root name. In some
cases, it might be helpful to have several versions of the same project
indicated by a numeric counter of this kind.
- Overwrite the description of the existing project you want to copy with a
suitable description for your new project. While it is not mandatory to enter a
short description, it is helpful to do so.
- In the Copy from Template Project section of the dialog
box, ensure the name of the project you want to copy is displayed in the
Project field and verify that this is the correct
project.
- If you want to copy the project together with its data model and service
implementation, select Data Model and/or Service
Implementation. In this context, copying the service
implementation refers to the copying of the mapping information, not the actual
runtime artifacts.
Note
- Note that if you want to copy the service implementation, you must
also copy the project's data model. However, you can copy the
project's data model without copying service implementation.
- In the project type Annotation Model for Referenced
Service, you can copy only the data model of the
project, Service Implementation field will be
disabled.
- Under Attributes, the project type (Service
with SAP Annotations or, Service with
Vocabulary-Based Annotations or, Annotation Model for
Referenced Service) of the project you are creating as a copy is
displayed in the Project Type field. The type displayed
here depends on the type of project specified when the original project was
created. If the original template project was specified as type
Service with SAP Annotations then the copied project
will inherit this project type.
- Under Attributes, specify the generation strategy you
want to use. The Standard generation strategy is used as
default and it is recomended to use the same generation strategy that was
specified for the original project.
- Under Object Directory Entry, enter the name of the
package in which you want to create the copy of the project and click
Enter.
Note If you do not want the copy of the project
to be created in a package to be transported from one system to another in
the system landscape, enter $TMP as the package name or click
Local Object.
Results
The Service Builder creates a new project as a copy of the template project you selected.
The new (copied) proiect is displayed in the tree view on the left-hand side of the
screen. The newly created project contains the same arfiacts as the tempate project you
copied. Consequently, if you selected
Data Model and
Service Implementation in the
Create
Project dialog box, these are included in your new project. That is, if
you copied the data model from the existing project, the new project contains the same
entity types, properties, navigation properties, associations, and entity sets contained
in the original data model.
To save the new project in the Service Builder, click
Save. Your project is saved and you can subsequently return
to the Service Builder at any time, open this project, and continue the service
development and modeling process. If you do not save your project, your data will be
lost when you close Service Builder. After you have made all the relevant changes to
the new project, click Generate to create the runtime artifacts
for this new project. After the runtime artifacts have been generated, you must
register the new service in the relevant system using the Service Maintenance
function.