on 04-08-2008 4:06 AM
hi all,
what is the function module to pass the print partamets in smartforms.
Hi,
data: gst_control_parameters type ssfctrlop,
gst_output_options type ssfcompop,
gt_job_output_info type ssfcrescl,
gt_output_options type ssfcresop.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = gc_formname
formname = gp_layut
importing
fm_name = gv_fm_name
exceptions
no_form = 1
no_function_module = 2
others = 3.
if sy-subrc 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
gst_control_parameters-no_dialog = 'X'.
gst_control_parameters-getotf = 'X'.
gst_control_parameters-preview = 'X'. "Deactivate preview!
call function gv_fm_name
exporting
control_parameters = gst_control_parameters
output_options = gst_output_options
inv_header = gst_invheader
importing
job_output_info = gt_job_output_info
job_output_options = gt_output_options
tables
inv_data = gt_invitems
exceptions
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4.
if sy-subrc 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
for more information on parameters of FM[http://help.sap.com/saphelp_nw2004s/helpdata/en/71/9ccd9c8e0e11d4b608006094192fe3/frameset.htm]
Pls.reward if useful...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
the function module is SSF_FUNCTION_MODULE_NAME.
here is sample code....
in this vname is the function module which is generated when we execute the smartform.....it is declared as ...
vname type rs38l_fnam.
in the ssf_function_module_name...in exporting we need to pass the values which we want to pass ,from print program to form.
----
STRUCTURE DECLARATION
----
data : wa_lfa1 type z50875_lfa1,
wa_ekko type z50875_ekko,
wa_ekpo type z50875_ekpo,
it_ekpo type z50875it_ekpo,
vname type rs38l_fnam.
----
SELECTION-SCREEN
----
selection-screen begin of block b1 with frame title text-000.
parameter : p_no type ekko-ebeln obligatory.
selection-screen end of block b1.
at selection-screen on p_no.
perform validate.
----
START-OF-SELECTION
----
start-of-selection.
perform get_vendordata.
perform get_itemdata.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZMM_SMARTFORMS'
importing
fm_name = vname
exceptions
no_form = 1
no_function_module = 2
others = 3.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
call function vname
exporting
wa_lfa1 = wa_lfa1
wa_ekko = wa_ekko
wa_ekpo = wa_ekpo
tables
it_ekpo = it_ekpo
exceptions
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
others = 5.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
&----
*& Form GET_DATA
&----
form get_data .
select single ebeln lifnr
from ekko
into wa_ekko
where ebeln = p_no.
endform. " GET_DATA
&----
*& Form GET_VENDORDATA
&----
form get_vendordata .
select single lifnr name1 land1 ort01 regio
from lfa1
into wa_lfa1
where lifnr = wa_ekko-lifnr.
endform. " GET_VENDORDATA
&----
*& Form GET_ITEMDATA
&----
form get_itemdata .
select ebelp ematn aedat mtart netwr
from ekpo
into table it_ekpo
where ebeln = wa_ekko-ebeln.
endform. " GET_ITEMDATA
&----
*& Form validate
&----
form validate .
perform get_data.
if sy-subrc ne 0.
message 'PURCHASE DOCUMENT DOES NOT EXISTS' type 'E'.
exit.
endif.
endform. " validate
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.