The first one is using Class CL_HTTP_UTILITY method ENCODE_BASE64 To convert the string to Base64 we have two ways in ABAP: To get the ‘Length’ in the TLV structure, we will use the Function Module SCMS_STRING_TO_XSTRING to convert the text to xString and then we will use xstrlen to get the length. ‘#Firoz Ashraf#1234567891# 08:30:00#115.00#15.00’ģrd Step is to convert the concatenated string to Base64 formatįrom the above example we get the following Base64 encoded valueĪQxGaXJveiBBc2hyYWYCCjEyMzQ1Njc4OTEDEzIwMjEtMTEtMTcgMDg6MzA6MDAEBjExNS4wMAUFMTUuMDA= Then concatenate these two strings with ‘Value’ (stored as string)Ĭoncatenate all the five TLVs into one string Tag = 5 (5 as a type represents the tax amount)Ģnd Step is to convert ‘Tag’ and ‘Length’ to Hexadecimal and then to string.Tag = 4 (4 as a type represents the invoice amount).Tag = 3 (3 as a type represents invoice time stamp).Tag = 2 (2 as a type represents the VAT number).Length = 12 (The number of the bytes in “Firoz Ashraf” word).Tag = 1 (1 as a type represents the seller name).Seller name for example, “ Firoz Ashraf”.Value is the data against each of the five fields. Length is the size of the value field in bytes (it’s not the count of characters but how many bytes the value represents) Tag is fixed (1 for Seller’s name, 2 for VAT No……5 for VAT Total) In this blog, I will show how to encode the QR data in base64 format using ABAP and then using it in SAPScript/SmartForms to print QR code on Invoice layouts.ġst Step is to prepare each of the five values in TLV ( Tag- Length- Value) structure Time stamp of the invoice (date and time). 23), the minimum requirements that must be shown after scanning a QR code are the following fields, which should be represented in form of based64 encoding: As per Zakat, Tax and Customs Authority (ZATCA) of Saudi Arabia, one of the main requirements is the implementation of QR codes on tax invoices in the e-invoicing project (Fatoora), which will be mandatory starting December 4, 2021Īs per the ZATCA instructions(Page No.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |