• No results found

Using Date-Pattern Rules in SAP Netweaver Mobile

N/A
N/A
Protected

Academic year: 2021

Share "Using Date-Pattern Rules in SAP Netweaver Mobile"

Copied!
14
0
0

Loading.... (view fulltext now)

Full text

(1)

Using Date-Pattern Rules in SAP

Netweaver Mobile

Applies to:

SAP Netweaver Mobile 7.10 and later releases (Data Orchestration Engine). For more information, visit the Mobile homepage.

Summary

Date pattern rule is one of the most powerful options to distribute business data to mobile devices using SAP NW Mobile. As the name indicates, date-pattern rules can be used to distribute data based on date. In this article let us look at how to develop rules that will automatically realign data on the devices as and when the date changes.

Author: Siva Satya Prasad Yerra Company: SAP Labs India

Created on: 09 December 2010

Author Bio

(2)

Table of Contents

Business Scenario ... 3

Usage of Date Pattern Rules ... 3

Introduction ... 3

Modeling of Date Pattern Rules ... 3

Details of Data Object: ... 3

Types of Date Pattern Rules: ... 3

Constant Offset: ... 4

Custom Offset: ... 5

Custom Offset: ... 8

View Details of Date Pattern Rules: ... 11

Related Content ... 13

(3)

Business Scenario

Customers using SAP Netweaver Mobile 7.10 or higher will use Distribution Models to define the distribution logic for their business data. In some cases, the distribution rule will itself be based on a reference to a date. For ex. Distribute all Sales Orders that are less than 30 days old. In such cases, it is necessary to use date-pattern rules to specify the distribution logic. DOE supports extensive modeling and runtime paradigms for modeling such date-specific distribution logic.

Usage of Date Pattern Rules

Introduction

Date pattern rules allow mobile application developers to define the distribution logic based on specific date, or date with respect to current date. In this article, let us look at the various types of date-pattern rules supported by DOE.

Modeling of Date Pattern Rules

Let’s take an example to understand how distribution rules can be created and how it will be evaluated at runtime.

Details of Data Object:

Data object has been defined as described in the following image with order details.  Description of the order

 Customer Information

 Order creation date information

Here we use Order creation date (CREATED_DATE) for describing all the features of date pattern rules.

Types of Date Pattern Rules:

DOE allows three flexible ways to create a date pattern rules.  Constant Offset

 Custom Offset

(4)

Constant Offset:

Ex: Device should get all orders which were created 30 days before to today.

To create this type of rule, application developer has to select CREATED_DATE attribute with GE (Greater than or Equal to) operator in Rule Fields section of Distribution rule wizard and choose NONE option in Logic section.

In Logic Details, select the entry CREATED_DATE and click on Date Pattern button. Following screen will appear.

Following options need to be selected as we need orders which were created 30 days before today. Custom Type : Constant Offset

Date Pattern : Current Date

Range : - (Negative)

Value : 30

Offset Type : Days

(5)

With the above options, subscriptions will be calculated is 30 days before today.

Custom Offset:

Ex: Device should get all orders which were created N days before today where the value of N is dynamic value decided based on the business requirement.

To achieve this type of requirement, application developer can’t use Constant Offset feature as it requires model change whenever the requirement changes.

DOE has provided flexibility to model these types of requirements with the interface: IF_MMW_DATE_OFFSET implementation.

(6)

 Method GET_OFFSET_VALUE should be implemented as follows:

 OFFSET_VALUE parameter should be set with the offset value based on the requirement. Value of 45 indicates the offset of 45 days.

 OFFSET_VALUE_H parameter should be set if BT (Between) operator is used in Rule Fields section.

(7)

Note: This method implementation can contain business logic to determine the actual offset value. Example described

here doesn’t contain any business logic hence the values are hard coded.

To create the distribution rule which was defined earlier, application developer has to select CREATED_DATE attribute with GE (Greater than or Equal to) operator in Rule Fields section of Distribution rule wizard and choose NONE option in Logic section.

In Logic Details, select the entry CREATED_DATE and click on Date Pattern button. Screen will appear to model the custom offset pattern.

Following options need to be selected: Custom Type : Custom Offset Date Pattern : Current Date

Range : - (Negative)

(8)

Note: Class should be assigned to a transportable (productive) package as it should be available in all systems.

If the implementation for offset has been changed to value X, this value will be used as subscription only on the next day at the time of distribution rule evaluation.

With the above options, subscription that will be calculated is derived from the implementation.

Custom Offset:

Ex: Device should get all orders which were created between two dates and these two dates are dynamically decided based on the business requirement.

To achieve this type of requirement, application developer can’t use either Constant Offset or Custom Offset features as these don’t support providing dates.

DOE has provided flexibility to model these types of requirements with the interface: IF_MMW_CUSTOM_DATE_PATTERN implementation.

(9)
(10)

 DATE_VAL parameter should be set with the date value based on the requirement. Value should be in YYYYMMDD format.

 DATE_VAL_H parameter should be set if BT (Between) operator is used in Rule Fields section. Value should be in YYYYMMDD format.

 Activate the Class

Note: This method implementation can contain business logic to determine the actual dates. Example described here

doesn’t contain any business logic hence the values are hard coded.

To create the distribution rule which was defined earlier, application developer has to select CREATED_DATE attribute with BT (Between) operator in Rule Fields section of Distribution rule wizard and choose NONE option in Logic section.

In Logic Details, select the entry CREATED_DATE and click on Date Pattern button. Screen will appear to model the custom offset pattern.

Following options need to be selected: Custom Type : Custom Date Pattern

(11)

Note: Class should be assigned to a transportable (productive) package as it should be available in all systems.

If the implementation for dates has been changed to value X, this value will be used as subscription only on the next day at the time of distribution rule evaluation.

View Details of Date Pattern Rules:

The Details of Date pattern rules are little different from the other rules as it contains different information. Follow the steps to view the definition of rule in workbench (transaction: SDOE_WB)

In Distribution rule details screen, select Execution Plan tab.

(12)
(13)

Related Content

(14)

Copyright

© Copyright 2010 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 Sun Microsystems, Inc.

JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape.

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.

References

Related documents