Learning Series: SAP NetWeaver Process Orchestration ... · the module parameter...

15
SAP COMMUNITY NETWORK scn.sap.com © 2012 SAP AG 1 Learning Series: SAP NetWeaver Process Orchestration, business to business add-on 2h NRO: Number Range Objects Applies to: SAP NetWeaver Process Orchestration, business to business add-on 1.0 SP00 Summary This module provides an option to automatically append/insert a number counter of a specified range to the messages. This article explains the configuration of this feature. Author: Vishnu Prasad K Company: SAP Labs Created on: May 12, 2012 Author Bio Vishnu Prasad K is a developer at SAP Labs (Technology Innovation Platform). He is currently working with PI 7.31 development/maintenace activities. Since Vishnu joined SAP Labs in July 2010, he has developed new features in several adapters/areas including JMS, HTTP, and SOAP Adapters. Currenly, he is the component responsible for JMS and HTTP Adapters and takes care of all new development, enhancement and maintenance activities.

Transcript of Learning Series: SAP NetWeaver Process Orchestration ... · the module parameter...

Page 1: Learning Series: SAP NetWeaver Process Orchestration ... · the module parameter „multipleNumbersPerMessage‟ with value „true‟. 4) Assigned Numbers Cleanup Job The NRO module

SAP COMMUNITY NETWORK scn.sap.com

© 2012 SAP AG 1

Learning Series: SAP NetWeaver

Process Orchestration, business

to business add-on 2h NRO:

Number Range Objects

Applies to:

SAP NetWeaver Process Orchestration, business to business add-on 1.0 SP00

Summary

This module provides an option to automatically append/insert a number counter of a specified range to the messages. This article explains the configuration of this feature.

Author: Vishnu Prasad K

Company: SAP Labs

Created on: May 12, 2012

Author Bio

Vishnu Prasad K is a developer at SAP Labs (Technology Innovation Platform). He is currently working with PI 7.31 development/maintenace activities. Since Vishnu joined SAP Labs in July 2010, he has developed new features in several adapters/areas including JMS, HTTP, and SOAP Adapters. Currenly, he is the component responsible for JMS and HTTP Adapters and takes care

of all new development, enhancement and maintenance activities.

Page 2: Learning Series: SAP NetWeaver Process Orchestration ... · the module parameter „multipleNumbersPerMessage‟ with value „true‟. 4) Assigned Numbers Cleanup Job The NRO module

Learning Series: SAP NetWeaver Process Orchestration, business to business add-on 2h NRO: Number Range Objects

SAP COMMUNITY NETWORK scn.sap.com

© 2012 SAP AG 2

Table of Contents

Introduction ......................................................................................................................................................... 3

Overview ......................................................................................................................................................... 3

Configuration Options ......................................................................................................................................... 5

1) NRO Maintenance Web Page ............................................................................................................... 5 Table 1: Details ............................................................................................................................................................ 6

Table 2: History table columns ..................................................................................................................................... 6

2) Using NRO Constant ............................................................................................................................. 7 Table 3: NRO Constants .............................................................................................................................................. 7

3) Module Configuration ............................................................................................................................. 8 Table 4: Module Parameters ........................................................................................................................................ 8

4) Assigned Numbers Cleanup Job ........................................................................................................... 8 Defining the cleanup task ............................................................................................................................................. 8

Example Message ............................................................................................................................................ 11

Example One ................................................................................................................................................ 11

Example Two ................................................................................................................................................ 12

Example Three .............................................................................................................................................. 13

Related Content ................................................................................................................................................ 14

Other Learning Series Articles .......................................................................................................................... 14

Copyright........................................................................................................................................................... 15

Page 3: Learning Series: SAP NetWeaver Process Orchestration ... · the module parameter „multipleNumbersPerMessage‟ with value „true‟. 4) Assigned Numbers Cleanup Job The NRO module

Learning Series: SAP NetWeaver Process Orchestration, business to business add-on 2h NRO: Number Range Objects

SAP COMMUNITY NETWORK scn.sap.com

© 2012 SAP AG 3

Introduction

Number Range is a set of values between any two numbers. The number range always starts with a minimum value and ends with a maximum value.

E.g. 194, 195, 196, 198 is a Number range.

Number Range Objects (NRO) provides a custom range of numbers. NRO generates numbers within the minimum and the maximum value that is specified.

Overview

The NRO component contains the following configuration options:

NRO Maintenance Web Page: This page provides you with a web UI where you can create, edit, and delete the NRO objects.

Using NRO Constant: The NRO constant should either be added to the message payload manually by editing the message or appended to the message in the mapping step.

Module Configuration: This option enables you to add the NRO Component as an adapter module in the communication channel that you wish to use.

Assigned Numbers Cleanup Job: This job is used to clean up the NRO values that are assigned to a particular message number on PI.

This figure provides you with an overview on how the NRO module works and to understand it in a better way. In the example scenario below, the following components are used:

File adapter

A simple mapping

NRO Module

Note: The file adapter is used for easy understanding. You can use other adapters based on your requirements.

Use case: NRO Module is used in the receiver adapter. The message mapping appends the NRO Constant to the message.

Figure 1a: Overview

In the figure 1a, an xml file (see Example One) is picked up by the file sender adapter and sent to PI. The message is mapped and appended with the NRO Constant and sent to the NRO Module. The NRO module substitutes the NRO value (e.g., 123) in the message payload.

Page 4: Learning Series: SAP NetWeaver Process Orchestration ... · the module parameter „multipleNumbersPerMessage‟ with value „true‟. 4) Assigned Numbers Cleanup Job The NRO module

Learning Series: SAP NetWeaver Process Orchestration, business to business add-on 2h NRO: Number Range Objects

SAP COMMUNITY NETWORK scn.sap.com

© 2012 SAP AG 4

Use case: NRO Module is used in the sender adapter.

Figure 1b: Overview

Note: The file adapter is used for easy understanding. You can use other adapters based on your requirements.

In the figure 1b, an xml file with a NRO Constant is picked up by the file sender adapter and sent to the NRO Module. The NRO module processes the message and substitutes the NRO value (e.g., 123) in the message payload and then sent to the file receiver which places the xml back into the file system.

Page 5: Learning Series: SAP NetWeaver Process Orchestration ... · the module parameter „multipleNumbersPerMessage‟ with value „true‟. 4) Assigned Numbers Cleanup Job The NRO module

Learning Series: SAP NetWeaver Process Orchestration, business to business add-on 2h NRO: Number Range Objects

SAP COMMUNITY NETWORK scn.sap.com

© 2012 SAP AG 5

Configuration Options This section gives you an overview of the different configuration options that are available.

1) NRO Maintenance Web Page

The NRO can be configured by using the following maintenance page:

http://<host>:<port>/webdynpro/dispatcher/sap.com/nro~maintenance/NROMaintenance.

You can create your own NRO by clicking on “create”.

Figure 2: Create NRO

The following figure and table content contains more details about the configuration.

Figure 3: NRO details

Page 6: Learning Series: SAP NetWeaver Process Orchestration ... · the module parameter „multipleNumbersPerMessage‟ with value „true‟. 4) Assigned Numbers Cleanup Job The NRO module

Learning Series: SAP NetWeaver Process Orchestration, business to business add-on 2h NRO: Number Range Objects

SAP COMMUNITY NETWORK scn.sap.com

© 2012 SAP AG 6

Table 1: Details

Field Description

NRO Name Name of the NRO with prefix /B2B/<NRO>. The <NRO> specified in this field is used to look up the NRO and substitute the values.

Description Field which describes the function of the NRO

Value The current value which will be substituted in the outgoing message

Last Value The last value that was substituted.

Minimum Value The minimum value of the NRO. The start of the number range.

Maxiium Value The maximum value of the NRO. The end of the number range.

Formatted Value Length This field lets you control the length of the NRO value that is substituted. The number will be padded with 0‟s.

Test Warn Level This filed lets you control the warning that will be issued when the NRO reaches the test warn level.

Rotate Select this check box if you want to continue the NRO from minimum value again when the end of range is reached.

Deleted Select this check box if you want to delete the NRO after you have created it.

Get next number (button) Shows the next available number for the NRO Object.

Edit number range object (button)

Allows you edit the NRO that you have created. Any changes that is made to the NRO object will be show in the history table (Figure 4).

Save and create (button) Allows you to save the NRO.

Note: The textboxes “Value”, “Last Value”, the select box “Deleted”, and the buttons are not visible under „create view‟.

Figure 4: History Table

The table lists all the available columns in the history table which are not visible in the screenshot (figure 4).

Table 2: History table columns

username changetime description old_value new_value old_last_value new_last_value old_maxvalue new_maxvalue old_minvalue new_minvalue old_valuelength new_valuelength old_description new_description old_deleted new_deleted old_rotate new_rotate

Page 7: Learning Series: SAP NetWeaver Process Orchestration ... · the module parameter „multipleNumbersPerMessage‟ with value „true‟. 4) Assigned Numbers Cleanup Job The NRO module

Learning Series: SAP NetWeaver Process Orchestration, business to business add-on 2h NRO: Number Range Objects

SAP COMMUNITY NETWORK scn.sap.com

© 2012 SAP AG 7

The NRO created will be displayed in the left hand side of the screen (Figure 5). You can select the individual NRO by click on the respective column and detailed view (Figure 3) will be show beside the list or NRO‟s.

Figure 5: List of NRO's

2) Using NRO Constant

The NRO Constant has to be added to the message payload to enable the NRO module to substitute the defined NRO values. There are two ways to add the NRO constants in the message payload:

- Manually adding the constant in the message payload. (See input message of Example Two.) - Using a mapping to append the NRO Constant to a field.

Figure 6: Mapping a constant

Table 3: NRO Constants

Constant Substituted value Description

$B2B_UEBNR_BEFORE<NRO>$B2B_END_UEBNR Last Value The module replaces every occurrence of this constant with the last number associated with the <NRO> used

$B2B_UEBNR<NRO>$B2B_END_UEBNR Current Value The NRO module replaces every occurrence of this constant with the next number or the next consecutive values associated with the <NRO> used based on value of the parameter „multipleNumbersPerMessage‟

Note: In the NRO Constant „<NRO>‟ value has to be specified, for e.g., in figure 5 if you want to use „/B2B/TestNRO„ you have to specify only TestNRO without the /B2B/ prefix i.e., $B2B_UEBNRTestNRO$B2B_END_UEBNR.

Page 8: Learning Series: SAP NetWeaver Process Orchestration ... · the module parameter „multipleNumbersPerMessage‟ with value „true‟. 4) Assigned Numbers Cleanup Job The NRO module

Learning Series: SAP NetWeaver Process Orchestration, business to business add-on 2h NRO: Number Range Objects

SAP COMMUNITY NETWORK scn.sap.com

© 2012 SAP AG 8

3) Module Configuration

Figure 7: Module Configuration

Table 4: Module Parameters

Parameter Name Description

multipleNumbersPerMessage Each message will get only one number per NRO in the same message if the value is false. To iterate value per NRO constant in the same message, add the module parameter „multipleNumbersPerMessage‟ with value „true‟.

4) Assigned Numbers Cleanup Job

The NRO module stores the provided values in a database table for every XI-Message. Storing the value enables the module to get the same NRO value when the same message ID is processed again. You can use the AssignedNumbers Cleanup Job to clear this table. This table can be cleaned up by creating a task for the pre-defined cleanup job in NWA.

Defining the cleanup task

Navigate to http://<server>:<port>/nwa/jobs.

Figure 8: Create a new task

Page 9: Learning Series: SAP NetWeaver Process Orchestration ... · the module parameter „multipleNumbersPerMessage‟ with value „true‟. 4) Assigned Numbers Cleanup Job The NRO module

Learning Series: SAP NetWeaver Process Orchestration, business to business add-on 2h NRO: Number Range Objects

SAP COMMUNITY NETWORK scn.sap.com

© 2012 SAP AG 9

Select the AssignedNumbersCleanUp Job.

Figure 9: Select the job

Enter the Task details.

Figure 10: Enter Details

Adjust the task parameter if necessary.

Parameter Function

messageIDLifetime Time (in hrs) for that a value should be stored in the database.

Figure 11: Set the properties

Page 10: Learning Series: SAP NetWeaver Process Orchestration ... · the module parameter „multipleNumbersPerMessage‟ with value „true‟. 4) Assigned Numbers Cleanup Job The NRO module

Learning Series: SAP NetWeaver Process Orchestration, business to business add-on 2h NRO: Number Range Objects

SAP COMMUNITY NETWORK scn.sap.com

© 2012 SAP AG 10

To configure the execution time, please select any of the tabs (highlighted). Choose the time on that the old entries should be deleted.

Figure 12: Set the time for execution

Here when the job is executed successfully the entries from the table (NRO_ASSIGNEDNUMBER) with last accessed time value less than the current time minus the hours (i.e., current time – messageIDLifeTime value) specified by the messageIDLifetime job property will be deleted.

Figure 13: NRO Job execution logs

Page 11: Learning Series: SAP NetWeaver Process Orchestration ... · the module parameter „multipleNumbersPerMessage‟ with value „true‟. 4) Assigned Numbers Cleanup Job The NRO module

Learning Series: SAP NetWeaver Process Orchestration, business to business add-on 2h NRO: Number Range Objects

SAP COMMUNITY NETWORK scn.sap.com

© 2012 SAP AG 11

Example Message

The following section provides you with an explanation of how to use NRO Constants in a message.

Prerequisites:

- A /B2B/TestNRO is created in the Maintenance page with a range from 12344 to 12350. - A mapping is created to be used in this scenario.

Input message:

- All input messages shown here contains only the <person> tag of the xml and not the entire xml message.

Output message:

- Input message with <Id> tag containing the substituted NRO Value.

Description Input data Output data

Last Value $B2B_UEBNR_BEFORETestNRO$B2B_END_UEBNR 12347

Current Value $B2B_UEBNRTestNRO$B2B_END_UEBNR 12348

Example One

The following scenario uses NRO module to substitute the ID of an individual person in the xml. The NRO constant is added to the ID field of the message in the mapping step.

Current Value of TestNRO: 12344.

Input:

<Person>

<Id></Id>

<FirstName>NRO</FirstName>

<LastName>Test</LastName>

<PhoneNumber>9876543210</PhoneNumber>

<CountryCode>560000</CountryCode>

</Person>

OutPut of Mapping:

<Person>

<Id>$B2B_UEBNRTestNRO$B2B_END_UEBNR</Id>

<FirstName>NRO</FirstName>

<LastName>Test</LastName>

<PhoneNumber>9876543210</PhoneNumber>

<CountryCode>560000</CountryCode>

</Person>

OutPut: After message is processed by NRO Module.

<Person>

<Id>12345</Id>

<FullName>NRO Test</FullName>

<PhoneNumber>9876543210</PhoneNumber>

<CountryCode>560000</CountryCode>

</Person>

Page 12: Learning Series: SAP NetWeaver Process Orchestration ... · the module parameter „multipleNumbersPerMessage‟ with value „true‟. 4) Assigned Numbers Cleanup Job The NRO module

Learning Series: SAP NetWeaver Process Orchestration, business to business add-on 2h NRO: Number Range Objects

SAP COMMUNITY NETWORK scn.sap.com

© 2012 SAP AG 12

Example Two

The following scenario uses NRO module to substitute the ID of an individual person. The NRO constant is added to the ID field of the message.

Current Value of TestNRO: 12345.

Input:

<Person>

<Id>$B2B_UEBNRTestNRO$B2B_END_UEBNR</Id>

<FirstName>NRO</FirstName>

<LastName>Test</LastName>

<PhoneNumber>9876543210</PhoneNumber>

<CountryCode>560000</CountryCode>

</Person>

OutPut of Mapping:

<Person>

<Id>$B2B_UEBNRTestNRO$B2B_END_UEBNR</Id>

<FullName>NRO Test</FullName>

<PhoneNumber>9876543210</PhoneNumber>

<CountryCode>560000</CountryCode>

</Person>

OutPut: After message is processed by NRO Module.

<Person>

<Id>12346</Id>

<FullName>NRO Test</FullName>

<PhoneNumber>9876543210</PhoneNumber>

<CountryCode>560000</CountryCode>

</Person>

Page 13: Learning Series: SAP NetWeaver Process Orchestration ... · the module parameter „multipleNumbersPerMessage‟ with value „true‟. 4) Assigned Numbers Cleanup Job The NRO module

Learning Series: SAP NetWeaver Process Orchestration, business to business add-on 2h NRO: Number Range Objects

SAP COMMUNITY NETWORK scn.sap.com

© 2012 SAP AG 13

Example Three

The following scenario uses NRO module to substitute the ID of an individual person. The NRO constant is added to the ID field of the message in the mapping step.

Here the module parameter “multipleNumbersPerMessage” is set to „true‟.

Current Value of TestNRO: 12346.

Input:

<Person>

<Id></Id>

<FirstName>NRO</FirstName>

<LastName>Test One</LastName>

<PhoneNumber>9876543210</PhoneNumber>

<CountryCode>560000</CountryCode>

</Person>

<Person>

<Id></Id>

<FirstName>NRO</FirstName>

<LastName>Test Two</LastName>

<PhoneNumber>9876543211</PhoneNumber>

<CountryCode>560000</CountryCode>

</Person>

OutPut of Mapping:

<Person>

<Id>$B2B_UEBNRTestNRO$B2B_END_UEBNR</Id>

<FirstName>NRO</FirstName>

<LastName>Test One</LastName>

<PhoneNumber>9876543210</PhoneNumber>

<CountryCode>560000</CountryCode>

</Person>

<Person>

<Id>$B2B_UEBNRTestNRO$B2B_END_UEBNR</Id>

<FirstName>NRO</FirstName>

<LastName>Test Two</LastName>

<PhoneNumber>9876543211</PhoneNumber>

<CountryCode>560000</CountryCode>

</Person>

OutPut: After message is processed by NRO Module.

<Person>

<Id>12347</Id>

<FullName>NRO Test One</FullName>

<PhoneNumber>9876543210</PhoneNumber>

<CountryCode>560000</CountryCode>

</Person>

<Person>

<Id>12348</Id>

<FullName>NRO Test Two</FullName>

<PhoneNumber>9876543211</PhoneNumber>

<CountryCode>560000</CountryCode>

</Person>

Page 14: Learning Series: SAP NetWeaver Process Orchestration ... · the module parameter „multipleNumbersPerMessage‟ with value „true‟. 4) Assigned Numbers Cleanup Job The NRO module

Learning Series: SAP NetWeaver Process Orchestration, business to business add-on 2h NRO: Number Range Objects

SAP COMMUNITY NETWORK scn.sap.com

© 2012 SAP AG 14

Related Content

Configuring the Sender File Adapter.

Configuring the Receiver File Adapter.

Other Learning Series Articles

SL No

Product Name Topic Name

1. SAP NetWeaver Process Orchestration, secure connectivity add-on 1.0

a) How to Proceed Guide

b) Installation Guide

c) SFTP Adapter

d) PGP Module

2. SAP NetWeaver Process Orchestration, business to business add-on 1.0

a) How To Proceed Guide

b) Installation Guide

c) AS2 Adapter

d) OFTP Adapter

e) X400 Adapter

f) EDI Separator

g) Archiver Module and Archiver Mapping

h) Number Range Objects Module

i) EDI XML Converter I. Master Guide: EDI XML Converter II. EDIFACT_Info_Guide

III. X12_Info_Guide IV. TRADACOMS_Info_Guide V. ODETTE_Info_Guide VI. VDA_Info_Guide VII. PLAIN_Info_Guide

j) B2B Content

3. SAP NetWeaver Process Orchestration, business to business add-on 1.0

a) Sample Scenario Set-up (contains File Adapter, AS2 Adapter, EDI XML Converter, Mapping Templates, and NRO Module)

b) Sample Scenario Set-up (contains File Adapter,

OFTP Adapter, EDI XML Converter, Mapping Templates, and PGP Module)

c) Sample Scenario Set-up (contains File Adapter,

X400 Adapter, EDI Separator Adapter, Mapping Templates, EDI XML Converter and Archiver Module)

Page 15: Learning Series: SAP NetWeaver Process Orchestration ... · the module parameter „multipleNumbersPerMessage‟ with value „true‟. 4) Assigned Numbers Cleanup Job The NRO module

Learning Series: SAP NetWeaver Process Orchestration, business to business add-on 2h NRO: Number Range Objects

SAP COMMUNITY NETWORK scn.sap.com

© 2012 SAP AG 15

Copyright

© Copyright 2012 SAP AG. 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.

Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation.

IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, System z9, z10, z9, iSeries, pSeries, xSeries, zSeries, eServer, z/VM, z/OS, i5/OS, S/390, OS/390, OS/400, AS/400, S/390 Parallel Enterprise Server, PowerVM, Power Architecture, POWER6+, POWER6, POWER5+, POWER5, POWER, OpenPower, PowerPC, BatchPipes, BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, Parallel Sysplex, MVS/ESA, AIX, Intelligent Miner, WebSphere, Netfinity, Tivoli and Informix are trademarks or registered trademarks of IBM Corporation.

Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.

Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries.

Oracle is a registered trademark of Oracle Corporation.

UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.

Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc.

HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology.

Java is a registered trademark of Oracle Corporation.

JavaScript is a registered trademark of Oracle Corporation, used under license for technology invented and implemented by Netscape.

ANSI, ASC X.12, EDIFACT, TRADACOMS, VDA, ODETTE are registered trademarks and/or copyrighted and/or wordmarks of their respective companies/associations.

SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP Business ByDesign, 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.

Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects S.A. in the United States and in other countries. Business Objects is an SAP company.

All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. 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.