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

How to call smartforms from report program

Former Member
0 Likes
2,214

Hi,

Please help me, <b>how to call smartform from ABAP Report programm</b>. What are the function modules to be used in 4.6 version. It is very urgent apart my side. please kindly send an example also.

i will be thankfull to all.

by

satish U.

5 REPLIES 5
Read only

Former Member
0 Likes
687

Hi,

Use FM 'SSF_FUNCTION_MODULE_NAME'

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = 'ZBTINVOICE'

IMPORTING

FM_NAME = fm_name

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

Svetlin

Read only

former_member221770
Contributor
0 Likes
687

Hi Satish,

Yopu can use pass in your SMartForm Name into FM SSF_FUNCTION_MODULE_NAME to get the generated FM id.

eg.

data: l_fm type rs38l_fnam.

call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = 'ZSMARTFROM'

inporting

fm_name = l_fm.

call function l_fm

exporting.....

Hope this helps.

Cheers,

Pat

Read only

0 Likes
687

Hi,

Here is the sample.

data : v_form_name TYPE rs38l_fnam.

call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = 'ZZZ_TEST3'

importing

fm_name = v_form_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.

Better use the generated FM name in pattern in SE38 and replace the FM name by v_form_name and pass the required parameters.

CALL FUNCTION v_form_name

TABLES

itab_select = s_matnr

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.

Read only

0 Likes
687

Hi,

Once you activate the smartform then it will generate the function module dynamically.

In the smartforms goto Environment - > Function module name , It gives the function module name. you copy the FM name and call the function module in the program.

Once you familar with that then go for SSF_FUNCTION_MODULE_NAME ( this the one used to find out the above function module by using smart form name )

Cheers,

Sasi

Read only

Vinod_Chandran
Active Contributor
0 Likes
687

Hi Satish,

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

Vinod