Posted: Wed Mar 04, 2009 5:19 pm Post subject: SmartForm Printing
Version 1.0
Author WATTO
Source from: http: /www.watto.org/program/abap/download/Z_SMARTFORM_TEMPLATE_PRINT.abap
Description: A template program that runs a SmartForm and prints the output.
Code:
REPORT z_smartform_template_print.
DATA:
v_control_params TYPE ssfctrlop,
v_output_options TYPE ssfcompop,
v_output_info TYPE ssfcrescl.
PERFORM run_smartform
USING 'MYSMARTFORM'
v_control_params
v_output_options
CHANGING
v_output_info.
*---------------------------------------------------------------------*
* FORM setup_smartform_for_print
*---------------------------------------------------------------------*
* [+] Sets the parameters for PDF conversions
*---------------------------------------------------------------------*
FORM setup_smartform_for_print
USING
p_printr TYPE rspopname.
*---------------------------------------------------------------------*
* FORM run_smartform
*---------------------------------------------------------------------*
* [+] Runs the SmartForm of the given name
*---------------------------------------------------------------------*
FORM run_smartform
USING
p_form_name TYPE c
p_control_params TYPE ssfctrlop
p_output_options TYPE ssfcompop
CHANGING
p_output_info TYPE ssfcrescl.
DATA:
lv_function_name TYPE rs38l_fnam.
* Find the SmartForm function module name
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = p_form_name
IMPORTING
fm_name = lv_function_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 99.
IF sy-subrc <> 0.
EXIT.
ENDIF.
* Run the SmartForm function module
CALL FUNCTION p_form_name
EXPORTING
control_parameters = p_control_params
output_options = p_output_options
user_settings = ' '
IMPORTING
job_output_info = p_output_info
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 99.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.