cancel
Showing results for 
Search instead for 
Did you mean: 

Portugal - QR code in custom print program

0 Kudos

Hi all,

I am trying to realize th pront-out of the PT QR-code in a custom print-program according to the note 2981450 Cookbook for Customers 2.0.

The chapter "Calling the QR Code Class" gives an example for the coding. But that is not enough.

How can I "realize" this comments? To get this famous qrcode.

DATA ls_qrc_get_param TYPE cl_rdsv_qrcode=>qrcode_get_param.

DATA ls_qrc_object_pt TYPE cl_sipt_qrcode_pt=>source_object_pt.

DATA ls_get_status_param TYPE cl_sipt_pr_util=>doc_status_get_param.

DATA ls_qrc_result TYPE cl_rdsv_qrcode=>qrcode_output.

DATA lx_qrc_exc TYPE REF TO cx_rdsv_qrcode. DATA ls_qrcode TYPE sipt_s_invqrcode.

* Fill ls_qrc_object_pt in case the call uses source_object

* (and source type implements method GET_CONTENT_BY_OBJECT)

* The source type must implement one or both GET_CONTENT_BY_* methods

* Only the implemented methods can be called

TRY.

cl_rdsv_qrcode=>get_qrcode(

EXPORTING

get_param = ls_qrc_get_param

source_object = ls_qrc_object_pt

IMPORTING qrcode = ls_qrc_result ).

As I am not the great OO-programmer, I tried to look up for examples how to use the methods above.

It's clear: without content I won't get any QR code.

I can't call the method GET_CONTENT_BY_OBJECT_PT because it is protected.

Does anyone have an example or an advice?

We have SAP_BASIS 740/25 and SAP_APPL/SAP_FIN617/022

Thanks and best regards

Jörg

Accepted Solutions (0)

Answers (6)

Answers (6)

S0010925360
Participant
0 Kudos

I use this code in Smartforms. I think it could work in a SapScript also.

In case invoice is not digitally signed a short-dump will occur.

DATA: source_object_pt TYPE cl_sipt_qrcode_pt=>source_object_pt,
qrc_get_param TYPE cl_rdsv_qrcode=>qrcode_get_param,
source_object TYPE cl_rdsv_map_util_sd=>source_object_sd,
key TYPE cl_rdsv_map_util_sd=>keys_sd.

qrc_get_param-intca = 'PT'.
qrc_get_param-source_type = 'BILLING_DOCUMENT'.
key-vbeln = vbeln_vf.

SELECT SINGLE print_char
FROM sipt_vbrk
INTO @DATA(print_char)
WHERE vbeln = @key-vbeln.

IF print_char IS INITIAL.
RETURN.
ENDIF.

DATA(map) = NEW cl_sipt_map_qrc_pt_sd( ).

TRY.
map->if_rdsv_map_get~read_source_object( EXPORTING key = key
IMPORTING source_object = source_object ).

map->if_rdsv_map_get~map( EXPORTING source_object = source_object
IMPORTING target_object = source_object_pt ).

CATCH cx_rdsv_map INTO DATA(exc_map).
MESSAGE ID exc_map->if_t100_message~t100key-msgid
TYPE 'E'
NUMBER exc_map->if_t100_message~t100key-msgno
WITH exc_map->if_t100_message~t100key-attr1.
ENDTRY.

TRY.
cl_rdsv_qrcode=>get_qrcode( EXPORTING get_param = qrc_get_param
source_object = source_object_pt
IMPORTING qrcode = DATA(qrc_result) ).

CATCH cx_rdsv_qrcode INTO DATA(exc_qrc).
MESSAGE ID exc_qrc->if_t100_message~t100key-msgid
TYPE 'E'
NUMBER exc_qrc->if_t100_message~t100key-msgno
WITH exc_qrc->if_t100_message~t100key-attr1.
ENDTRY.

qrstring = condense( qrc_result-qrstring ).
0 Kudos

HI Jorge,

Can you please provide the entries for table RDSVI_QRC_CFG? It is blank in our system since we are doing it for first time.

denis_tailler
Member
0 Kudos

Hi Rohit,

I have this

0 Kudos

Good Morning,


Are there any news regarding this topic? Can anyone share the solution?


Thanks!

0 Kudos

Hi Nicola,

Can you please share with us how the problem is resolved n you case.

Regards

Rachid

0 Kudos

Hi Nicola,

how did you solve it?

I have the same problem with the old "SAPSCRIPT-world". The FC SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } RV_BILLING_PRINT_VIEW used to fill the structure INVOICE_S_PRT_INTERFACE/gs_interface, but it items are completely different from the items in the modern SOURCE_OBJECT_PT. So the method MAP_OBJECT_PT with its MOVE-CORRESPONDING has no effect.

I hoped to find a solution with the method read_source_object_by_key, but this method is empty. 😞

How can I do this mapping? Is there a method or a function code?

best regards

Jörg

zaipo
Explorer
0 Kudos

Hi all,

I've the same problem..

We still use old sapscripts,

Printing QR code works, with a sample content, but my problem is how to fill ls_qrc_object_pt.

I have the VBDKR struct on line.
I tried to call the BADI, as in SD_INVOICE_PRINT01 :


* BAdI
call badi bd_sd_bil->get_head_details
exporting
iv_language = gv_language
is_nast = nast
changing
cs_interface = gs_interface.

endif.

But it is not called correctly... GS_INTERFACE is empty.

Wich step I have to do to call this BADI correctly?

I know it's a topic already covered but I don't get out of it

Can someone give me a sample ?

zaipo
Explorer

SOLVED ..!

sashi_manthena
Discoverer
0 Kudos

Hi Jorg,
Check the print program SD_INVOICE_PRINT01 and navigate to BADI badi_sd_bil_print01 > implementations > SIPT_SD_BIL_IMPL01 > Implementing class > method GET_HEAD_DETAILS .. You will see the code how the required fields are populated. Since your scenario is custom, you need to implement the same logic into your print program. Or you can do a custom source type and write the code into those methods.

2981450_Cookbook_for_Customers_V2.0.pdf has information to do it and all required fields.

Thank you,
Sasi

0 Kudos

Hi Sashi,

As I am not very familiar with OO, this little sentence: "navigate to BADI ...." helped me a lot. Now I am shure about the right way to call this method.

The QR-code doesn't work yet, but the rest is only ABAP. I will publish my experiences and solutions under this topic.

Thanks

Jörg