Articles on: Integrations

SAP Business One B1 Integration

Introduction


This document uses the word SAP to refer to SAP Business One.


Handy offers our clients an integration between SAP and Handy.


This integration synchronizes sales at Handy (presales) as sales quotations in SAP.


Additionally, it synchronizes clients, products, prices, and warehouse stock from SAP to Handy.


This document elaborates on the scope of this integration. If you're interested, please get in touch with us via chat to receive a quote for the service.


In some cases, the quote can be adjusted depending on your operation's structure and the number of distribution centers you'll integrate.



Pre-requisites


The integration uses SAP's Service Layer API (web services) to connect both systems securely and robustly. SAP supports SQL and HANA, starting from version 10.


  • Activate SAP's Service Layer and have your public URL on the internet. Both the activation and the URL can be obtained from the Extension Manager.
  • Have the user credentials: UserName, Password , and CompanyDB. You don't need to get an additional license. You also don't need one license for each Handy user, just one SAP license to synchronize the information. Later on, check out the option to synchronize orders. If you wish to synchronize them as Sales offer, you'll need a Professional license.
  • Provide the service URLs for the Handy test environment (QA environment).
  • The user must have access to the following: Currencies, Quotations, Orders, Items, ItemGroups, InventoryPostings, BusinessPartners and PriceLists.


Scope of the integration


Synchronization of SAP → Handy


Clients


SAP business partners of the customer type are synced to Handy and created as clients. Their general information is synchronized, such as client code, name, address, phone number, email, and credit limit. The full data mapping can be seen below.


New clients and client updates are synchronized every 10 minutes at most.


The zone assigned to the client will correspond to the custom SAP field OCRD.U_HandyZone , or it can be mapped to another field, if preferred. If clients don't have this value defined, they're not synchronized. It's also possible to use the SalesPersonCode field to sync as the Handy zone, which represents the salesperson code in SAP.


Only clients (BusinessPartners) of the Customer type (CardType=cCustomer) are synchronized.


⚠️ The integration doesn't send new clients from Handy to SAP. Clients must be created first in SAP. The integration waits for the client codes to coincide between the two systems.


To control which clients are visible in Handy, you must add this custom code in SAP:

OCRD.U_HandyCustomerStatus with two possible values:

  • 01: disabled
  • 02: enabled


These have to be text strings (i.e., "01"), not numerical.


The built-in active/inactive field in SAP should not be used as a replacement for this new field, because other factors, like credit status, can alter it, and this could lead to a client becoming disabled in Handy. This is undesired, as you should be able to log a visit with a client, even if their credit status is poor.


If this field is not included, all clients will be enabled in Handy.


Clients are synced every 10 minutes, approximately.


Products


Products are synchronized with their families and product categories.


⚠️ Products should be first created in SAP. The integration does not send products from Handy to SAP; it waits for the product codes to coincide between SAP and Handy.


The products copied to SAP must have these characteristics in order to be able to sync; if not, they're ignored:

  • Be active (Active=Y, Frozen=N)
  • Be sellable (SalesItem=Y)
  • Be inventoriable (InventoryItem=Y)
  • Be assigned to at least one price list
  • The unit of measure must exist in Handy (with the exact same name as in SAP)


To group products in Handy, you must use the custom field U_HandyProductCategory, which should contain the name of the product family you wish to use in Handy (for example, "Cookies", not an ID).


SAP's native field to group products will sync to the product category, which is only informative.


Doing it this way gives you more control over which products you want to be available in Handy. If you want a group of products available in SAP to be unavailable in Handy, you can assign a product family called "Inactive" and disable it in Handy.


A default price list must be selected to use as regular prices in Handy.


Products are synced every 10 minutes, approximately.


Prices


Price synchronization supports these schemes:

  • General prices (from price list)
  • Special prices per client


When there are special prices for a specific client, these have priority over the general price lists.


It only uses one currency, right now being the Mexican peso (code MXP), but this can be personalized, if needed.


📌 You can synchronize up to 5 price lists at a time. They're selected from the integration settings.


There can be certain cases where you don't want Handy to assign a price list to a client, even if they have one assigned in SAP. This way, when you're placing an order in Handy, the salesperson can choose which price list to use. This can be set up in the integration.


Price lists are synced every 10 minutes, approximately.


Inventory


The integration supports the synchronization of changes in inventory every 10 minutes, approximately. Only products that change are synced.


To set up this part of the integration, it is required to create a query in SAP that we can run in order to read inventory changes from a specific warehouse. You also need to tell us which warehouse should be considered for synchronization.


The query you need to create is the following:


SELECT
T0.[ ItemCode ],
T1.[ OnHand ]
FROM
[ OINM ] T0
INNER JOIN [ OITW ] T1 ON T1.[ ItemCode ] = T0.[ ItemCode ]
WHERE
(T0.[ DocDate ] =: fecha)
AND (T0.[ DocTime ] >=: hora)
AND (T1.[ WhsCode ] =: almacen)
GROUP BY
T0.[ ItemCode ],
T0.[ DocTime ],
T0.[ DocDate ],
T1.[ OnHand ]
ORDER BY
T0.[ DocDate ] DESC,
T0.[ DocTime ] DESC,
T0.[ ItemCode ]



And you must make it available under the following name/URL:


/b1s/v2/SQLQueries('GetInventoryMovements')/List



Synchronization from Handy → SAP


From Presale in Handy to Sales Quotations


Presales registered in Handy are automatically registered as Sales Quotations in SAP every 10 minutes. They can also be set up to register as Sales Orders, if preferred.


Creating Sales Orders is more strict in SAP, and it causes the inventory to be reserved. Sales quotations don't reserve inventory and don't depend on the client being active.


Sales orders require a delivery date; this information will come from Handy.


Types of orders in Handy can be set up to direct orders to different warehouses in SAP. You do this by naming the type or order with the corresponding warehouse name in SAP (same name).


As a reference, the field Comments in SAP saves:

  • Order ID from Handy
  • Type of order
  • The user who registered the order
  • Additional comments (recorded in the Handy order)


If you wish, you can set up the integration so that if any orders are cancelled in Handy, they get cancelled in SAP automatically too.


The resulting ID in the SAP document (either quotation or order) will also appear in Handy so it can be analyzed on the website, if necessary.


Alerts and notifications


When an order can't be created in SAP (for example, because it exceeds the credit limit), you can get:

  • A real-time notification to the salesperson in the Handy mobile app
  • An email to the administrator, indicating the cause of the error


Tech support


Handy offers tech support on this integration on the same schedule as regular support for Handy. From Monday to Friday, from 08:00 to 19:00 (Central Mexico time).



Technical notes and safety


  • The integration works for SAP SQL and SAP HANA (from version 10).
  • Additional licenses are not required; you can use an existing one. But a license IS required.
  • A user license type is required, not an instance license type.


To reduce security risks from exposing the SAP web API on the Internet, Handy allows you to set up a network security rule so that only a fixed IP address can access the API.


Handy manages a proxy server with a fixed IP and can provide the IP value to use. It is the client’s responsibility to configure their network so that the service is accessible only from this fixed IP, using their firewall settings.



📋 Field mapping SAP B1 ↔ Handy


Orders


Field in Handy

Field in SAP B1

customer

CardCode

mobileDateCreated

DocDate

sellerComment

Comments

scheduledDateForDelivery

DocDueDate

items[].product

DocumentLines[].ItemCode

items[].quantity

DocumentLines[].Quantity

items[].price

DocumentLines[].Price

items[].product.tax

DocumentLines[].TaxCode


The taxes field is mapped between Handy and SAP. The codes to use for taxes are those corresponding to the table OVTG in SAP. Handy’s 16% IVA tax is mapped to the IVA16 value in SAP. Each client’s tax requirements should be reviewed individually.


Optionally, you can map the field WarehouseCode in each line to the type of order selected.


Clients (business partners in SAP)


Field in Handy

Field in SAP B1

code

CardCode

description

CardName

zone

U_HandyZone. It can also be customized to another user field in the same table.

address

BPAddresses[0].Street + BPAddresses[0].StreetNo

neighborhood

BPAddresses[0].Block

city

BPAddresses[0].City + BPAddresses[0].County + BPAddresses[0].State. Don't confuse County with Country.

postal_code

BPAddresses[0].ZipCode

phone_number

Phone1

enabled

U_HandyCustomerStatus ("01" = inactive, "02" = active). It can also be customized to another user field in the same table.

price_list

PriceListNum

balance

CurrentAccountBalance

credit

CreditLimit

email

ContactEmployees[0].E_Mail

owner

Concatenation of fields FirstName + MiddleName + LastName of ContactEmployees[0]

customerTaxId

FederalTaxID


  • For the address, the integration tries to find the one that corresponds to the name set as default in the delivery (ShipToDefault). If it doesn't exist, it takes the first one.
  • If the client doesn't have an assigned salesperson, it's assigned to the "Default" zone.
  • The price list ID that Handy uses is the one that matches the code in Handy's price list to the ID in SAP's list.


Products (articles in SAP)


Field in Handy

Field in SAP B1

code

ItemCode

description

ItemName

family

U_HandyProductCategory. It can also be customized to another user field in the same table.

category

ItemsGroupCode

barcode

BarCode

quantity

QuantityOnStock

price

Price corresponding to the price list specified as the default

unit

SalesUnit


Price lists


Field in Handy

Field in SAP B1

code

ListNum

name

ListName

product_code

ItemCode

price

Price


  • Only active price lists in SAP are synchronized.
  • Prices are taken from the product catalog.


Special prices


Field in Handy

Field in SAP B1

product_code

ItemCode

customer_code

CardCode

price

Price




Not yet supported


Some functions have not been implemented in the integration yet:


  • Route management (sales and deliveries)
  • Sales goals
  • Promotions
  • Discounts
  • Invoicing from Handy
  • Deliveries
  • Multi-currency
  • Outstanding balances
  • Balance breakdown



Advanced settings


Series

In some cases, companies use different document number ranges in SAP for each distribution center.

It's possible to determine, per user (salesperson), which number of SAP series to use for orders placed in Handy.

To do this, place a text box in the field "extras" when editing a Handy user, and indicate the SAP ID of the series to use for each user.


For example, to use the ID of numbers (series) of SAP number 22, write the following JSON in the "extras" field if the Handy user:

{ "Quotation": { "Series": 22 } }


This will make the documents registered by said user be assigned to that SAP series.

If this information is not clearly specified for the user, the default SAP series will be used.


Problem solving


If a client is not syncing from SAP to Handy

  • Verify that the price list assigned to the client in SAP is set up to sync with Handy. If the price list assigned to the client in SAP doesn't exist, it won't sync to Handy. In this article, you'll find the limitations of syncing price lists from SAP to Handy.
  • Verify that the client is enabled (field "Valid" in SAP) and that it has a value in the user's field "Zone" in SAP.


Do you want to schedule a meeting to help you integrate SAP with Handy?

Let us know in the chat!


Updated on: 10/10/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!