Skip to Content
Technical Articles
Author's profile photo Vesna Solakova

Swiss QR Bill – How to print QR Bill with Billing Document Number in the QR Reference

To create QR Reference which contains Billing Document Number instead of Accounting Document Number refer to SAP Note 3293387

QR Reference is saved into Payment Reference field of follow-up Accounting Document assigned to Billing Document.

  1. Implement prerequisite SAP Note 3292960 to change the visibility of method if_swiss_qr_ref_sd~gen_reference_number (class cl_swiss_qr_ref ) from protected to public.
  2. Use enhancement SDVFX009 Billing doc. processing KIDNO – implement SD user exit EXIT_SAPLV60A_001 based on T049Q table to save QR Reference into KIDNO field of origin Accounting Document. Find the code example in the Attachments of  SAP Note 3293387.
  3. Implement BAdi BADI_QRBILL_CH_PRINT and put below logic under method IF_QRBILL_CH_BADI_PRINT~GET_REFERENCE_NUMBER

     Call method if_swiss_qr_ref_sd~gen_reference_number (class cl_swiss_qr_ref ) with Customer Number, Document Number as Billing Document Number and T049Q data.

Example:

METHOD if_qrbill_ch_badi_print~get_reference_number.

DATA : lv_doc_no  TYPE belnr_d,
lv_cusno   TYPE kunnr,
lv_ref_num TYPE glo_ref_num,
ls_t049q   TYPE t049q.

IF is_billingdoc_header-vbeln IS NOT INITIAL .

lv_doc_no = is_billingdoc_header-vbeln.

IF is_billingdoc_header-kunrg IS NOT INITIAL.
lv_cusno = is_billingdoc_header-kunrg.
ELSE.
lv_cusno = is_billingdoc_header-kunag.
ENDIF.

CALL METHOD cl_swiss_qr_ref=>get_t049q_data
EXPORTING
iv_vkorg = is_billingdoc_header-vkorg
iv_bukrs = is_billingdoc_header-bukrs
iv_waerk = is_billingdoc_header-waerk
CHANGING
cs_t049q = ls_t049q.

CALL METHOD cl_swiss_qr_ref=>gen_reference_number
EXPORTING
iv_custno        = lv_cusno
iv_docno         = lv_doc_no
is_t049q         = ls_t049q
CHANGING
cv_qr_ref_number = lv_ref_num.

cv_qr_ref_number  = lv_ref_num.

CLEAR : lv_cusno,lv_doc_no,lv_cusno.
ENDIF.

ENDMETHOD.

 

Saving of the QR Reference in the Payment Reference field of Accounting Document will also allow usage of strategy IDFI_S_STR_2 in Bank Statement Processing (FF_5) which searches for Open Items based on Customer number (BSEG-KUNNR) and  Payment Reference (BSEG-KIDNO).

You are welcome to read more about QR-bill on SAP Help Portal.

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.