
Image 1- SPAD landing screen
Image 2- SPAD Page Format
Image 3- Create Page Format
Image 4- Save Page Format
Image 5 - SE73
Image 6 - New Barcode
Image 7 - New Barcode Setting
Image 8 - New Barcode Setting
Image 9 - New Barcode Setting
Image 10 - New Barcode Setting
Image 11 - Test Barcode From SE73
Image 12 - Execute Report
Image 13 - QR Code from SE73
Image 14 - Smartsyles
Image 15 - Smartform
Image 16 - Smartform Output
Image 17 - Class
METHOD display.
DATA :
lv_fm_name TYPE rs38l_fnam,
ls_output_options TYPE ssfcompop,
lv_language TYPE tdspras,
ls_control_parameters TYPE ssfctrlop,
ls_output_data TYPE ssfcrescl,
lv_pdf_len TYPE i,
lv_pdf_xstring TYPE xstring,
lt_lines TYPE TABLE OF tline,
lv_devtype TYPE rspoptype,
lt_tstotf TYPE tsfotf.
* language
lv_language = sy-langu.
TRANSLATE lv_language TO UPPER CASE.
ls_control_parameters-langu = lv_language.
* set control parameters to get the output text format (OTF) from Smart Forms
ls_control_parameters-no_dialog = 'X'.
ls_control_parameters-getotf = 'X'.
ls_control_parameters-preview = space. "No preview
* get device type from language
CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
EXPORTING
i_language = lv_language
* i_application = 'SAPDEFAULT'
IMPORTING
e_devtype = lv_devtype
EXCEPTIONS
no_language = 1
language_not_installed = 2
no_devtype_found = 3
system_error = 4
OTHERS = 5.
* set device type in output options
ls_output_options-tdprinter = lv_devtype.
* Set relevant output options
ls_output_options-tdnewid = 'X'. "Print parameters,
ls_output_options-tddelete = space. "Print parameters
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZQRDISPLAY' "Smartform name
IMPORTING
fm_name = lv_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
* Call Smartform generated FM
CALL FUNCTION lv_fm_name
EXPORTING
control_parameters = ls_control_parameters
output_options = ls_output_options
user_settings = space
gv_text = iv_barcode_data
IMPORTING
job_output_info = ls_output_data
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
APPEND LINES OF ls_output_data-otfdata[] TO lt_tstotf[].
* Convert to OTF
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = lv_pdf_len
bin_file = lv_pdf_xstring " binary file
TABLES
otf = lt_tstotf
lines = lt_lines
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
IF sy-subrc = 0.
rv_image_data = lv_pdf_xstring.
ENDIF.
ENDMETHOD.
Image 18 - Table
Image 19 - oData Service
Image 20 - oData Media Check
METHOD /iwbep/if_mgw_appl_srv_runtime~get_stream.
DATA:
lt_keys TYPE /iwbep/t_mgw_tech_pairs,
ls_key TYPE /iwbep/s_mgw_tech_pair,
lv_customer TYPE s_customer,
lv_xstring TYPE xstring,
ls_stream TYPE ty_s_media_resource.
lt_keys = io_tech_request_context->get_keys( ).
* docno is the specified key
READ TABLE lt_keys WITH KEY name = 'DOCNO' INTO ls_key.
IF sy-subrc IS INITIAL.
* We will convert field LINK as QR code
SELECT SINGLE link FROM zstoreqrdetails INTO @DATA(lv_link)
WHERE docno = @ls_key-value.
* Method display of Class zcl_qrcode will convert the data to QR to xstring
lv_xstring = zcl_qrcode=>display( iv_barcode_data = lv_link ).
ls_stream-value = lv_xstring.
ls_stream-mime_type = 'application/pdf'.
* Pass the QR's xstrinh back to oData
copy_data_to_ref( EXPORTING is_data = ls_stream
CHANGING cr_data = er_stream ).
ENDIF.
ENDMETHOD.
METHOD define.
DATA:
lo_entity TYPE REF TO /iwbep/if_mgw_odata_entity_typ,
lo_property TYPE REF TO /iwbep/if_mgw_odata_property.
super->define( ).
* QR_Detail is the entity name
lo_entity = model->get_entity_type( iv_entity_name = 'QR_Detail' ).
IF lo_entity IS BOUND.
* Field Link will be converted to media
lo_property = lo_entity->get_property( iv_property_name = 'Link' ).
lo_property->set_as_content_type( ).
ENDIF.
ENDMETHOD.
Image 21 - Metadata
/sap/opu/odata/sap/ZSHOW_QRINFO_SRV/QR_DetailSet('0001')/$value
Image 22 - Test1
/sap/opu/odata/sap/ZSHOW_QRINFO_SRV/QR_DetailSet('0002')/$value
Image 23 - Test2
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
7 | |
5 | |
4 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 |