Now create Project from Gateway Service Builder(SEGW).
Redefine the GET_STREAM method of DPC Extension class.
METHOD /iwbep/if_mgw_appl_srv_runtime~get_stream.
** Declaration
DATA :ls_key LIKE LINE OF it_key_tab,
gs_stream TYPE ty_s_media_resource.
DATA : lv_fm_name TYPE rs38l_fnam,
control_parameter TYPE ssfctrlop,
output_options TYPE ssfcompop,
lw_ssfcrescl TYPE ssfcrescl.
DATA : lt_otf TYPE TABLE OF itcoo,
lt_pdf_tab TYPE TABLE OF tline,
gv_bin_file TYPE xstring.
IF iv_entity_set_name = 'SFormSet'.
IF it_key_tab IS NOT INITIAL.
DATA(lv_sf_name) = CONV tdsfname( it_key_tab[ name = 'Fname' ]-value ).
* Get the smartform FM name
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = lv_sf_name
IMPORTING
fm_name = lv_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
RETURN.
ENDIF.
control_parameter-langu = 'EN'.
control_parameter-getotf = abap_true.
control_parameter-preview = space.
control_parameter-no_dialog = abap_true.
output_options-tddest = 'LOCL'.
output_options-xdfcmode = abap_true.
output_options-tdnewid = abap_true.
output_options-tdimmed = abap_true.
output_options-tdprinter = 'PDFUC'.
output_options-tddelete = space.
* call smartform fucntion mdoule
CALL FUNCTION lv_fm_name
EXPORTING
control_parameters = control_parameter
output_options = output_options
user_settings = 'X'
IMPORTING
job_output_info = lw_ssfcrescl
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
RETURN.
ENDIF.
REFRESH lt_otf[].
lt_otf[] = lw_ssfcrescl-otfdata[].
CLEAR : gv_bin_file.
* Convert OTF data to PDF
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_file = gv_bin_file
TABLES
otf = lt_otf
lines = lt_pdf_tab
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
IF sy-subrc <> 0.
RETURN.
ENDIF.
gs_stream-mime_type = 'application/pdf'.
gs_stream-value = gv_bin_file.
CALL METHOD me->copy_data_to_ref
EXPORTING
is_data = gs_stream
CHANGING
cr_data = er_stream.
ENDIF.
ENDIF.
ENDMETHOD.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
4 | |
4 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 |