Vous êtes sur la page 1sur 47

SDK 9.

0 Enhancements
SAP Business One Solution Architects
December 2012
Objectives

At the end of this module, you will be able to:


List the new SDK features offered by SAP Business One 9.0 version
Use the new SDK features inside your add-on
Understand the new development tools offered
Apprehend some new infrastructure changes of B1 9.0 that are
important for SDK developers

2012 SAP AG. All rights reserved. RKT 2


Agenda

B1 Studio

B1 Workflow

SDK - UI API

SDK - DI API

B1 Infrastruture

2012 SAP AG. All rights reserved. RKT 3


Agenda

B1 Studio

B1 Workflow

SDK - UI API

SDK - DI API

B1 Infrastruture

2012 SAP AG. All rights reserved. RKT 4


SAP Business One Studio Suite

Set of tools to extend SAP Business One, from customization to extension


development.

SAP Business One Studio (abbr. Studio)


Out-of-the-box solution included in SAP Business One, where you can design the
layout of your add-on.
Itis an upgraded version of Screen Painter and an open platform for other
designers, such as Workflow Designer.

SAP Business One Studio for Microsoft Visual Studio


Development environment highly integrated with Visual Studio 2010 to achieve high
satisfaction for partner developers, speed up B1 Add-On development efficiency &
learning curve
Partners can develop add-ons with full capability such as UI design, code generate,
debug, build, and deployment.

2012 SAP AG. All rights reserved. RKT 5


SAP Business One Studio Suite - Target Users

Developer Consultant Customer IT UX Designer

SAP Business One Studio for Microsoft Visual


Suite Studio
SAP Business One Studio

2012 SAP AG. All rights reserved. RKT 6


SAP Business One Studio - Highlights

Reduce development effort


Offer better user experience by drag & drop
Cover user/UDO/system forms (compatible screen painter file format)
Open platform for functions like SAP Business One Workflow

2012 SAP AG. All rights reserved. RKT 7


SAP Business One Studio for Microsoft Visual Studio -
Highlights

Leverage Visual Studio (SAP Business One 9.0 supports C# only.)


Design and develop user/UDO/system forms and event handling by drag & drop
Add-On code generation based on SDK UI Object Level Event
Shared input and output between Studio and Studio for VS

2012 SAP AG. All rights reserved. RKT 8


Agenda

B1 Studio

B1 Workflow

SDK - UI API

SDK - DI API

B1 Infrastruture

2012 SAP AG. All rights reserved. RKT 9


Introduction
New SAP Business One Workflow
collaboration and
enables user
business process
management from process
definition, process execution and
process tracking in an easy and effective
way.

It brings instant value to customer, including increase process


transparency, user productivity and communication efficiency. Meanwhile it
also provides partners more extensibility capability to create best
practice processes for certain industries.

2012 SAP AG. All rights reserved. RKT 10


Value Proposition

Process transparency and standardization.


Increase user productivity and communication efficiency.
Effective process controlling.

More extensibility to create differentiation.


Make best practice process and implement to customer.

2012 SAP AG. All rights reserved. RKT 11


SAP Business One Workflow

Workflow Manager Workflow Worklist

4 components: Workflow Monitor


Workflow Manager manages the workflow process template
and imports XML generated in the workflow designer. Inside SAP
Business Studio.
Workflow Instance starts the process based on the workflow
template and visualizes the process to inform end users of the
process status.
Workflow Worklist user finds and picks up a task
Workflow Instance Workflow Monitor checks the status of all process instances
2012 SAP AG. All rights reserved. RKT 12
Agenda

B1 Studio

B1 Workflow

SDK - UI API

SDK - DI API

B1 Infrastruture

2012 SAP AG. All rights reserved. RKT 13


SDK UI API

Pinning Column in Grid/Matrix


Save Form Setting Explicitly
Refactoring Object Level Events

2012 SAP AG. All rights reserved. RKT 14


Pinning Column in Grid/Matrix

Pin columns in Matrix/Grid to keep them displayed on the screen when you drag the scrollbar.

Columns with pinning status


are in blue color

For both Grid and Matrix, added property in CommonSetting.

Not supported in System matrix, not supported in row pinning.

When the matrix is wide enough to be able to contain all columns, the scrollbar disappear.

When a grid is collapsed, there are no pinning columns existing in grid.

Delete/Hide columns: doesnt affect the existing behavior

2012 SAP AG. All rights reserved. RKT 15


Pinning Column - Usage

oGrid.CommonSetting.FixedColumnsCount = 4;

Set FixedColumnsCount value from 1 to oGrid.ColumnCount.

Setting FixedColumnsCount lower than 1 sets count to 1 due to the system grid behavior.

Setting FixedColumnsCount above the actual column count will throw an exception Invalid column
number.

Setting FixedColumnsCount in System matrix will throw an exception.

FixedColumnsCount is based on physical count. Invisible and deleted columns are taken into account.

First column is fixed by default and setting FixedColumnCount to 0 does not affect the first column.

2012 SAP AG. All rights reserved. RKT 16


Save Form Settings Explicitly

To use when a form has more than one tab and each Tab (Folder) contains a matrix.

If FormSetting enabled => Set corresponding matrix after folder selected, configurations for
different tabs will be saved.

2012 SAP AG. All rights reserved. RKT 17


Save Form Setting Explicitly - Usage
Step1: Create a form and enable form setting.
oFirstForm = SBO_Application.Forms.AddEx(oCreationParams);
oFirstForm.Settings.Enabled = true;

Step2: Add more than 1 folder to form and set folder AutoPaneSelection to true
oFolder.AutoPaneSelection = true;

Step3: Add a matrix to each folder and set frompane/topane


oItem = oFirstForm.Items.Add("matrix1", SAPbouiCOM.BoFormItemTypes.it_MATRIX);
oItem.FromPane = 1;
oItem.ToPane = 1;

Step4: Handle et_ITEM_PRESSED event on each folder and set MatrixUID correspondingly.
private void SBO_Application_ItemEvent(string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent)
{
BubbleEvent = true;
if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED &&!pVal.BeforeAction)
{
if (pVal.FormUID == myform")
{
if (pVal.ItemUID == "Folder1")
{
oFirstForm.Settings.MatrixUID = "matrix1";
}
else if (pVal.ItemUID == "Folder2")
{
oFirstForm.Settings.MatrixUID = "matrix2";
}
} } }

2012 SAP AG. All rights reserved. RKT 18


Refactoring Object Level Events Code Sample

The current COM event has been refactored to implement a set of object level events.

Old events listeners remain unchanged to maintain backward compatibility.

2012 SAP AG. All rights reserved. RKT 19


Refactoring Object Level Events Visual Studio B1 add-in

2012 SAP AG. All rights reserved. RKT 20


Agenda

B1 Studio

B1 Workflow

SDK - UI API

SDK - DI API

B1 Infrastruture

2012 SAP AG. All rights reserved. RKT 21


SDK DI API

New DI API services related to the new B1 functionality


Add UserFields to ServiceType Objects
External Reconciliation
Attachment for Documents

2012 SAP AG. All rights reserved. RKT 22


New DI API objects/services

Multiple UoM

Fixed Assets

Price List and Discount Group

Payment and Deposit Cancellation

GL Account Determination

Cancel Marketing Document

2012 SAP AG. All rights reserved. RKT 23


Add UserFields to ServiceType Objects

The UserFields attribute is added to the following service type objects

Name in B1 Object Table Service

Activities Activity OCLG ActivitiesService


Accrual Type AccrualType OACR AccrualTypesService

Cost Centre Type CostCenterType OCCT CostCenterTypesService

Distribution DistributionRule OOCR DistributionRulesService


Rule
Deposit Deposit ODPS DepositsService

Blanket Agreements BlanketAgreement OOAT BlanketAgreementsService


Blanket Agreements
- Details
Blanket Agreements
- Rows
Campaign Campaign OCPN CampaignsService
Campaign - BPs
Campaign - Items
Campaign - Partners

2012 SAP AG. All rights reserved. RKT 24


Add UserFields to ServiceType Objects - Usage

ActivityService - Sample Code (vb.net)


Dim oUserFieldsMD As SAPbobsCOM.UserFieldsMD oUserFieldsMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields)
oUserFieldsMD.TableName = "OCLG"
oUserFieldsMD.Name = SpType"
oUserFieldsMD.Description = " SpType "
oUserFieldsMD.Add()

Dim ActServ As SAPbobsCOM.ActivitiesService ActServ= companyServ.GetBusinessService(SAPbobsCOM.ServiceTypes.ActivitiesService)


Dim Act As SAPbobsCOM.Activity Act = ActServ.GetDataInterface(SAPbobsCOM.ActivitiesServiceDataInterfaces.asActivity)
Dim ActP As SAPbobsCOM.ActivityParamsActP =
ActServ.GetDataInterface(SAPbobsCOM.ActivitiesServiceDataInterfaces.asActivityParams)
ActP.ActivityCode = 1

Act = ActServ.GetActivity(ActP)
Act.CardCode = "c"
Act.StartDate = System.DateTime.Parse("12/2/2002 13:20:25")
Act.EndDuedate = System.DateTime.Parse("12/3/2002 13:20:25")
Act.StartTime = System.DateTime.Parse("12/2/2002 13:20:25")
Act.EndTime = System.DateTime.Parse("12/2/2002 13:20:45")
Act.Activity = SAPbobsCOM.BoActivities.cn_Conversation
Act.Notes = "Discuss next year's financial"

//set UDF U_ SpType


Act.UserFields.Item("U_ SpType").Value = "1"

ActServ.UpdateActivity(Act)

2012 SAP AG. All rights reserved. RKT 25


External Reconciliation Business Case (1/2)

Purpose
Execute or cancel an external reconciliation.

Scenario use Business partner as example (another reconcile type is G/L Account)
Step1 Create External Bank Statement by GUI or by DI object BankStatementsService ( already exposed in
previous version)

2012 SAP AG. All rights reserved. RKT 26


External Reconciliation Business Case (2/2)

Step2 Create Invoice or Payment (by GUI or by DI)

Step3 Reconcile by new DI object ExternalReconciliationsService

2012 SAP AG. All rights reserved. RKT 27


Execute External Reconciliation Sample Code (1/2)
//Get business service.
SAPbobsCOM.CompanyService oCompanyService = Cmpy.GetCompanyService();
SAPbobsCOM.ExternalReconciliationsService ExtReconSvc =
(SAPbobsCOM.ExternalReconciliationsService)oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.ExternalReconciliati
onsService);
SAPbobsCOM.ExternalReconciliation ExtReconciliation =
(SAPbobsCOM.ExternalReconciliation)ExtReconSvc.GetDataInterface(SAPbobsCOM.ExternalReconciliationsServiceDataInterfaces.er
sExternalReconciliations);

ExtReconciliation.ReconciliationAccountType = SAPbobsCOM.ReconciliationAccountTypeEnum.rat_BusinessPartner; // default is


GL Account

//Reconcile object.
SAPbobsCOM.ReconciliationJournalEntryLine jeLine1 =
(SAPbobsCOM.ReconciliationJournalEntryLine)ExtReconciliation.ReconciliationJournalEntryLines.Add();
jeLine1.TransactionNumber = "1";
jeLine1.LineNumber = 1;

SAPbobsCOM.ReconciliationJournalEntryLine jeLine2 =
(SAPbobsCOM.ReconciliationJournalEntryLine)ExtReconciliation.ReconciliationJournalEntryLines.Add();
jeLine2.TransactionNumber = "2";
jeLine2.LineNumber = 2;

SAPbobsCOM.ReconciliationBankStatementLine bstLine1 =
(SAPbobsCOM.ReconciliationBankStatementLine)ExtReconciliation.ReconciliationBankStatementLines.Add();
bstLine1.BankStatementAccountCode = "C1";
bstLine1.Sequence = 1;

SAPbobsCOM.ReconciliationBankStatementLine bstLine2 =
(SAPbobsCOM.ReconciliationBankStatementLine)ExtReconciliation.ReconciliationBankStatementLines.Add();
bstLine2.BankStatementAccountCode = " C1";
bstLine2.Sequence = 2;

ExtReconSvc.Reconcile(ExtReconciliation);
2012 SAP AG. All rights reserved. RKT 28
Cancel External Reconciliation Sample Code (2/2)
//Get object.
SAPbobsCOM.ExternalReconciliationParams ExtReconParam =
(SAPbobsCOM.ExternalReconciliationParams)ExtReconSvc.GetDataInterface(
SAPbobsCOM.ExternalReconciliationsServiceDataInterfaces.ersExternalReconciliationParams);
ExtReconParam.AccountCode = "100012";
ExtReconParam.ReconciliationNo = "2";
ExtReconciliation = ExtReconSvc.GetReconciliation(ExtReconParam);

//Get Reconcile List.


SAPbobsCOM.ExternalReconciliationsParamsCollection ExtReconsParamsCollection =
(SAPbobsCOM.ExternalReconciliationsParamsCollection)ExtReconSvc.GetDataInterface(
SAPbobsCOM.ExternalReconciliationsServiceDataInterfaces.ersExternalReconciliationsParamsCollection);

SAPbobsCOM.ExternalReconciliationFilterParams ExtReconFilteredParams =
(SAPbobsCOM.ExternalReconciliationFilterParams)ExtReconSvc.GetDataInterface(
SAPbobsCOM.ExternalReconciliationsServiceDataInterfaces.ersExternalReconciliationFilterParams);
ExtReconFilteredParams.ReconciliationAccountType =
SAPbobsCOM.ReconciliationAccountTypeEnum.rat_GLAccount;//"G/L Account"
ExtReconFilteredParams.AccountCodeFrom = "11200000-01-001-01";
ExtReconFilteredParams.AccountCodeTo = "12400000-01-001-01";
ExtReconFilteredParams.ReconciliationDateFrom = "05/03/11";
ExtReconFilteredParams.ReconciliationDateTo = "06/03/11";
ExtReconFilteredParams.ReconciliationNoFrom = 1;
ExtReconFilteredParams.ReconciliationNoTo = 2;
ExtReconsParamsCollection = ExtReconSvc.GetReconciliationList(ExtReconFilteredParams);

//Cancel reconciliations.
foreach (SAPbobsCOM.ExternalReconciliationParams ExtReconParam in ExtReconsParamsCollection)
{
ExtReconSvc.CancelReconciliation(ExtReconParam);
}

2012 SAP AG. All rights reserved. RKT 29


Attachment for Documents

A new interface AttachmentEntry is available for you to add attachments to the Documents object.

2012 SAP AG. All rights reserved. RKT 30


Agenda

B1 Studio

B1 Workflow

SDK - UI API

SDK - DI API

B1 Infrastruture

2012 SAP AG. All rights reserved. RKT 31


B1 Infrastruture

64bits processing support


Add UserFields to ServiceType Objects
External Reconciliation
Attachment for Documents

2012 SAP AG. All rights reserved. RKT 32


64bits processing support

Support 64bit processing:

SAP Business One Client,


SAP Business One Studio,
SAP Business One add-ons (Electronic File Manager, Outlook
Integration, Payment Engine, and ScreenPainter),
Data Transfer Workbench,
Outlook Integration server, Outlook Integration standalone,
Solution Packager.

Enables use of all of the available memory on a client system for better
performance.

Supports much more powerful partner add-ons and allow integration with other
64bit applications.

2012 SAP AG. All rights reserved. RKT 33


64bits Processing Support Implementation

SBO-COMMON

32 bit Addon 32 bit Addon


32 bit Addon 32 bit Addon Add-on
32bit Add-on 64bit Add-on Registration

64bit OS

32bit B1 Client 64bit B1 Client

32bit Add-on 64bit Add-on Add-on


Deployment

32bit UIAPI 64bit UIAPI


32bit DIAPI 64bit DIAPI
Server Server

2012 SAP AG. All rights reserved. RKT 34


64bit Processing Support Details
Released Media
32bit installers and 64bit installers are both included in Product CD and Upgrade CD

B1 Client
32bit B1 client and 64bit B1 client can be installed and run in the same machine
32bit B1 client and 64bit B1 client are installed separately
32bit B1 client can only upgrade 32bit B1 client
64bit B1 client can only upgrade 64bit B1 client

SDK
32bit DIAPI and 64bit DIAPI can be installed in the same machine
GUID of SDK COM component is the same between 32bit and 64bit
32bit UIAPI Server(SAPbouiCOM) and 64bit UIAPI Server can be installed and run in the same machine

Add-On Management
The same add-on 32bit version and 64bit version are registered as two different add-ons
32bit B1 client can only install/uninstall/upgrade/launch 32bit add-ons
64bit B1 client can only install/uninstall/upgrade/launch 64bit add-ons
ARD generator tool and Add-On Administrator form in B1 client indicates add-on platform

SAP Add-on
SAP add-ons with both 32bit and 64bit versions: Payment Engine, Outlook Integration, EFM
SAP add-ons with only 32bit version: DATEV, Elster

Partner Add-on
Partner need to provide 64bit add-on installer if can be used with 64bit B1 client

2012 SAP AG. All rights reserved. RKT 35


System Landscape Directory (SLD) Role and deployment
Service
License Manager CORBA
Dynamic key
Encryption HTTP
algorithm Server Machine
Readonly db user License Server
Site user
Server list
Db credential

B1 client Addon
Before 9.0
From 9.0
Service Browser/
Manager SLD Client
config config Server list
Server Machine SSO
Db credential
License Site user
License Server SLD Dynamic key
Encryption algorithm
login Read-Only db user
login

B1 client Addon

2012 SAP AG. All rights reserved. RKT 36


System Landscape Directory Details

System Landscape Directory (SLD)


Installed from Server Tools, must be in the same machine as License
Manager
Offers a web interface for configuration
Uses https, need to choose during installation
PXCS12 certificate store and password
or
Self signed certificate (default)
Creates new DB for SLD info (SLDModel.SLDData)
Choice of authentication:
Windows authentication => Asks for domain user, service will be run under this
user (must have Administration rights)
SQL Server authentication => service will be run with Local System user

2012 SAP AG. All rights reserved. RKT 37


Single Sign On (SSO) Bind user

Bind an SAP Business One user account to a Microsoft Windows domain account.

2012 SAP AG. All rights reserved. RKT 38


Single Sign On (SSO) How to enable

Administrators can enable global SSO functionality in the System Landscape Directory.

2012 SAP AG. All rights reserved. RKT 39


Single Sign On (SSO) Login

Users bypass Choose Company window


and start using the application without being
prompted to enter their SAP Business One
logon credentials.

User needs to confirm B1 user


password for the first time.
After the first time user doesnt need
to enter any credentials anymore.

2012 SAP AG. All rights reserved. RKT 40


Different DB user for each Company DB

The Company list can be filtered by domain user.


Goal
Avoid B1 users to see all companies, even if he has no access to it.
Avoid B1 users to create SQL queries from B1 to access other DBs.
With this feature each B1 user only see and has access to the companies where he
has access from his windows account.
Example:
Domain user assigned only to 1 B1 company DB user => If SSO and Different DB
user for each Company DB defined then he only see this company.
Domain user assigned to 2 B1 company DB users => If SSO and Different DB
user for each Company DB defined then the user see the 2 companies.

2012 SAP AG. All rights reserved. RKT 41


Different DB user for each Company DB -
Activation
This feature can be activated per each company from the System Landscape
Directory new tool.

2012 SAP AG. All rights reserved. RKT 42


Different DB user for each Company DB SQL user

A new DB user is automatically created in SQL server and assigned to the DB


(instead of the default DB administrator user).

2012 SAP AG. All rights reserved. RKT 43


Different DB user for each Company DB Security

You can configure the new SQL server user security from the System Landscape
Directory new tool.

2012 SAP AG. All rights reserved. RKT 44


Different DB user for each Company DB
B1 credentials DB admin credentials

DB credentials SLD
B1 DB
client
DB credentials

SSO
Windows client credentials DB admin credentials

DB admin credentials SLD


B1 DB
client
DB admin credentials

DB User Per Company with SSO


Windows client credentials DB admin credentials

DB credentials SLD
B1 DB
client
DB credentials

2012 SAP AG. All rights reserved. RKT 45


Summary

You should now be able to


Understand the new SDK features part of 9.0 release
Understand what is the new B1 Studio tool.
Understand what is the new Workflow tool.
Understand infrastructure changes that are important to apprehend
by SDK developers.

2012 SAP AG. All rights reserved. RKT 46


2012 SAP AG. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose Google App Engine, Google Apps, Google Checkout, Google Data API, Google Maps,
without the express permission of SAP AG. The information contained herein may be Google Mobile Ads, Google Mobile Updater, Google Mobile, Google Store, Google Sync,
changed without prior notice. Google Updater, Google Voice, Google Mail, Gmail, YouTube, Dalvik and Android are
trademarks or registered trademarks of Google Inc.
Some software products marketed by SAP AG and its distributors contain proprietary
software components of other software vendors. INTERMEC is a registered trademark of Intermec Technologies Corporation.
Microsoft, Windows, Excel, Outlook, PowerPoint, Silverlight, and Visual Studio are Wi-Fi is a registered trademark of Wi-Fi Alliance.
registered trademarks of Microsoft Corporation.
Bluetooth is a registered trademark of Bluetooth SIG Inc.
IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x,
System z, System z10, z10, z/VM, z/OS, OS/390, zEnterprise, PowerVM, Power Motorola is a registered trademark of Motorola Trademark Holdings LLC.
Architecture, Power Systems, POWER7, POWER6+, POWER6, POWER, PowerHA, Computop is a registered trademark of Computop Wirtschaftsinformatik GmbH.
pureScale, PowerPC, BladeCenter, System Storage, Storwize, XIV, GPFS, HACMP,
RETAIN, DB2 Connect, RACF, Redbooks, OS/2, AIX, Intelligent Miner, WebSphere, Tivoli, SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessObjects Explorer,
Informix, and Smarter Planet are trademarks or registered trademarks of IBM Corporation. StreamWork, SAP HANA, and other SAP products and services mentioned herein as well
as their respective logos are trademarks or registered trademarks of SAP AG in Germany
Linux is the registered trademark of Linus Torvalds in the United States and other countries. and other countries.
Adobe, the Adobe logo, Acrobat, PostScript, and Reader are trademarks or registered Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal
trademarks of Adobe Systems Incorporated in the United States and other countries. Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services
Oracle and Java are registered trademarks of Oracle and its affiliates. mentioned herein as well as their respective logos are trademarks or registered trademarks
of Business Objects Software Ltd. Business Objects is an SAP company.
UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.
Sybase and Adaptive Server, iAnywhere, Sybase 365, SQL Anywhere, and other Sybase
Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin products and services mentioned herein as well as their respective logos are trademarks or
are trademarks or registered trademarks of Citrix Systems Inc. registered trademarks of Sybase Inc. Sybase is an SAP company.
HTML, XML, XHTML, and W3C are trademarks or registered trademarks of W3C , Crossgate, m@gic EDDY, B2B 360, and B2B 360 Services are registered trademarks of
World Wide Web Consortium, Massachusetts Institute of Technology. Crossgate AG in Germany and other countries. Crossgate is an SAP company.
Apple, App Store, iBooks, iPad, iPhone, iPhoto, iPod, iTunes, Multi-Touch, Objective-C, All other product and service names mentioned are the trademarks of their respective
Retina, Safari, Siri, and Xcode are trademarks or registered trademarks of Apple Inc. companies. Data contained in this document serves informational purposes only. National
product specifications may vary.
IOS is a registered trademark of Cisco Systems Inc.
The information in this document is proprietary to SAP. No part of this document may be
RIM, BlackBerry, BBM, BlackBerry Curve, BlackBerry Bold, BlackBerry Pearl, BlackBerry reproduced, copied, or transmitted in any form or for any purpose without the express prior
Torch, BlackBerry Storm, BlackBerry Storm2, BlackBerry PlayBook, and BlackBerry App written permission of SAP AG.
World are trademarks or registered trademarks of Research in Motion Limited.

2012 SAP AG. All rights reserved. RKT 47