How To Print PDF File Content From ABAP in Background
How To Print PDF File Content From ABAP in Background
How To Print PDF File Content From ABAP in Background
AT SELECTION-SCREEN.
lv_name = p_fname.
CALL METHOD cl_gui_frontend_services=>file_exist
EXPORTING
file = lv_name
RECEIVING
result = lv_result
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
MESSAGE 'Bad file!' TYPE 'E' DISPLAY LIKE 'S'.
ENDIF.
IF lv_result NE abap_true.
MESSAGE 'Bad file!' TYPE 'E' DISPLAY LIKE 'S'.
ENDIF.
START-OF-SELECTION.
END-OF-SELECTION.
PERFORM process.
FORM process.
lv_name = p_fname.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = lv_name
filetype = 'BIN'
IMPORTING
filelength = lv_size
CHANGING
data_tab = lt_file
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
MESSAGE 'Read file error!' TYPE 'E' DISPLAY LIKE 'S'.
ENDIF.
UNCTION zbap_rm_pdf_get_pages.
*"--------------------------------------------------------------------
--
*"*"Lokální rozhraní:
*" IMPORTING
*" REFERENCE(IV_CONTENT) TYPE XSTRING
*" EXPORTING
*" REFERENCE(EV_PAGES) TYPE I
*"--------------------------------------------------------------------
--
ev_pages = 0.
ENDFUNCTION.