You are on page 1of 12

Technical Reference

How To Enhance Utilities Enterprise Services

CUSTOMER
Document Version: 1/2013
Copyright
© 2013 SAP AG or an SAP affiliate company. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose without
the express permission of SAP AG. The information contained herein may be changed without prior
notice.

Some software products marketed by SAP AG and its distributors contain proprietary software
components of other software vendors.

National product specifications may vary.

These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational
purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for
errors or omissions with respect to the materials. The only warranties for SAP Group products and
services are those that are set forth in the express warranty statements accompanying such products
and services, if any. Nothing herein should be construed as constituting an additional warranty.

SAP and other SAP products and services mentioned herein as well as their respective logos are
trademarks or registered trademarks of SAP AG in Germany and other countries. Please see
http://www.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademark
information and notices.

(C) SAP AG Technical Reference 2


Table of Contents

How To Enhance Utilities Enterprise Services ....................................................................... 4


Activities in the SLD (SAP NetWeaver PI) .......................................................................... 5
Activities in the ESR .......................................................................................................... 7
Activities in the back-end system ....................................................................................... 9
Testing ............................................................................................................................ 11

(C) SAP AG Technical Reference 3


How To Enhance Utilities Enterprise Services
To accommodate your business requirements, you, as an SAP customer or partner using SAP
Utilities, must enhance Utilities-specific enterprise services. You might need to offer additional
elements in existing enterprise services because you have enhanced the SAP Utilities business
functionality.

This technical reference guides you through the necessary activities using Utilities-specific examples.

There are three different methods of enhancing SAP enterprise services:

Extend

Enhance

Duplicate

This guide focuses on Enhance. Enhance is the method we recommend for customers and partners.
You define your enhancement elements in your own namespaces and these enhancement elements
refer to the SAP standard enterprise service.
The enhancement method described in this document does not modify standard enterprise
services.

Prerequisites
You need advanced knowledge of SAP enterprise services and their integration with business logic
and semantics.

For a general description on how to enhance SAP enterprise services and a comprehensive
description of the different enhancement methods, we recommend reading the Enterprise Services
Enhancement Guide published in the SAP Community Network (SCN).

See http://scn.sap.com/community/web-services under Content Documents .

To access the SAP Community Network, you must register and agree to the terms and conditions of
its use.

Example
The Utilities-specific example used throughout this technical reference describes the following
scenario:

For the enterprise service UtilitiesDeviceERPSmartMeterCreateRequest_Out, the new optional field


FUNKID is added to the existing Intermediate Data Type (IDT)
UtilsDvceERPSmrtMtrCrteReqUtilsDvce.

The following activities are necessary:

1. Activities in the System Landscape Directory (SLD) in SAP NetWeaver PI

1. Creating a product, product version, software unit, software component version


(SWCV), and an enhancement software component version (EnSWCV) in SLD

2. Defining dependencies between SWCV and EnSWCV in SLD

2. Activities in the Enterprise Services Repository (ESR)

1. Importing an enhancement software component version (EnSWCV) into ESR

(C) SAP AG Technical Reference 4


2. Creating a namespace

3. Creating an enhancement data type

3. Activities in the backend system

1. Generating an enhancement proxy structure

2. Implementing Business Add-Ins (BAdIs)

Activities in the SLD (SAP NetWeaver PI)


To enhance enterprise services, the following activities are necessary in the System Landscape
Directory (SLD):

1. Creating a product, product version, software unit, software component version (SWCV), and
an enhancement software component version (EnSWCV)

For more information, see the Enterprise Services Enhancement Guide in the SCN, chapter
2.1.1. – Creating a Product, Product Version, Software Unit, SWC, and EnSWCV in SLD.

2. Defining dependencies between SWCV and EnSWCV

To use the enhanced objects from namespaces of the underlying software component
version (SWCV), you create a dependency between the EnSWCV and the SWCV from which
you must enhance the service operation.

For more information, see the Enterprise Services Enhancement Guide in the SCN, chapter
2.2. – Defining Dependencies Between SWCV and EnSWCV in SLD.

Example
For the Utilities-specific example used throughout this technical reference, the procedure is as
follows:

1. Creating a product and a product version:

Product name Enhancement_IS_UT

Product vendor www.dummy-is-ut.com

Product version 0.9

Unit name ENHANCEMENTUNIT_IS_UT

(C) SAP AG Technical Reference 5


Creating a Product and a Product Version

2. Creating a software unit:

Name ENHANCEMENTUNIT_IS_UT

Version 0.9

Product state Released

Creating a Software Unit

(C) SAP AG Technical Reference 6


3. Defining dependencies between software component version (SWCV) and enhancement
software component version (EnSWCV):

Dependencies – Prerequisite SW Component IS-UT 606

Defining Dependencies

Activities in the ESR


To enhance enterprise services, the following activities are necessary in the Enterprise Services
Repository (ESR):

1. Importing an enhancement software component version (EnSWCV)

You must import the EnSWCV (enhancement software component version) defined in the
SLD into the Enterprise Services Repository (ESR).

For more information, see the Enterprise Services Enhancement Guide in the SCN, chapter
3.1 – Importing an EnSWCV into ESR. Note that the activities described there work
differently with release 7.1 onward. For the current procedure, refer to the Utilities example.

2. Creating a namespace

To identify the objects in the SWCV before you develop an enhancement structure in the
EnSWCV, you must create a new namespace in the ESR.

For more information, see the Enterprise Services Enhancement Guide in the SCN, chapter
3.2 – Creating a Namespace in EnSWCV.

3. Creating an enhancement data type

To add a new field to an existing data type, you must create an enhancement data type in
the SWCV.

(C) SAP AG Technical Reference 7


For more information, see the Enterprise Services Enhancement Guide in the SCN, chapter
3.3 – Creating an Enhancement Data Type in the SWCV.

Example
To import the EnSWCV from SLD to the ESR for the Utilities-specific example used throughout this
technical reference, the procedure is as follows:

1. Importing an enhancement software component version (EnSWCV)

1. On the Exchange Infrastructure Tools page, choose Integration Repository.

Integration Repository

2. In the Design Objects tab, right-click to open the context menu.

3. Select the Software Component Version under Work Areas.

4. Choose Import from SLD.

5. Choose Display.

6. Select the EnSWCV from the list and choose Import.

2. Creating a namespace in the EnSWCV editor.

1. Select a unique name such as the URL of the company, together with some
additional information to identify the application.

Namespace http://dummy-is-ut.com/xi/XI

2. In the Change Lists tab, right-click to open the context menu and choose Activate.

Namespace Definition

3. Creating an enhancement data type

To add the new optional field FUNKID to the existing intermediate data type
UtilsDvceERPSmrtMtrCrteReqUtilsDvce, create an enhancement data type.

(C) SAP AG Technical Reference 8


Data Type Enhancement Name zenhancement1

Enhancement Definition FUNKID

Occurence 0..1 (recommended)

Data Type Enhancement

Activities in the Back-End System


In the back-end system, you generate a proxy structure for the enhancement and you implement a
Business Add-In (BAdI) to fill the fields in the enhancement proxy.

For more information, see the Enterprise Services Enhancement Guide in the SCN, chapter 4.1 –
Generating an Enhancement Proxy Structure and 4.2 – BAdI Implementation.

Example
For the Utilities-specific example used throughout this technical reference, the following activities are
necessary in the back-end system:

1. Generating an enhancement proxy structure

1. Call transaction SPROXY.

2. In the EnSWCV, navigate to your namespace and choose the folder Data Type
Enhancement.

3. Double-click the enhancement name and choose Create Proxy.

4. Enter a package and a prefix for your enhancement.

The system needs a prefix to make the enhancement proxy unique within the
application.

(C) SAP AG Technical Reference 9


5. Generate the enhancement proxy.

The ABAP system generates an append structure for the service node that is to be
enhanced.

Create Enhancement Proxy

The system automatically adds the fields from the enhancement to the Web Services
Description Language (WSDL) as optional fields.

2. Implementing Business Add-Ins (BAdIs)

Package EE_SE_UDM

Enhancement Spot ISU_SPOT_SE_DEVICE

BAdI ISU_SE_DEVICESMCRTRCO_ASYNC

3. The BAdI has two methods for every service proxy:

o Inbound Processing

o Outbound Processing

BAdI Implementation

(C) SAP AG Technical Reference 10


BAdI Implementation

Testing
To test the enhancement, create a new smart meter device in the backend system using the Create
Device transaction (transaction IQ01) and check that your new field is available in the generated
XML message.

To check the XML message, you have different possibilities:

Check the generated XML message using the Integration Engine Monitoring (transaction
SXMB_MONI).

Check XML Message

Check the availability of the new field in the external view of the Service Consumer (or
Service Provider) using the ABAP Workbench (transaction SE80).

Choose the package and navigate to the Enterprise Services section.

(C) SAP AG Technical Reference 11


Check Service Consumer

(C) SAP AG Technical Reference 12