2026 Mar 07 1:48 AM - edited 2026 Mar 07 3:13 PM
Hi All,
How to replicate the QR Code, for an Invoice that was accepted by the KSeF, e-invoicing System and sent back the PDF with QR Code? The QR Code (not the pdf) is stored in the Table Field EDOPLINV-QRCODE_ACCEPTED.
Expected Result:
The QR Code should be re-generated in a custom Smart form, from the value stored in the Table field EDOPLINV-QRCODE_ACCEPTED. when scanned, it should re-direct to KSef PL Gov website.
Procedure:
I have the following test code written in the Smart form, very similar to this blog post QR Code in Base64 encoding for KSA E-Invoicing - Directly from data in Table EDOSAINV
Note: In the- above Blog, QR Code is encoded to Base 64, But I don't want this.
*Global Data
Data:
EV_QRCODE type string. "or xstringSELECT SINGLE
FROM edoplinv
FIELDS *
WHERE edoc_guid = '699D630206330553E1000000A467BBA9'
INTO ls_edoplinv.
DATA lv_image_base64 TYPE string.
DATA lo_xstr_to_str_conv TYPE REF TO cl_abap_conv_in_ce.
cl_abap_conv_in_ce=>create(
EXPORTING
encoding = 'UTF-8'
input = ls_edoplinv-qr_code_accepted
RECEIVING
conv = lo_xstr_to_str_conv
).
lo_xstr_to_str_conv->read( IMPORTING data = lv_image_base64 ).
DATA: lv_image_xstring TYPE xstring.
lv_image_xstring = cl_http_utility=>decode_x_base64(
encoded = lv_image_base64 ).
*--Assign to the QRCode variable used in the UI
EV_QRCODE = lv_image_xstringIn the smart form, created a text with the following snippet
<QR>&EV_QRCODE&</>The QR Code is generated, but does not point to the KSeF, instead shows a 4 digit gibberish value.
Expected URL starts with below URL
https://qr-demo.ksef.mf.gov/client-app/invoice/Can you please suggest how to fix it ?
Request clarification before answering.
In a smartform you have two options for a QR code:
What I did for a customer is: generate the image in the print program, save it to a dynamically-named image (so that concurrent printing of different invoices is possible), in the smartform read the appropriate name of the picture, when form is done remove the picture from DB.
*
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.