cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform with a selection screen

Former Member
0 Kudos

Hi,

I need to create a smartform that has a selection screen to obtain material, lot number and the quantities and all the input details should be displayed onto the smartform output.

I have created a smartform and a report (with the selection screen details) for this, but how do I connect the report output to the smartform?

Please suggest.

Thanks,

Vishal.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

U need to use:

fm SSF_FUNCTION_MODULE_NAME in order to get the name of fm generated by smartforms

DATA: FM_NAME TYPE RS38L_FNAM,
      SF_NAME TYPE TDSFNAME.

 SF_NAME = <my smartform>.

  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
       EXPORTING
            FORMNAME           = SF_NAME
       IMPORTING
            FM_NAME            = FM_NAME
       EXCEPTIONS
            NO_FORM            = 1
            NO_FUNCTION_MODULE = 2
            OTHERS             = 3.
  IF SY-SUBRC <> 0.
    MESSAGE .....................
  ENDIF.

and then u call your smartform

CALL FUNCTION FM_NAME
           EXPORTING
*           ARCHIVE_INDEX              =
*           ARCHIVE_INDEX_TAB          =
*           ARCHIVE_PARAMETERS         = ARC_PARAMS
            CONTROL_PARAMETERS         = SSFCTRLOP
*           MAIL_APPL_OBJ              =
*           MAIL_RECIPIENT             =
*           MAIL_SENDER                =
*           OUTPUT_OPTIONS             =
*           USER_SETTINGS              = 'X'
...............................................

That means you need to hardcode the name of smartform (by variable SF_NAME).

Max

Answers (5)

Answers (5)

Former Member
0 Kudos
Former Member
0 Kudos

Hi,

When you activate a smart form it generates a " function module"

call that function module in the report using the " function module"

call function 'function_module_name'

and pass the data internal table

Regards,

Vijay

Former Member
0 Kudos

Hi,

first u call the below fm by passing the exporting & Importing Parameters.

data : l_c_form TYPE tdsfname,

l_f_fname TYPE tdsfname.

l_c_form = 'Z07M_FORM_MX18'. --->Smartform Name

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = l_c_form

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

fm_name = l_f_fname

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3

.

Now, u ill receive the Smartform FM name in l_f_name.

now call again that FM by passing required parameters.

CALL FUNCTION l_f_fname ---> calling Smartform Function Module

EXPORTING

archive_index = toa_dara

archive_parameters = arc_params

control_parameters = l_t_control

output_options = l_t_out

user_settings = space

p_langu = p_langu

TABLES

g_t_item = g_t_final

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

If u want to pass any Internal table data from ur program to smartform just pass in Tables like above (g_t_final). u should define g_t_item in smartform and g_t_final in ur program.

similarly for Exporting paramters, if u want to pass any structure or variable use Exporting parameters.

Hope its clear!!

Rgds,

Pavan

Former Member
0 Kudos

Hello,

Design the layout in smartform, how you want it to be. When executing the report, u will be calling the smartform, which it displays output.

You need to do all validation of getting data based on the selection screen inputs and pass it to the smartform.

For calling smartform, use funcation module SSF_FUNCTION_MODULE_NAME and pass the smart form name. In return you will be getting dynamic generated name, store it in vairable.

Write dynamic function module call CALL FUNCTION LV_FNAME. LV_FNAME stores the above return value. In dynamic function module you can pass the Data.

Refer forums, how to pass the data to dynamic function call.

Former Member
0 Kudos

Hi,

When you activate a smart form it generates a function module

call that function module in the report by following way

first call the function module

'SSF_FUNCTION_MODULE_NAME'

input: 'smart_form_name'

Output ; 'function_module_name' " this will be a variable

call function 'function_module_name'

and pass the data internal table

Regards

Krishna