‎2008 Nov 26 12:32 PM
hi gurus,
please tell me i want to create smartform which can fetch data from its print program,please provide me examples. I have taken 1 ex from saptechnical.com for invoice printing in smartforms.
But there is one problem in form interface. in that in import parameter they hv defined IM_T_VBRK asy_ty_vbrk.this is table type. i have to define my table type. how to do that.
‎2008 Nov 26 12:55 PM
‎2008 Nov 26 12:55 PM
‎2008 Nov 26 1:00 PM
this code will help you:
DATA: ls_delivery_key TYPE leshp_delivery_key,
is_print_data_to_read TYPE ledlv_print_data_to_read.
DATA: ls_control_param TYPE ssfctrlop.
DATA: ls_composer_param TYPE ssfcompop.
DATA: ls_recipient TYPE swotobjid.
DATA: lf_formname TYPE tdsfname.
DATA: ls_sender TYPE swotobjid.
DATA: ls_addr_key LIKE addr_key.
DATA: document_output_info TYPE ssfcrespd,
job_output_info TYPE ssfcrescl,
job_output_options TYPE ssfcresop.
CONSTANTS: lc_5 TYPE char1 VALUE '5',
lc_2 TYPE char1 VALUE '2'.
PERFORM set_print_param USING addr_key
CHANGING ls_control_param
ls_composer_param
ls_recipient
ls_sender
retcode.
IF nast-nacha = lc_5 OR nast-nacha = lc_2.
IF ls_control_param-getotf IS INITIAL.
ls_control_param-getotf = gc_x.
ENDIF.
ENDIF.
*Get the Smart Form name.
IF NOT tnapr-sform IS INITIAL.
lf_formname = tnapr-sform.
ELSE.
MESSAGE e000(zsd) WITH text-001.
ENDIF.
CLEAR nast.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = lf_formname
IMPORTING
fm_name = gv_form
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc = 0.
CALL FUNCTION gv_form
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
mail_recipient = ls_recipient
mail_sender = ls_sender
output_options = ls_composer_param
user_settings = ' '
is_nast = nast
IMPORTING
document_output_info = document_output_info
job_output_info = job_output_info
job_output_options = job_output_options
TABLES
gi_mseg = gi_mseg
gi_makt = gi_makt
gi_t001w = gi_t001w
gi_rkwa = gi_rkwa
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.