0% found this document useful (0 votes)
182 views4 pages

Sap QR Code Note 2889899

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
182 views4 pages

Sap QR Code Note 2889899

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

2023-02-16 2889899

2889899 - Creating QR Codes for Marketing Documents


Version 5 Type SAP Business One Notes
Language English Master Language English
Priority Correction with high priority Category Legal change
Release Status Released for Customer Released On 07/28/2020
Component SBO-REP-CR ( SAP Crystal Reports for SAP Business One )

Please find the original document at https://launchpad.support.sap.com/#/notes/ 2889899

Symptom

QR (Quick Response) codes are required for marketing documents that are created by SAP Business One
and SAP Business One, version for SAP HANA.

QR codes are needed on print layouts of marketing documents. An API service is needed for creating QR
codes.

Cause

Legal change

Solution

SAP intends to provide a patch or patches to solve the problem described. The section References below
lists the relevant patches once they become available, and the Related Info content of relevant patches
available in the SAP Support Portal, show this SAP Note. Be aware that these references can only be set at
patch release date. SAP delivers patches only for selected releases at its own discretion, based on the
business impact and the complexity of the implementation.

To allow for this requirement the following changes are planned for SAP Business One, and SAP Business
One, version for SAP HANA:

Marketing Documents

A new field labeled Create QR Code From is planned for the Accounting tab of marketing documents, for
example on A/R Invoices (follow path Sales - A/R → A/R Invoice → Accounting tab).

The information entered into Create QR Code From is used as the source from which QR codes are saved in
system tables and transformed into PNG (Portable Network Graphic) images.

Information can be added to Create QR Code From manually, by using a formula in a formatted search, by DI
API input, or by SAP Business One Service Layer on Windows (not on Linux). The source for QR codes can
also be user-defined fields that are called by API. The information entered into Create QR Code From can be
anything that customers require but is typically a link to a webpage that displays information relevant to the
document.

QR code generation is triggered when adding a document in the system.

You can display QR code images on print layouts of marketing documents; print layouts must be manually
adjusted to include QR code images based on joined data sources in the system.

An API service and a free open source library are available for partners to create QR codes.

© 2023 SAP SE or an SAP affiliate company. All rights reserved 1 of 4


2023-02-16 2889899

General Settings

A tab labeled QR Codes is available on the General Settings window (follow path Administration → System
Initialization → General Settings → QR Codes tab). You can vary the technical details of QR codes at the point
of generation by using the settings on QR Codes. After changes are made in QR Codes of General Settings,
the changes are only effective for QR codes after documents are updated.

To determine the size of QR codes, enter numbers between 1 and 40 in the fields Version - Min. Size and
Max. Size. To produce consistently sized QR codes, you can enter the same number in both fields. Placing
an upper limit on the size of QR codes restricts the amount of information that can be taken from Create QR
Code From to create QR codes.

Enter a number between 1 and 20 in Scale (pixels per module) to determine how many pixels are in a square
of a bitmap in the PNG file.

Select the checkbox QR Code Expiration to automatically remove QR codes from the database in a specified
number of days, entered in Expiration Days. Expiration dates are calculated and potentially recalculated from
the latest update of a document.

Redundant correction bytes are included and vary by the chosen Correction Level of created QR codes.
Choosing a setting of High means that less information can be included in the QR code but that the QR code
can be read and printed more easily with less potential for error. Choosing a setting of Low means that more
information can be included in the QR code but that the QR code can be read and printed less easily with
more potential for error.

Example Queries, Code, and Crystal Reports

1. To get a QR code in a PNG file format (OQRC.FileContnt) for a quotation with "DocEntry = 1":

select OQUT.DocEntry, OQUT.DocNum, OQUT.QRCodeSrc, OQRC.FileContnt

from OQUT

left join OQRC

on OQUT.DocEntry = OQRC.SrcObjAbs and OQRC.SrcObjType = 23

where OQUT.DocEntry = 1

2. To generate a QR code for a UDF (TextForQR) through DI API:

SAPbobsCOM.CompanyService oCompanyService;

oCompanyService = oCompany.GetCompanyService();

// QRC

SAPbobsCOM.QRCodeService oQRCodeService;

SAPbobsCOM.QRCodeData oQRCodeData;

oQRCodeService =
(SAPbobsCOM.QRCodeService)oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.QRCodeServic

oQRCodeData =
(SAPbobsCOM.QRCodeData)oQRCodeService.GetDataInterface(QRCodeServiceDataInterfaces.qrcsQRCodeData);

© 2023 SAP SE or an SAP affiliate company. All rights reserved 2 of 4


2023-02-16 2889899

try

//oQRCodeData.QRCodeText = "Updating QR Code Round 1 ...";

oQRCodeData.ObjectType = 23;

oQRCodeData.ObjectAbsEntry = "2";

oQRCodeData.FieldName = "U_TextForQR";

oQRCodeService.AddOrUpdateQRCode(oQRCodeData);

catch (Exception e)

throw new Exception(string.Format("Call DI API QRC failed with error code: {0}", e.Message));

finally

if (oQRCodeService != null)

System.Runtime.InteropServices.Marshal.ReleaseComObject(oQRCodeService);

3. Steps required to add a QR code image to a Crystal Report layout for marketing documents:

• "Add Command" in "Database Expert" window with the following query:


select "FileContnt", cast("SrcObjType" as varchar(20)) as ObjType, cast("SrcObjAbs" as integer) as
ObjAbs from OQRC where FieldName = 'QRCodeSrc'
• Name the command, for example "Cmd_QRCode"
• Go to the "Links" tab and link from the respective ODOC table with the following links:
ODOC.DocEntry --> Cmd_QRCode.ObjAbs
ODOC.ObjType --> Cmd_QRCode.ObjType
• Drag the field "FileContnt:Picture" from "Database Fields" / "Cmd_QRCode" into the report designer.

4. An example Crystal Report, modified as in the above instructions in step 3, is attached to this SAP
Note.
5. To update and regenerate a QR code through Service Layer (in 10.0PL02 only available on Windows,
from PL03 available on Linux as well) on a quotation:

Method: PATCH

URL: https://10.55.179.110:50000/b1s/v1/Quotations(2)

© 2023 SAP SE or an SAP affiliate company. All rights reserved 3 of 4


2023-02-16 2889899

(where "10.55.179.110:50000" is an example, you must add your own address and port in its place)

Body (JSON): {"CreateQRCodeFrom": "ThisIsTheNewTextForQRcode"}

Products

SAP B1 10.0 FOR SAP HANA


SAP BUSINESS ONE 10.0

This document is referenced by

SAP Note/KBA Title

3149813 IN_Dynamic QR Codes for B2C Invoices

3066813 QR Code Generation Enhancement for Marketing Documents and Payments

3060959 QR Codes for Item Master Data

3060640 AR_QR Codes for A/R Invoices

3060130 PT_QR Codes for Payments

3005352 PT_QR Codes for Marketing Documents

2948656 Overview Note for SAP Business One 10.0 FP 2008, version for SAP HANA

2948670 Overview Note for SAP Business One 10.0 FP 2008

2936615 CH_QR Codes for A/R Invoices

2873398 Overview Note for SAP Business One 10.0 PL02, version for SAP HANA

2873360 Overview Note for SAP Business One 10.0 PL02

Attachments

File Name File Size Mime Type

CR-Purchase Quotation (Item+QRCode)-XX-enUS (1).rpt 169 application/octet-stream

Terms of use | Copyright | Trademark | Legal Disclosure | Privacy

© 2023 SAP SE or an SAP affiliate company. All rights reserved 4 of 4

You might also like