‎2008 Nov 07 4:32 AM
Hi Experts,
I have a requirement in which I have to execute a Report in my function module,
Also, I have to show the smart form which is the output from the report in the FM export parameters.
Please give me your helpful suggestions.
Regards
Upendra Agrawal
‎2008 Nov 07 5:41 AM
Hi Upendra ,
You can call the Report from the FM using
submit zreport
with param1 = param11
and return.
Param1 is the passing parameter ... if u have any ...
You can get the smartform function module name from the SMARTFORM transaction second screen. Go to Environment -> Function module name. But you cannot straight away call this from your program because the function module name changes in other system when you transport. So the solution is to use the following logic.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = <- Smartform name
importing
fm_name = <- Function module name
exceptions
no_form = 1
no_function_module = 2
others = 3.
This function module will return the function module name of the smartforms.
Now call the smartform function module like this.
call function lf_fm_name
exporting
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
mail_appl_obj =
mail_recipient = ls_recipient
mail_sender = ls_sender
....
.....
'lf_fm_name' is the return from the 'SSF_FUNCTION_MODULE_NAME function module name.
Thanks
Renu
‎2008 Nov 07 5:10 AM
hi ,
u can use SUBMIT report and return ...
and then in that report can call the smartform FM ...
u can also try background processing and get the smartfrom in spool ,,
‎2008 Nov 07 5:13 AM
Hi Renu,
Thanks for the quick reply,
Can you please help me with some code example.
Regards
Upendra
‎2008 Nov 07 5:40 AM
So i suppose you have already written the code for the report which is calling the smartform.
See F1 help for SUBMIT or Search the Forum to get sample codes.
And and after calling the SSF_FUNCTION_MODULE_NAME in the report pass the FM name of the smartgorm to the export parameter of your FM and call that fm from the program calling your FM.
Regards
Karthik D
‎2008 Nov 07 5:41 AM
Hi Upendra ,
You can call the Report from the FM using
submit zreport
with param1 = param11
and return.
Param1 is the passing parameter ... if u have any ...
You can get the smartform function module name from the SMARTFORM transaction second screen. Go to Environment -> Function module name. But you cannot straight away call this from your program because the function module name changes in other system when you transport. So the solution is to use the following logic.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = <- Smartform name
importing
fm_name = <- Function module name
exceptions
no_form = 1
no_function_module = 2
others = 3.
This function module will return the function module name of the smartforms.
Now call the smartform function module like this.
call function lf_fm_name
exporting
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
mail_appl_obj =
mail_recipient = ls_recipient
mail_sender = ls_sender
....
.....
'lf_fm_name' is the return from the 'SSF_FUNCTION_MODULE_NAME function module name.
Thanks
Renu
‎2008 Nov 07 5:42 AM
Hi Upendra from top to bottom i will say..
First use fm SSF_FUNCTION_MODULE_NAME to trigger the smart form automatically use that in the report ....and using sumbit keyword in the fm source code call the events
Hope this will solve ur query
regards
sas