‎2022 Jan 04 7:59 PM
Hello,
i did custom container in html viewer(CL_GUI_HTML_VIEWER). I want do multiple pages for output viewer. I could not make it. i wait for help. i add attached a pictures for program. thx everyone.
*&---------------------------------------------------------------------*
*& Form create_form
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*
FORM create_form .
IF cc_form IS NOT BOUND.
* IF cc_form IS INITIAL.
CREATE OBJECT cc_form
EXPORTING
container_name = 'CC_FORM'.
* ENDIF.
CREATE OBJECT html_viewer
EXPORTING
parent = cc_form.
ELSE.
ENDIF.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form create_ssf
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*
FORM create_ssf .
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZCO_HR_DENEM_SURESI'
IMPORTING
fm_name = gv_fm_name.
"Get smartform function module name
"create PDF Viewer object
CLEAR gs_selected.
LOOP AT gt_selected INTO gs_selected.
wa_control_par-no_dialog = 'X'.
wa_control_par-getotf = 'X'.
wa_output_options-tddest = 'ZPFD2'.
wa_output_options-tdgroup = 'X'.
lv_tckn = gs_selected-merni.
lv_ename = gs_selected-ename.
lv_pernr = gs_selected-pernr.
CALL FUNCTION gv_fm_name
EXPORTING
control_parameters = wa_control_par
output_options = wa_output_options
lv_tckn = lv_tckn
lv_pernr = lv_pernr
lv_ename = lv_ename
IMPORTING
job_output_info = wa_job_output_info
TABLES
tab_it0002 = it_it0002
tab_it0008 = it_it0008
itab = gt_selected.
ENDLOOP.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form display_pdf
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*
FORM display_pdf .
it_otf_data = wa_job_output_info-otfdata.
"Convert OTF data to PDF
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = gv_bin_filesize
TABLES
otf = it_otf_data
lines = it_pdf.
LOOP AT it_pdf INTO wa_pdf.
ASSIGN wa_pdf TO <fs_pdf> CASTING.
CONCATENATE gv_content <fs_pdf> INTO gv_content IN BYTE MODE.
ENDLOOP.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = gv_content
TABLES
binary_tab = it_data.
" Load the HTML
CALL METHOD html_viewer->load_data(
EXPORTING
type = 'application'
subtype = 'pdf'
IMPORTING
assigned_url = gv_url
CHANGING
data_table = it_data ).
IF sy-subrc <> 0.
WRITE:/ 'ERROR: CONTROL->LOAD_DATA'.
EXIT.
ENDIF.
"Show it
CALL METHOD html_viewer->show_url( url = gv_url in_place = 'X').
IF sy-subrc <> 0.
WRITE:/ 'ERROR: CONTROL->SHOW_DATA'.
EXIT.
ENDIF.
" DISPLAY_PDF OUTPUT
ENDFORM.

‎2022 Jan 04 9:08 PM
If you display a PDF via the HTML Viewer, you can view all the pages. I don't get what your issue is.
‎2022 Jan 05 5:31 AM
For example: I'm selecting three lines on alv. I expect the number of page output to be three. However, only the first page image is generated.
‎2022 Jan 05 5:36 AM
I did a loop before going to ''CALL FUNCTION gv_fm_name" But again not working.
‎2022 Jan 05 9:39 PM
‎2022 Jan 06 8:04 PM
Do you give a code example for container in adobe PDF. Because i just couldn't do it.
‎2022 Jan 06 3:32 PM
In fact your question is not about CL_GUI_HTML_VIEWER, it's about how you assemble multiple smart forms into one PDF. You must OPEN for only the first smart form, and CLOSE only when you generate the last smart form.
‎2022 Jan 06 3:33 PM
(fields NO_OPEN and NO_CLOSE of parameter CONTROL_PARAMETERS)
‎2022 Jan 06 8:26 PM
okay. For alternative, How to do adobe form in custom container?
Thank you