Sap QR Code Note 2889899
Sap QR Code Note 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.
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.
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.
1. To get a QR code in a PNG file format (OQRC.FileContnt) for a quotation with "DocEntry = 1":
from OQUT
where OQUT.DocEntry = 1
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);
try
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:
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)
(where "10.55.179.110:50000" is an example, you must add your own address and port in its place)
Products
2948656 Overview Note for SAP Business One 10.0 FP 2008, version for SAP HANA
2873398 Overview Note for SAP Business One 10.0 PL02, version for SAP HANA
Attachments