Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Executing Report in a Funtion Module

Former Member
0 Likes
666

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
639

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

5 REPLIES 5
Read only

Former Member
0 Likes
639

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 ,,

Read only

0 Likes
639

Hi Renu,

Thanks for the quick reply,

Can you please help me with some code example.

Regards

Upendra

Read only

0 Likes
639

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

Read only

Former Member
0 Likes
640

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

Read only

Former Member
0 Likes
639

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