• Lekshmi P S
    Sr. Consultant, SAP Business Technology Platform (ABAP)
    November 4, 2022

QR Code with multiple variables in SAP Adobe Form

QR Code is the abbreviation of Quick Response Code, which is two-dimensional barcode.  This is a machine-readable optical label which contains information about what the QR Code is attached to.  In SAP Adobe Forms, printing of QR code is very similar to that of barcode.

Step 1

  • Create Form Interface with Transaction Code SFP
  • Create the required field(s) for  which QR Code is to be generated as Import Parameters

Step 2

Create the Adobe Form with transaction SFP

Step 3

Drag the required Import parameters in Form Context

Step 4

In Form Layout:

  • Get the field(s) for which QR code is to be generated

  • Drag QR code from Object Library.

If Object Library is not visible, get from Palettes.

Palettes -> Object Library

  • Choose QR Code from Barcodes in Object Library

  • Drag QR Code to Form Layout

  • Having QR Code for Single Field:
  • Choose QR Code element which is dragged to the form layout
  • Do Binding with the required field

  • Having QR Code for Multiple Parameters :
  • Choose QR Code element which is dragged to the form layout
  • Open Script Editor (Palettes -> Script Editor)

  • Write the FormCalc Script for getting value of QR Code

Event:           Initialize

Language:   FormCalc

Run At:         Client

Script Logic:

  • Define Variables to hold the values of required fields

Eg:       var invoiceno = IV_INVOICENO.rawValue

var invdate   = IV_INV_DATE.rawValue

var invvalue  = IV_INV_VALUE.rawValue

  • Concatenate these variables into the rawValue of selected QR Code element

Eg:       $.rawValue = concat(invoiceno, invdate, invvalue)

Step 5

 

  • Execute the Adobe Form

  • Execute – Print / Print Preview

  • Scan QR Code with smartphone, it will result a single string of Entered Values

Lesson Learnt:

If there is an error in Script Logic of QR Code element, the scanned image will result the following string:

Latest Blogs