cancel
Showing results for 
Search instead for 
Did you mean: 

How to call the program to the smartform

former_member384574
Active Participant
0 Kudos

Hello!!

I've a doubt doing my smartform, I don't know how to relation the program I've to use to the smartform... how to call the smartform through the program...

Can you help me?

Thanks a lot

Rebeca

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

Have a look on the following function module.

1.SSF_FUNCTION_MODULE_NAME

a) formname: exporting parameter to store the smartform name

b) fm_name : importing parameter to stores the function module of smartform

2.Copy the function module name and call this in driver program.

Regards,

Chandu

former_member384574
Active Participant
0 Kudos

Thanks everybody for your answers! Now this works perfectly!

Thanks a lot,

Regards,

Rebeca

Former Member
0 Kudos

Hi,

* determine smartform function module name
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    formname           = 'Z_TESTYH1055'
  IMPORTING
    fm_name            = lf_fm_name
  EXCEPTIONS
    no_form            = 1
    no_function_module = 2
    OTHERS             = 3.
IF sy-subrc <> 0.
 Write : 'Smart form name not recognised'.
ENDIF.

*Calling Function module generated by ssf call...
CALL FUNCTION lf_fm_name
 EXPORTING
*   ARCHIVE_INDEX              = ARCHIVE_INDEX
*   ARCHIVE_INDEX_TAB          = ARCHIVE_INDEX_TAB
*   ARCHIVE_PARAMETERS         = ARCHIVE_PARAMETERS
   control_parameters         = ls_control_param
*   MAIL_APPL_OBJ              = MAIL_APPL_OBJ
*   MAIL_RECIPIENT             = MAIL_RECIPIENT
*   MAIL_SENDER                = MAIL_SENDER
   output_options             = ls_composer_param
   user_settings              = 'X'
 IMPORTING
*   DOCUMENT_OUTPUT_INFO       = DOCUMENT_OUTPUT_INFO
   job_output_info            =  tab_otf_data
*   JOB_OUTPUT_OPTIONS         = JOB_OUTPUT_OPTIONS
 EXCEPTIONS
   formatting_error           = 1
   internal_error             = 2
   send_error                 = 3
   user_canceled              = 4
          .


IF sy-subrc <> 0.
  Write : 'Function module name not recognised'.
ENDIF.

Regards,

Nisrin

Former Member
0 Kudos

Hi,

Please find the sample code below to call a Smart Form from a driver Program.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'YH1054_DEMO1'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

fm_name = w_fname

EXCEPTIONS

no_form = 1

no_function_module = 2

.

Reward if found helpful.

Warm Regards,

R Adarsh

former_member705122
Active Contributor
0 Kudos
former_member181995
Active Contributor
0 Kudos

Rebeca,

we use SSF_FUNCTION_MODULE_NAME FM to link between program and form.

DATA l_func_mod_name TYPE rs38l_fnam.

   CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
     EXPORTING
       formname           = 'CPM_FORM_RISK'
     IMPORTING
       fm_name            = l_func_mod_name
     EXCEPTIONS
       no_form            = 1
       no_function_module = 2
       OTHERS             = 3.

Amit.