Tuesday 16 April 2019

How to Create and Print the QR Code in Sap Scripts

Introduction


QR Code is stands for Quick Response Code.It was first developed and used in Japan.QR Code is advanced technology.It is a two-dimensional encoding, whereas a Bar Code is one-dimensional encoding in nature.

It’s store data using patterns of block dots and white spaces, arranged in a square grid.If the data you want to store in a QR code is made of only alphanumeric characters.

A single QR code can hold up to 4000 characters.

In this blog I am going to explain how to create QR Code in Sap Scripts and I covered all the steps which is required to create and print the QR Code.

Actually I got a requirement to create the QR Code and print that QR Code in SAP Scripts.

Now it is challenging to me because Scripts are older one, now smart forms is Advanced Technology and it have advanced features to print QR Code. But I need to create a QR Code in Scripts.

Let’s see how I achieved it.

Now I am going to explain you how to create a QR Code in Scripts.

Before to print QR Code in Sap Scripts we have to create own QR Code in SAP-Script Font maintenance(SE73).

Create your own QR Code font:


The following steps are as follows to create a QR Code:

Step 1: Go to SE73, then click on “System Bar Code” Radio Button and Click on Display button as shown in below screen shot.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Step 2: By clicking on display button the window will appear as shown in below screenshot, now click on Create(F5) Button.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

A pop-up will appear, click on New  button(new Bar code Technology) as shown in below screen shot.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Step 3: Now we have to define the Bar Code name and Short text of the Bar code, then click on continue.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Select Bar Code Symbologies as “Datamatrix ECC200”.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Select Bar Code Alignment as ‘Normal’, Mode as ‘Auto’ and Module Size in Pixel as ‘00025’ then click on continue.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

By clicking on Continue button a Pop-up will appear, click on ‘Yes’ to save Bar Code definition.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Here you can check the created QR Code as shown below.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Step 4: Select the Bar Code Definition and execute it.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

OUTPUT :

Click on Execute Button.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Give the Output Device as ‘LP01’ and click on ‘Print Preview’ button.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

You can see the print preview of your created Bar code as executing it as shown below:

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Now the QR code is created and now we have to import the created QR code to Sap Scripts.

The following steps are as follows to import the Created QR code to Sap Scripts:

Step 1: Go to se71, then give the Form name and click on ‘Create’ button.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Write a meaningful meaning to Form and click on “Pages” button as shown in below screenshot.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Step 2: Now go to Edit menu–>Create element.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

A pop-up will appear give the page name and meaning then click on continue as shown in below screen shot.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Step 3: Now go to Settings–>Form Painter as shown in below screen shot.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Go to “Sap script” tab and uncheck two check box’s click on continue as shown below.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Now click on “Character Formats”.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

In standard Attributes give Char.Format as ‘C1’ and Description as QR Code.

Check the selection check box and give the created Bar code name.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Step 4: Now click on “Windows” button.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Go to Edit menu–>Create Element.

Give the Window name and meaning then click on continue as shown in below screenshot.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Give the Default paragraph name as ‘p1’ for main window.

Similarly give the Default paragraph name as ‘p1’ for QR code window.

For Main Window:

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

For QR Code Window:

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Now select the QR Code Window and Click on Text Elements as shown in below screen shot.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

In Text Elements Write the below Text as shown in below screenshot:

Enter the Text as “<c1>&IKPF-IBLNR&</>”.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Now go back and click on “Paragraph Formats”.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Give the Paragraph name as ‘p1’ and press Enter button and then give the meaningful name to paragraph press Enter button.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Step 5: Now click on “Page Windows” button.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Go to Edit menu–>Create Element.

Double click on the “Main Window” and provide the attributes as shown in below screen shot.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Enter the values for “Main Window” attributes and press enter button :

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Similarly Go to Edit menu–>Create Element and double click on a QR code Window.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Enter the values for “QR Code Window” attributes and press enter button :

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Step 6: Now click on ‘Header’ button.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Give the meaningful name to Form and click on ‘Basic Settings’ as shown in below screenshot.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Give default Paragraph name as ‘p1’ and first page name as ‘page1’ as shown in below screen shot .

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Now Save and Activate it.

For Execute the Script go to Utilities Menu–>Printing Test.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

A pop-up will appear, give output device name as ‘LP01’ and click on ‘Print Preview’ button.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

OUTPUT :

Now the QR Code is Printed as shown in below screen shot.

SAP ABAP Tutorial and Materials, SAP HANA Guides, SAP ABAP Learning, SAP ABAP Certifications

Finally we achieved it, we created a QR Code and Printed it in Sap Scripts.

No comments:

Post a Comment