Vous êtes sur la page 1sur 44

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Applies To:
SAP ERP Retail system with minimum release ERP EHP6 SP04 Sybase Unwired Platform (SUP) 2.1.2 Windows Mobile 5 (or higher)

Summary
This article describes the mobile template application SAP In-Store Ad Hoc Inventory for Windows Mobile. It illustrates the benefits of Sybase Unwired Platform in a straightforward offline-enabled mobile Retail business scenario. Linked to the article youll find the deployment configur ation files for SUP and the Windows installer files for the native client application.

Author:

Matthias Rbig-Landau

Company: SAP AG Created on: August 2012

Author Bio
Dr. Matthias Rbig-Landau joined SAP in 1996. Since 2006, he has been working in the area of Trade and Retail software development and architecture, in multiple projects on various technical platforms.

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 1

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Table of Contents
Introduction ......................................................................................................................................................... 4 Prerequisites ....................................................................................................................................................... 4 Backend System ............................................................................................................................................. 4
Partner Profiles - ALE Interfaces.................................................................................................................................. 4 Enable Direct Creation of Inventory Docs .................................................................................................................... 4 Standard Retail Inventory Interface .............................................................................................................................. 4 Monitoring and Approval .............................................................................................................................................. 5 Links to Standard Documentation ................................................................................................................................ 5

Sybase Unwired Platform................................................................................................................................ 5 Mobile Device .................................................................................................................................................. 5 Downloads .......................................................................................................................................................... 6 Scenario - In-Store Ad Hoc Inventory ................................................................................................................. 6 Detailed Use Case Description ........................................................................................................................... 6 Business Goal ................................................................................................................................................. 6 Trigger Event ................................................................................................................................................... 6 Basic Scenario ................................................................................................................................................ 6 Features and Details ....................................................................................................................................... 7
Article Identification ...................................................................................................................................................... 7 Displayed Article Information ....................................................................................................................................... 7 Supported Parameters ................................................................................................................................................. 7 Packages Overview and Correction ............................................................................................................................. 7 Submit .......................................................................................................................................................................... 8 Boundaries and Conditions .......................................................................................................................................... 8

Process Steps ................................................................................................................................................. 8


Count Phase ................................................................................................................................................................ 8 Submit Phase............................................................................................................................................................... 8

Architecture Layers ............................................................................................................................................. 8 General Architecture ....................................................................................................................................... 8 Realization ...................................................................................................................................................... 9


Platform........................................................................................................................................................................ 9 Platform Adaptation ..................................................................................................................................................... 9 Consumer Adaptation ................................................................................................................................................ 11 Consumer - Mobile Device Application ...................................................................................................................... 15

Implementation Details and Tips ...................................................................................................................... 16 Logging ......................................................................................................................................................... 16 Code Generation in SUP Unwired Workspace ............................................................................................. 17 Client Binaries ............................................................................................................................................... 17 Client Connection and Authentication ........................................................................................................... 18 Synchronization ............................................................................................................................................. 19 Data Access .................................................................................................................................................. 20
Single Data Entry ....................................................................................................................................................... 20 List of Entries ............................................................................................................................................................. 20

Deployment Unit ............................................................................................................................................ 21

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 2

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Installation and Deployment ............................................................................................................................. 22 SUP Server Deployment ............................................................................................................................... 22 SUP Security Configuration .......................................................................................................................... 22 SUP Domain ................................................................................................................................................. 24 SUP Connection Pool ................................................................................................................................... 26 Deployment of Application Package ............................................................................................................. 27 SUP Application Connection ......................................................................................................................... 31 Installation on Windows Mobile Device ......................................................................................................... 32 Application Walkthrough ................................................................................................................................... 35 Setup ............................................................................................................................................................. 35 Counting ........................................................................................................................................................ 36 Submit ........................................................................................................................................................... 39 Summary........................................................................................................................................................... 40 Glossary ............................................................................................................................................................ 40 Related Content ................................................................................................................................................ 41 Appendix 1: Paths in SAP Easy Access Menu ................................................................................................. 41 Copyright........................................................................................................................................................... 43

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 3

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Introduction
Long before the trend for mobile business applications of the last few years, Retail industries used handheld devices. SAP also supported retailers in the past with browser-based online technologies like WebDynpro Java for mobile or ITSmobile. With the Sybase Unwired Platform (SUP) as an infrastructure layer, SAP provides a reliable backbone for mobile Retail applications. This article proves that usage of SUP for offline-capable mobile applications is not rocket science. SUP is a mobile enterprise application platform that enables developers to simply and quickly develop applications that connect business data to mobile workers. An already published application is the SAP In-Store Product Lookup mobile app for iPhone. By means of SAP In-Store Product Lookup you can answer your customers' questions about products and their availability and adjust your inventory anywhere, anytime. The iPhone app connects to the components in SAP ERP that support retail applications and allows you to display product details and stock levels in your store and in stores nearby. SAP In-Store Ad Hoc Inventory is an offline-enabled inventory scenario for Windows Mobile devices.

Prerequisites
Backend System The SAP ERP backend system has to be an SAP ERP Retail system with minimum release ERP EHP6 SP04. This can be checked using transaction SFW5, and the Retail menu (transaction W10T) must be available. Be very careful not to change anything by means of transaction SFW5, because changes cannot be reversed! In addition, the package WOST_MOBILE should exist (transaction SE80) as part of ERP EHP6 SP04 (or higher). Partner Profiles - ALE Interfaces Access the partner profile via transaction WE20. Ensure that for participating stores, a partner profile is maintained with the following attributes:

Partner Type KU Inbound Parameter Message Type WVINVE

Without the mentioned ALE settings, the IDoc is not processed and remains. After maintenance of the ALE settings it can be re-processed. Enable Direct Creation of Inventory Docs The responsible POS inbound profile needs to support the direct creation of inventory IDocs. The assigned POS inbound profile can be found in the plant details on tab POS (transaction WB03 POS). The corresponding IMG customizing setting can be found via transaction SPRO SAP Reference IMG Sales and Distribution POS Interface Inbound Enhancement: Store Physical Inventory Control The relevant POS inbound profile has to be assigned to the value 4 Create phys. inv. docs directly. Standard Retail Inventory Interface The mobile SAP Retail applications utilize the standard IDoc-Inventory interfaces. In case this interface is already in use within other scenarios at customer site, you need to be aware about the simultaneous feed via multiple input channels.

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 4

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Monitoring and Approval The monitoring of IDoc inventory documents can be executed by means of the POS Interface Monitor (transactions WPER and/or WE05). The activation of posted changes needs an approval of possible stock differences, for example via transaction MI07. Links to Standard Documentation Physical Inventory Standard Inventory (MM-IM-PI) Inventory Management Sybase Unwired Platform Sybase Unwired Platform is an integrated mobile middleware that supports multiple client device types and operating systems as the platform for mobile enterprise applications. You can find comprehensive and full documentation under: Sybase Unwired Platform 2.1.2 Mobile Device The mobile application template SAP In-Store Ad Hoc Inventory Count" is based on a physical procedure which is manually controlled via a Rugged Handheld Mobile Computer (RHMC) (for example, Motorola MC9500). The mobile device RHC (Ruggedized Handheld Computer) is equipped with a barcode scanner (1D,2D) and/or other comparable data input devices. A mobile device running on operating system Windows Mobile 6.1 (or higher) is needed. The application was built and tested mainly on a Motorola MC9500 (WM 6.1). In principle it runs on any Windows Mobile 5 (or higher) device. Its optimized for a rectangular screen (320x480) and typical device settings of Motorola (namely MC 9500). The mobile device has to be enabled for wireless connection against the SUP server. The best verification method is to connect by means of Internet Explorer against SUPs SCC (Support Control Center). The device has to have a laser barcode scanner and a suitable device application installed to read the scanner information (for example Data Wedge from Motorola). In the SAP In-Store Ad Hoc Inventory scenario, the barcode scanner libraries are not embedded, due to legal reasons. Instead the barcode scanner information is posted to an invisible input field. In order to identify the start and end of a relevant GTIN, the posted scanner information starts and ends with @ (prefix and suffix, see Figure 1).

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 5

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Figure 1 shows the Data Wedge configuration for the SAP In-Store Ad Hoc Inventory application.

Downloads
Here you can find the deployment configuration files for SUP and the Windows installer file for the native client application.

Scenario - In-Store Ad Hoc Inventory


Spontaneous, unplanned inventory counts are used to count small sets of articles in a store. An ad hoc inventory enables the retail store to provide proof of all individual movements involving storage bins or products over the fiscal year. A store employee checks the stock of specific articles. Typical candidates for SAP In-Store Ad Hoc Inventory are articles with a high leakage rate (for example, razor blades, lipsticks) or items with a high seasonal turn over (for example, ice cream, anti-freeze protection, snow shovel). In both cases the stock numbers need to be kept up to date, in higher cycles than for "normal" articles. SAP In-Store Ad Hoc Inventory is an offline-scenario, meaning that most (but not all) of the operations still work while the device is offline.

Detailed Use Case Description


Business Goal Adjust stock of a single article, a group of articles, or a shelf. Counting has to work offline. Trigger Event The user (store associate or store manager) has to update the stock inventory for an article group or suspicious single articles. Basic Scenario SAP In-Store Ad Hoc Inventory Count focuses on following the basic employee scenario:

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 6

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Article bar codes are scanned Stock information is entered manually per article Overview list of articles counted so far, for verification Option for correction of already entered article stock information Confirmation of collected stock counts and submission to ERP

Features and Details Article Identification

User identifies article User scans the bar code of the article by means of a laser scanner (98% case) User can manually enter the GTIN or article number (for example in the case of non-scannable bar codes) One article (represented by EAN) may be counted multiple times within one collection No text-search or similar feature is supported, only exact match

Displayed Article Information The following information is visible for the employee after article identification:

GTIN Article short text Material group text Counted stock unit and corresponding base unit

Supported Parameters Supported device application settings:

Inventory settings - Store ID - Storage location - Stock type - Count mode SUP Server connection parameters: - Server name - Server port - User - Password - Activation code - Farm ID

Packages Overview and Correction The application supports the following features:

Articles that are (according to ERP layout information) multiply placed within the store are indicated. The shelf and coordinate information has to be specified during inventory count. This shelf information does not have relevance for the ERP data import process, as this is not supported in the ERP backend system.

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 7

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Packaged articles can be scanned via the package GTIN. Articles are always counted in the unit of measurement that has been scanned. Employee is informed about counting of package units. Entered stock information items can be edited or deleted. The whole elaborated list of counted articles can be: - Deleted every time - Deleted on exit of the application - Kept temporarily on exit of the application

Submit The inventory data has to be transferred promptly, to minimize the possibility of inconsistencies. After having scanned and counted all requested articles, the employee submits inventory count information. Submission of inventory data requires the device to be "online". Boundaries and Conditions The mobile device is not regarded as being online all the time, but it has been connected recently, ideally start-of-day. The SAP In-Store Ad Hoc Inventory Count must not interfere with a planned or continuous inventory and has to be in accordance with legal regulations. In order to be offline-enabled, all required information of the article is available in the backend and is replicated on the device. The inventory document in the backend is limited to 300 items. If there are more than 300 scanned articles the backend document (IDoc) is split into more than one document. Process Steps The recurring process steps of the SAP In-Store Ad Hoc Inventory scenario: Count Phase

Article is identified Article information is displayed User specifies counted number of articles User specifies shelf information (available only with multiple placement) Application is ready to identify the next article

Submit Phase

User has a final chance to correct or delete entries Submission of inventory data (requires device to be online) Success message is displayed

Architecture Layers
General Architecture The general component architecture of a mobile offline SUP application consists of a high-level view of four layers (see Figure 2).

Platform, also called backend layer, comprising ERP, CRM, SCM - SAP Business Suite Adaptation layer - RFC Wrappers Consumer adaptation layer - Mobile Business Object modeled in DOE/SUP Consumer - Mobile Device Application

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 8

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Figure 2 displays the general architecture of SUP-based offline applications. The DOE Connector components (shaded areas) are not used in the SAP In-Store Ad Hoc Inventory scenario. The orange areas mark the application-specific coding and modeling components.

Realization Platform The ERP basis is an SAP ERP EHP6 SP04 (or higher) Retail system. Platform Adaptation The RFC adaptation layer is realized within the development package WOST_MOBILE.

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 9

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Implementation Scheme The main focus is on simple master data access. Specialized dictionary structures and RFC (remote-enabled function modules) are optimized on low data volume master data access. Nevertheless the main functions are not performance-optimized and not integrated into change and update processes. In a productive high data volume scenario, the master data retrieval should be embedded into a commonly used standard retail process, for example POS outbound process or assortment list versions. Components The main elements are:

GET function modules (SRSMOB_GET_XX) that retrieve the relevant master data from the backend system Submit function module (SRSMOB_SUBM_ADHOC_INV) for reporting back inventory data to the backend system Underlying adaption dictionary structures that serve as volume-reduced data exchange structures (SRSMOB*)

Figure 3 is a screenshot of the content of development package WOST_MOBILE.

All language-dependent information is retrieved in all available languages, assuming that they all might become relevant on the front end side as they are maintained. The naming of the modules (see Figure 3) is descriptive, and the implementation of the retrieval backend RFC modules shows two different types. These RFCs perform a full table scan of the relevant single table:

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 10

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

SRSMOB_GET_CUSTOMER_SITES (customer sites = stores) SRSMOB_GET_MATERIAL_GROUPS SRSMOB_GET_MEAS_UNIT SRSMOB_GET_STOCK_TYPES SRSMOB_GET_STORAG_LOCATIONS

The following RFCs are a little more complex. - SRSMOB_GET_ARTICLES

All listed articles, corresponding article texts, relevant sales units, and GTIN numbers. Retrieval of information is partly realized in single article mode and does not contain store-specific information.
SRSMOB_GETMULTIPLE_PLACED

All multiply-placed articles (according to layout information) of a store are listed. This is the only store-specific retrieval RFC. SRSMOB_SUBM_ADHOC_INV

Submit Ad Hoc Inventory data collected on the mobile device. This RFC is based on the popular function module WOSI_SAVE_AND_PROCESS_IDOC_IN , which is used by customer implementations for non-planned inventory.
Consumer Adaptation The consumer adaptation is realized by means of the development tool Sybase Unwired Workspace. This tool provides developers with visual modeling of Mobile Business Objects (MBO), direct deployment testing and code generation of interfaces for different device platforms. SUP MBO Data Model In the SAP In-Store Ad Hoc Inventory template application, the optional component DOE (Data Orchestration Engine, part of SAP NetWeaver Mobile) is not used. SAP NetWeaver Mobile DOE is suitable for backend communication with complex data distribution and conflict handling. This is not the case for the template application SAP In-Store Ad Hoc Inventory. All data is retrieved via JCo-Connector and is buffered in SUP Consolidated Database (CDB). The MBO data model (see Figure 4) is gathered within one single SUP project, which is recommended for such a moderate amount of objects. Data is stored in one SUP CDB only, and the usage of generated code is less complex.

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 11

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Figure 4 illustrates the mobile application diagram inside Sybase Unwired Workspace - MBO Model.

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 12

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Article Text
Language (ISO) Material Number Material Text

Articles
1 1
Material Number Base Unit + Base Unit ISO Material Group Unit + Unit ISO Sales Unit + Sales Unit ISO SRSMOB_GET_ARTICLES CT_ARTICLES

EAN
n 1
SRSMOB_GET_ARTICLES EANS Material Number EAN Unit + Unit ISO Numerator + Denominator

SRSMOB_GET_ARTICLES CT_ARTICLE_TEXTS

MBO_ArticleTexts

MBO_Articles

MBO_EANs

1 1

Material Group Text


Language (ISO) Material Group Material Group Text

Measure Unit
Language (ISO) Unit

Unit 3 Digit

SRSMOB_GET_MATERIAL_GROUPS

SRSMOB_GET_MATERIAL_GROUP S MATGRT

MATGRT

MBO_MaterialGroups

MBO_MeasureUnits

Stock Inventory
Site ID User Name Inventory Date Inventory Time Store Location Stock Type SRSMOB_SUBM_ADHOC_INV Attributes

n 1

Stock Inventory Item


EAN Stock Sales Unit Inventory Date Inventory Time SRSMOB_SUBM_ADHOC_INV ADHOCINV

Multiplaced Articles
Site ID EAN Layout Group Sort Sequence Shelf Board Number

1
SRSMOB_GET_MULTIPLACED_AR TCLS ITEM_SHELF

MBO_AdHocInv (Operation)

MBOS_AdHocInv

MBO_MultiPlacedArticles

1 1

1 1

Stock Types
Language (ISO) Stock Type ID Stock Type Text

Store
Site ID

Storage Locations
Site ID Storage Location

1 1
SRSMOB_GET_CUSTOMER_SITE S-PLANT

Storage Location Text

SRSMOB_GET_STOCK_TYPES STOCKTYPE

SRSMOB_GET_CUSTOMER_SITES -PLANT

MBO_StockTypes

MBO_CustomerSites

MBO_StorageLocations

Figure 5 presents the data model of SUP MBOs of SAP In-Store Ad Hoc Inventory.

The SUP Mobile Business (MBO) groups essentially surround the entity Article, which is represented by the MBO_Articles. It gathers all relevant articles, and all necessary side information is provided via related MBOs (MBO_EANs, MBO_MultiPlacedArticles and MBO_ArticleTexts). The following MBOs gather non-single-article-specific data that is necessary as side information:

MBO_MaterialGroups - Material group text MBO_MeasureUnits - Measure unit texts MBO_StorageLocations - Storage locations of stores MBO_StockTypes General stock types and explanation texts

The submission of the inventory data is handled by MBO_AdHocInv (header info) and MBOS_AdHocInv (inventory items). The MBOs are grouped in cache groups (see Error! Reference source not found.).

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 13

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Figure 6 shows the grouping of SAP In-Store Ad Hoc Inventory MBOs in cache groups.

The cache policy is predefined to Scheduled for all MBOs of one cache group, with cache interval times varying from 1 to 12 hours (see Figure 7 and Figure 8). Especially for high data volumes, the schedule time has been set to a high value. The cache interval time can be changed in the SUP SCC according to specific needs.

Figure 7 shows the setting of cache policy for cache group MasterData, which contains most of the article-specific information.

Figure 8 shows the setting of cache policy settings for cache group Layout, which contains layout data of multiply-placed articles.

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 14

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Local MBOs Within the client component of SAP In-Store Ad Hoc Inventory, local MBOs are used for storage of application-specific data and preferences. Purpose of local MBOs:

MBOL_InventoryContext Application context MBOL_ConnStettings SUP server connection settings MBOL_InventoryList List of counted inventory items

These local MBOs enable the application to persist data in the SUP device database, even when the application or device is shut down or restarted (see Figure 9).

Inventory Context
User ID Language Creation Data + Time Customer Site + Text Storage Location + Text Stock Type + Text Inventory Mode Demo Flag Current Article

Inventory List
EAN_UPC Count Shelf Stock Material Text Unit + Unit ISO Inventory Date Inventory Time

Connection Settings (SUP)


AppID Server User Password Port FarmID Activation Code Domain Protocol

MBOL_InventoryContext

MBOL_InventoryList

MBOL_ConnSettings

Figure 9 lists the local MBOs that serve as a persistence structure for application-specific data and device-specific settings.

Consumer - Mobile Device Application The client application has been developed with Visual Studio 2008 using programming language C#. The device implementation makes full use of the SUP MBOs. A large portion of the data stored on the SUP Consolidated Database (CDB) is also synchronized to the client application. Two filters (entities in gray in figure 10) are introduced for special MBOs. MBO Synchronization Parameters
According to the device settings, language filtering for measure units, material group text, and stock types is applied. applied. Consequently, only language-dependent texts that match the user setting are stored on the device. The MBO for multiply-placed articles retrieves store-specific data from the CDB. A synchronization parameter on the preset store

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 15

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

parameter on the preset store ID filters data synchronized to the mobile device (see

Article Text
Language (ISO Code) Material Number Material Text

Articles
1 1
Material Number Base Unit + Base Unit ISO Material Group Unit + Unit ISO Sales Unit + Sales Unit ISO SRSMOB_GET_ARTICLES CT_ARTICLES

EAN
n 1
SRSMOB_GET_ARTICLES EANS Material Number EAN Unit + Unit ISO Numerator + Denominator

n
SRSMOB_GET_ARTICLES CT_ARTICLE_TEXTS

MBO_ArticleTexts

1 MBO_Articles 1

MBO_EANs

1 1

Material Group Text


Language (ISO Code) Material Group Material Group Text

Measure Unit
Language (ISO Code) Unit

Unit 3 Digit

n
SRSMOB_GET_MATERIAL_GROUPS

MATGRT

SRSMOB_GET_MATERIAL_GROU PS MATGRT

MBO_MaterialGroups

MBO_MeasureUnits

1 1

Language
Language (ISO Code)

Site ID
Site ID

Stock Inventory
Site ID User Name Inventory Date Inventory Time Store Location Stock Type SRSMOB_SUBM_ADHOC_INV Attributes

Stock Inventory Item


1 n
EAN Stock Sales Unit Inventory Date Inventory Time SRSMOB_SUBM_ADHOC_INV ADHOCINV

Multiplaced Articles
Site ID EAN Layout Group Sort Sequence Shelf Board Number

SRSMOB_GET_MULTIPLACED_AR TCLS ITEM_SHELF

MBO_AdHocInv (Operation)

MBOS_AdHocInv

MBO_MultiPlacedArticles

1 1

1 1

Stock Types
n
Language (ISO Code) Stock Type ID Stock Type Text

Store
Site ID

Storage Locations
Site ID Storage Location

1 1
SRSMOB_GET_CUSTOMER_SITE S-PLANT

Storage Location Text

SRSMOB_GET_STOCK_TYPES STOCKTYPE

SRSMOB_GET_CUSTOMER_SITES -PLANT

MBO_StockTypes

MBO_CustomerSites

MBO_StorageLocations

Figure 10).

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 16

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Article Text
Language (ISO Code) Material Number Material Text

Articles
1 1
Material Number Base Unit + Base Unit ISO Material Group Unit + Unit ISO Sales Unit + Sales Unit ISO SRSMOB_GET_ARTICLES CT_ARTICLES

EAN
n 1
SRSMOB_GET_ARTICLES EANS Material Number EAN Unit + Unit ISO Numerator + Denominator

n
SRSMOB_GET_ARTICLES CT_ARTICLE_TEXTS

MBO_ArticleTexts

1 MBO_Articles 1

MBO_EANs

1 1

Material Group Text


Language (ISO Code) Material Group Material Group Text

Measure Unit
Language (ISO Code) Unit

Unit 3 Digit

n
SRSMOB_GET_MATERIAL_GROUPS

MATGRT

SRSMOB_GET_MATERIAL_GROU PS MATGRT

MBO_MaterialGroups

MBO_MeasureUnits

1 1

Language
Language (ISO Code)

Site ID
Site ID

Stock Inventory
Site ID User Name Inventory Date Inventory Time Store Location Stock Type SRSMOB_SUBM_ADHOC_INV Attributes

Stock Inventory Item


1 n
EAN Stock Sales Unit Inventory Date Inventory Time SRSMOB_SUBM_ADHOC_INV ADHOCINV

Multiplaced Articles
Site ID EAN Layout Group Sort Sequence Shelf Board Number

SRSMOB_GET_MULTIPLACED_AR TCLS ITEM_SHELF

MBO_AdHocInv (Operation)

MBOS_AdHocInv

MBO_MultiPlacedArticles

1 1

1 1

Stock Types
n
Language (ISO Code) Stock Type ID Stock Type Text

Store
Site ID

Storage Locations
Site ID Storage Location

1 1
SRSMOB_GET_CUSTOMER_SITE S-PLANT

Storage Location Text

SRSMOB_GET_STOCK_TYPES STOCKTYPE

SRSMOB_GET_CUSTOMER_SITES -PLANT

MBO_StockTypes

MBO_CustomerSites

MBO_StorageLocations

Figure 10 presents the data model of SUP MBOs of SAP In-Store Ad Hoc Inventory accessed from the mobile device client. Language- and store-specific data is filtered according to device settings.

Implementation Details and Tips


Logging As a logging utility for the client application, log4net is used. The configuration is located in the path <Application Root Directory>/logging/logging.config and can be modified in the common way. Detailed information can be found on many sites on the Internet (for example Log4Net-Tutorial).

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 17

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Code Generation in SUP Unwired Workspace After modeling the data access layer, SUP Unwired Workspace offers an excellent way of generating the adaption layer interface in a very efficient way (see Figure 11).

Figure 11 shows how to start the code generation wizard in SUP Unwired Workspace.

The settings in the following wizard are widely self-explanatory, and its details well-documented in the Developer Guide: Windows and Windows Mobile Object API Applications .

Client Binaries The Windows Mobile client component has been developed in Visual Studio 2008. The generated coding and the related SUP dll-files were placed beside the generated code inside a folder named Dlls, during the generation process. The list of dll-files that need to be added to the solution:

CMessaging.dll (mind to take the dll from folder smartphone) iAnywhere.Data.UltraLite.dll mlcrsa12.dll mlczlib12.dll sup-client.dll ulnet12.dll ulnetclient12.dll

The properties have to be set as shown in Figure 12, so that the dll-files are attached to the deployment package.

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 18

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Figure 12 displays property settings for SUP dll-files.

Client Connection and Authentication The authentication against SUP is realized basically with the following code pattern. It also illustrates the usage of local MBOs. //Sybase Application Sybase.Mobile.Application app = Sybase.Mobile.Application.GetInstance(); app.ApplicationIdentifier = "sap_adhocinv"; // ... Callback handlers and application handlers ... // // retrieve stored connection setting from local MBO MBOL_ConnSettings connSettings = MBOL_ConnSettings.FindByPrimaryKey("sap_adhocinv"); ConnectionProperties connProps = app.ConnectionProperties; connProps.ServerName = connSettings.Server; connProps.PortNumber = int.Parse(connSettings.Port); connProps.ActivationCode = connSettings.ActivationCode; connProps.FarmId = connSettings.FarmID; LoginCredentials loginCred = new LoginCredentials(connSettings.User, connSettings.Password); connProps.LoginCredentials = loginCred; // register application SAPAdHocInventoryDB.SetApplication(app);

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 19

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

if (app.RegistrationStatus != RegistrationStatus.REGISTERED) { app.RegisterApplication(20); } else { app.StartConnection(20); } // Setup connection profile and open connection ConnectionProfile sup = null; sup = SAPAdHocInventoryDB.GetConnectionProfile(); sup.DomainName = Central.Constants.SUP_DOMAIN; sup.SyncProfile.DomainName = Central.Constants.SUP_DOMAIN; sup.NetworkProtocol = connSettings.Protocol; sup.PortNumber = int.Parse(connSettings.Port); sup.ServerName = connSettings.Server; sup.Save(); SAPAdHocInventoryDB.OpenConnection(); SAPAdHocInventoryDB.OnlineLogin(connSettings.User, connSettings.Password);

More detailed and specific instructions can be found in the developer documentation of SUP (Developer Guide: Windows and Windows Mobile Object API Applications). Synchronization During the synchronization processes of the client application against the data of SUP CDB, different actions are executed:

Initial synchronization On first startup of the application, all valid master data for the client needs to be synchronized to the client database. This the most runtime- and resource-consuming process of the whole client application. Delta synchronization The delta update is done separately for each cache group in case the time span since the last synchronization exceeds a certain value. Specific synchronization In special business scenarios, the application needs to synchronize a single cache group. For example if the store ID is changed, the group layout needs to be re-synchronized, as its content is store-ID-specific.

The basic implementation pattern can be seen here:

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 20

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

// set synchronization parameters MBO_MultiPlacedArticlesSynchronizationParameters SynchParamsMP = MBO_MultiPlacedArticles.GetSynchronizationParameters(); SynchParamsMP.S_CUSTOMER_SITE = invCtxt.CustomerSite; SynchParamsMP.Save(); MBO_MaterialGroupsSynchronizationParameters SynchParamsMG = MBO_MaterialGroups.GetSynchronizationParameters(); SynchParamsMG.S_LAISO = invCtxt.Language; SynchParamsMG.Save(); ... //open connection SAPAdHocInventoryDB.OpenConnection(); GenericList<ISynchronizationGroup> genSynchGroups = SAPAdHocInventoryDB.GetAllSynchronizationGroups(); int n = 0; SynchronizationGroup synchGroup; // loop an synchronization groups while (n < genSynchGroups.Count) { synchGroup = (SynchronizationGroup)genSynchGroups.ElementAt(n); n++; TimeSpan delta = DateTime.Now SAPAdHocInventoryDB.GetLastSynchronizationTime(synchGroup.Name); // check if delta synch is needed for this group if (delta.Duration().TotalHours > 10) { // delta synch SAPAdHocInventoryDB.Synchronize(synchGroup.Name); } } Data Access Single Data Entry The data access via the synchronized MBOs is fairly simple when the primary key can be specified, which is mostly the case in the given scenario. MBO_ArticleTexts mbo_articleText = MBO_ArticleTexts.FindByPrimaryKey(materialNo,invCtxt.Language);

In the example given, the invCtxt corresponds to the overall present context information of the application that also stores the current language setting. List of Entries On retrieval of a list of entries, a query request needs to be defined. In this code example, all EAN numbers (also known as GTIN) for a given material are retrieved into a list. Query query = new Query();

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 21

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

AttributeTest ts = new AttributeTest(); ts.Attribute = "MATERIAL"; ts.Value = material; ts.SetOperator(AttributeTest.EQUAL); query.SetTestCriteria(ts); Sybase.Collections.GenericList<MBO_EANs> genListEANs; genListEANs = MBO_EANs.FindWithQuery(query); Deployment Unit The SUP Unwired Workspace offers this opportunity to directly deploy the application package to a connected server (see Figure 13).

Figure 13 shows deployment during the development process.

For the purpose of releasing and distributing the application, a deployment package has to be generated, which defines the composition settings. The abstraction layer of the SUP Deployment Package allows you, for example, to combine varying sets of MBOs in different deployment units.

Figure 14 demonstrates the creation of an SUP Mobile Deployment Package in SUP Unwired Workspace.

For the application SAP Ad Hoc Inventory, we can stick to the default options of the wizard and include all available MBOs (see Figure 14 and Figure 15).

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 22

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Figure 15 illustrates distribution of all MBOs into the Mobile Deployment Package.

After finishing the wizard, the deployment package is then available in the sub-folder Deployment of the project.

Installation and Deployment


SUP Server Deployment For the deployment, a few preparation steps are necessary:

Creation of SUP security configuration Creation and enablement of SUP domain SUP application connection (Client SUP) SUP connection pool (SUP Backend) Deployment of SUP application package

SUP Security Configuration In this documentation of the template application SAP In-Store Ad Hoc Inventory, we use the most simple authentication scenario against the SUP server, to reduce setup complexity in the local environment. This is appropriate for testing and demo cases. In a productive scenario, this must be enhanced by a security implementation that fits the customers needs and environment. As well-documented (Developer Guide: Windows and Windows Mobile Object API Applications), an application can make use of username-password authentication, as well as use single-sign- on support (X.509 certificate). You create a security configuration that does not require user authentication by simply not specifying a dedicated implementation class (see Figure 16, Figure 17, and Figure 18).

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 23

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Figure 16 illustrates the creation of a new security configuration.

Figure 17 gives an overview of the newly created security configuration.

Figure 18 displays properties of the newly created security configuration.

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 24

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

SUP Domain Create the domain name sapadhocinv this is hard-coded inside the application, to reduce deployment complexity, so use exactly this value in this case. Choose the newly created security configuration and enable the SUP domain (see Figure 19, Figure 20, Figure 21, Figure 22, Figure 23 and Figure 24).

Figure 19 shows how to start the creation wizard for SUP domain.

Figure 20 illustrates the naming of the new SUP domain "sapadhocinv".

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 25

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Figure 21 shows the assignment of the security configuration to the new domain.

Figure 22 indicates how to enable the new domain.

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 26

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Figure 23 displays the confirmation of the enablement of the newly created domain.

Figure 24 shows an overview of all existing domains.

SUP Connection Pool Next, we define the connection between the SUP server and the SAP ERP backend system (see Figure 25 and Figure 26). An SUP connection pool entry can be shared by multiple application packages within one SUP domain.

Figure 25 illustrates choosing "New" for the creation of a new SUP connection pool entry.

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 27

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Figure 26 shows how to define properties for an SUP connection pool.

Deployment of Application Package After all preparation steps, the application package can be deployed to the SUP server via the Sybase Control Center (SCC). As an alternative to the standard deployment of the created jar-file (see section Deployment Unit), it is also possible to merely deploy the deployment descriptor files in XML-format (see Downloads). Start the deployment wizard according to Figure 27.

Figure 27 shows how to start the deployment wizard in SCC.

Choose the Next button in the window that appears (see Figure 28).

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 28

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Figure 28 shows the start screen of the deployment wizard, with 5 deployment steps listed.

Specify the two downloaded deployment descriptor files (see Figure 29), and enter the SUP domain sapadhocinv and the newly created security configuration on the following screen (see Figure 30).

Figure 29 shows the specification of deployment descriptor files.

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 29

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Figure 30 shows the specification of the SUP domain and security configuration.

There is no role assignment designed for the application, so choose the Next button again (see Figure 31).

Figure 31 shows skipping the role assignment.

The embedded endpoint has to be exchanged by valid SUP connection to the deployment package (see Figure 32).

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 30

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Figure 32 demonstrates the assignment of an SUP connection to all externally-facing MBOs.

In the last step, a summary is displayed (see Figure 33). Check again whether all externally-facing MBOs are listed in the Endpoint Updates section.

Figure 33 summarizes the deployment wizard settings.

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 31

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Back in the packages view of SCC, the newly deployed application is displayed (see Figure 34).

Figure 34 displays the application package of SAP Ad Hoc Inventory.

After a reasonable synchronization time, which strongly depends on volume and connection bandwidth, you should see entries in the cache group overview of the application (Figure 35).

Figure 35 illustrates the synchronized cache group entries that correspond to MBO items in SUP CDB.

SUP Application Connection Before a mobile device may connect against the SUP server, an application connection has to be defined, which serves in the given application scenario as the entrance door to SUP (see Figure 36, Figure 37, Figure 38, and Figure 39).

Figure 36 shows the registration of an application connection within SUP SCC.

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 32

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Figure 37 shows the properties of an application connection.

Figure 38 lists the not yet activated SUP application connection.

Figure 39 presents the activated SUP application connection.

This finishes the setup of the SUP server application component. All data is now available on the SUP server and can be consumed by a mobile client. It will be updated according to the cache group settings. Installation on Windows Mobile Device Ensure that the mobile device is cradle-connected via Active Synch, or to the workplace environment. Download the Windows installer file under section Downloads. Execute the installation of the SAP Ad Hoc Inventory client application by double click (see Figure 40 and Figure 41).

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 33

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Figure 40 illustrates the deployment of the SAP In-Store Ad Hoc Inventory application, started from the workplace environment.

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 34

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Figure 41 gives an overview of the deployment of the SAP In-Store Ad Hoc Inventory application on a Windows Mobile device.

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 35

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Application Walkthrough
Setup Start the application via Windows Start Menu as shown in Figure 42. At first startup, there is the opportunity for a demo mode, which operates on embedded data.

Figure 42 illustrates the start screens of the SAP In-Store Ad Hoc Inventory application.

When you choose Start, the application prompts a definition of connection settings. As no security handling has been specified, the password is not checked at all. Make sure to set the activation code to the one specified for the SUP application connection (see Figure 43). After a successful SUP server connection setup, the application requests inventory parameters, for example, the store ID (see Figure 44).

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 36

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Figure 43 shows the application connection settings for SUP server access.

Figure 44 shows the maintenance of inventory settings.

Counting The inventory process offers two operation modes:

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 37

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Count Manual specification of item number Boutique Each scan counts for one unit

Items are added to the inventory list via Enter or when changing the GTIN. Figure 45 shows typical application screens during the inventory process.

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 38

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Figure 45 shows example screens of SAP In-Store Ad Hoc Inventory on Windows Mobile.

Multiple entries for the same item are allowed and accumulated in a backend procedure. The specified layout information is neither stored nor processed in the backend, and is therefore not available. It is merely a reminder for the person counting that this item is located in different places in the store.

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 39

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

In general the data for one item should be gathered in a timely manner, to avoid inconsistencies. The biggest inaccuracies may occur for articles that shop customers carry in their shopping baskets. Submit After the inventory task is finished, the list of counted items has to be transferred by clicking Submit (see Figure 46).

Figure 46 shows the submission of collected inventory data.

Make sure to process the inventory data in the backend system by means of the IDoc processing, for example in transaction MI07 (see Figure 47) or MI37 via batch job, as soon as possible. Otherwise articles might be blocked for further inventory operations.

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 40

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Figure 47 illustrates the posting of inventory processes for differences in the ERP backend (transaction code MI07).

Summary
This article has illustrated, by means of a basic mobile business use case, how to develop and configure an offline-enabled application. The infrastructure layers SAP ERP and SUP serve an elementary Windows Mobile client in a simple manner. Development and administrative instructions are explained in detail.

Glossary
ALE MBO SUP SUP CDB SCC WM IDoc Application Link Enabling Mobile Business Object Sybase Unwired Platform SUP Consolidated Database Sybase Control Center Windows Mobile Intermediate Document is a standard SAP document format. IDocs enable the connection of different application systems using a message-based interface.

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 41

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Related Content
There is plenty of documentation and articles on SUP MBO architecture. Sybase Unwired Platform Developer Center Here is a selection of more general architecture documents: SUP Concepts Sybase Unwired Platform Version 2.1 - Architecture SUP 2.1.2 and 2.1.3 Architecture White Paper Sybase Unwired Platform 2.1.2 Sizing Guide

Specific business examples and tutorials: How To Implement a Simple Application using Sybase Unwired Platform 2.0 Windows Mobile Application Development using Custom Development - Sybase Unwired Platform 1.5.2

Appendix 1: Paths in SAP Easy Access Menu


Transaction WE20 (Partner Profile) SAP menu Logistics Materials Management Foreign Trade/Customs Communication / Printing Communication / Printing Environment IDoc / EDI Basis Administration Partner Profile Transaction WB03 (Plant) SAP menu Logistics Materials Management Purchasing Master Data Subsequent Settlement Vendor Rebate Arrangements Environment Condition / Arrangement Conditions: Sales Bonus Buy Environment Material Environment Material Groups Environment Information System Environment Master Data Plant

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 42

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

Transaction WPER (POS Interface Monitor) SAP menu Logistics Sales and Distribution Master Data Products Assortments Environment Assortment List POS Interface Monitor Transaction WE05 (IDoc Lists) SAP menu Logistics Materials Management Foreign Trade/Customs Communication Communication / Printing IDoc Lists Transaction MI07 (Post Difference) SAP menu Logistics Materials Management Physical Inventory Difference Post

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 43

SAP In-Store Ad Hoc Inventory for Windows Mobile (An SUP Template Application)

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. 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.

SAP COMMUNITY NETWORK 2012 SAP AG

scn.sap.com 44