B1if Training
Yatsea Li,
SAP Business One Solution Architect for APJ
Dec 2011
Internal
Agenda
Case Analysis
Get document
list by doc type,
status and sales
employee
SOAP request
and response
format
Integration
Scenario
Package
Scenario Step
Inbound
Outbound
Processing
Test
Get all sales
order
Get all open
sales order
Get all open
sales order by
sales employee
Setup
Export package
from dev system
Deactivate the
package in
customer system
Import and
Activate package
in customer
system
Internal
INBOUND
OUTBOUND
PROCESSING
Inbound
Processing
Internal
Backend
B1if
Internal
Service Method:
GetDocList Get the document list by document type, status and owner
The service method is identified by the root tag of SOAP Request.
Inbound Parameter:
- TableName: Table name of the document. ORDR Sales Order, OINV A/R Invoices etc.
Since all marketing documents share the table structure but with different table names, it can be reused to get all kind of
marketing documents.
Internal
Internal
Process: Retrieving the target doc list with SQL Call via
JDBC
Atom 1 - sql Call: Retrieving the doc list with sql call via JDBC
SELECT DocEntry, CardCode, CardName, DocDate, DocTotal FROM ORDR
WHERE DocStatus = O
-Output fields of document: DocEntry, Bp Code, Bp Name, Posting Date, Total Amount.
-Table [ORDR] will be replaced with variable $TableName from inbound parameter
-DocStatus O will be replaced with variable $DocStatus from inbound parameter
Atom 0 Final: Final transformation
Always the default last step to transform the message into outbound format with atom0.xsl
(to be implemented with xml editor later)
2011 SAP AG. All rights reserved.
Internal
Agenda
Case Analysis
Get document
list by doc type,
status and sales
employee
SOAP request
and response
Integration
Scenario
Package
Scenario Step
Inbound
Outbound
Processing
Test
Get all sales
order
Get all open
sales order
Get all open
sales order by
sales employee
Setup
Export package
from dev system
Deactivate the
package in
customer system
Import and
Activate package
in customer
system
Internal
Choose No Authentication as
Authentication
Click Save
1 4
Note: Scenario Packages cant be modified in active mode, only in design mode.
Internal
10
1
2
Internal
11
Internal
12
2
3
4
5
Click on Channel
Click Save
Click Close
6
7
Internal
13
Click on Retrieval
Click Save
Click Close
Internal
14
2
3
2011 SAP AG. All rights reserved.
4
Internal
15
1
By default all scenario steps have one
xform atom (called final) associated with
an xslt file for final transformation.
Internal
16
Click Close
2
3
Internal
17
Note:
All the sales orders are retrieved in
one shot.
VariablesTableName and DocStatus
will be introduced later, to support
dynamically retrieving the document
list by document type ,status, and its
owner
Internal
18
Internal
19
XMLSpy project
Open the project with XMLSpy
Internal
20
Internal
21
Agenda
Overview
Case Analysis
Web Services in
B1if
Mobile Solution
Architecture
Procedure to
extend
Get document
list by doc type,
status and sales
employee
Integration
Scenario
Package
Scenario Step
Inbound
Outbound
Processing
Test
Get all sales
order
Get all open
sales order
Get all open
sales order by
sales employee
Setup
Export package
from dev system
Deactivate the
package in
customer system
Import and
Activate package
in customer
system
Internal
22
Create an XML file with content below for test inbound message:
<?xml version="1.0" encoding="UTF-8"?>
<GetDocList>
</GetDocList>
Open B1iP Control Center from path: Integration Framework for SAP Business One => Control Center
Internal
23
Internal
24
3
4
Internal
25
Step 1: Inbound
Internal
26
Internal
27
Internal
28
Internal
29
Agenda
Overview
Case Analysis
Web Services in
B1if
Mobile Solution
Architecture
Procedure to
extend
Get document
list by doc type,
status and sales
employee
Integration
Scenario
Package
Scenario Step
Inbound
Outbound
Processing
Test
Get all sales
order
Get all open
sales order
Get all open
sales order by
sales employee
Setup
Export package
from dev system
Deactivate the
package in
customer system
Import and
Activate package
in customer
system
Internal
30
2
Note:
B1if support both global and local variables, retrieving the parameter from inbound message. Making
the scenario more flexible and reusable.
We are going to create 3 local variables for Atom 1(sqlCall)
-TableName: the table name of document, e.g. ORDR - sales order, OINV - A/R Invoice etc
-DocStatus: the status of document, e.g. O Open, C Closed, (empty) - All
Internal
31
3
4
2
6
7
Internal
32
6
Internal
33
Internal
34
Internal
35
Internal
36
Agenda
Overview
Case Analysis
Web Services in
B1if
Mobile Solution
Architecture
Procedure to
extend
Get document
list by doc type,
status and sales
employee
Integration
Scenario
Package
Scenario Step
Inbound
Outbound
Processing
Test
Get all sales
order
Get all open
sales order
Get all open
sales order by
sales employee
Setup
Export package
from dev system
Deactivate the
package in
customer system
Import and
Activate package
in customer
system
Internal
37
Business Requirement:
Access control to sales marketing document s by owner. Mostly, the sale employee s are only allowed to view their
own documents.
Solution:
Filter the document list by sales employee binding to SAP Business One user in Employee master Data
Internal
38
3
SQL Statement with variable:
#SELECT DocEntry, CardCode, CardName, DocDate, DocTotal FROM $TableName T0
INNER JOIN OHEM T1 ON T0.SlpCode = T1.salesPrSon
INNER JOIN OUSR T2 ON T1.userId = T2.USERID
WHERE (DocStatus = 'O' OR '$DocStatus' = '')
AND T2.USER_CODE = '$Login'
Note:
1.It should be $DocStatus with semi-quote comma, not $DocStatus
2.$Login is a default variable defined in sap.B1Mobile as the current login use. XPath: $msg/*/userName
Internal
39
Internal
40
Internal
41
Internal
42
Agenda
Overview
Case Analysis
Web Services in
B1if
Mobile Solution
Architecture
Procedure to
extend
Get document
list by doc type,
status and sales
employee
Integration
Scenario
Package
Scenario Step
Inbound
Outbound
Processing
Test
Get all sales
order
Get all open
sales order
Get all open
sales order by
sales employee
Setup
Export package
from dev system
Deactivate the
package in
customer system
Import and
Activate package
in customer
system
Internal
43
1
2
3
Note: Export the package and save it as Zip file from Development System
Internal
44
1
Note:
Scenario Package cant be modified in active mode, only can be modified in design mode.
Internal
45
Internal
46
Internal
47
5
6
Internal
48
Note: User and Password for B1 application can be seen because we didnt set Enforce Secure
Transport. sap.B1Mobile scenario is configured by default having SSL authentication as mandatory.
2011 SAP AG. All rights reserved.
Internal
49
Thank You!