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

whats the functionality of this function module(SSF_FUNCTION_MODULE_NAME)

Former Member
0 Likes
1,347

hi everybody,

i m working on smartforms now, and i have seen some function module named SSF_FUNCTION_MODULE_NAME.could anybody tell me why we use this fm.

regards,

akmal

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,139

Whenever a smart form is activated function module is generated. This FM returns the name of the generated function module.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = '<form name>'

IMPORTING

FM_NAME = fm_name

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

When the form is activated, the system automatically generates an internal name for the function module. The function module SSF_FUNCTION_MODULE_NAME is used to derive the name of the generated function module. This internal name is stored in the variable FM_NAME in the coding. In this function the form name has to be passed as the export parameter.

The second call is to the function FN_NAME. The import and export parameters of the function module must be specified in the form interface.

The generated function module is thus called and populated with the corresponding data from the application.

I hope it helps.

Best Regards,

Vibha

*Please mark all the helpful answers

6 REPLIES 6
Read only

Former Member
0 Likes
1,140

Whenever a smart form is activated function module is generated. This FM returns the name of the generated function module.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = '<form name>'

IMPORTING

FM_NAME = fm_name

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

When the form is activated, the system automatically generates an internal name for the function module. The function module SSF_FUNCTION_MODULE_NAME is used to derive the name of the generated function module. This internal name is stored in the variable FM_NAME in the coding. In this function the form name has to be passed as the export parameter.

The second call is to the function FN_NAME. The import and export parameters of the function module must be specified in the form interface.

The generated function module is thus called and populated with the corresponding data from the application.

I hope it helps.

Best Regards,

Vibha

*Please mark all the helpful answers

Read only

Former Member
0 Likes
1,139

hi,

Check Programs SF_EXAMPLE_01, SF_EXAMPLE_02, SF_EXAMPLE_03. to know the purpose of usage .. and also ..

http://help.sap.com/saphelp_nw04/helpdata/en/1c/f40c5bddf311d3b574006094192fe3/content.htm

* print data
  call function 'SSF_FUNCTION_MODULE_NAME'
       exporting  formname           = p_form
*                 variant            = ' '
*                 direct_call        = ' '
       importing  fm_name            = fm_name
       exceptions no_form            = 1
                  no_function_module = 2
                  others             = 3.

  if sy-subrc <> 0.
*   error handling
    message id sy-msgid type sy-msgty number sy-msgno
            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    exit.
  endif.

Regards,

Santosh

Read only

Former Member
0 Likes
1,139
Read only

Former Member
0 Likes
1,139
Read only

Former Member
0 Likes
1,139

Hi akmal,

1. SMARTFORM <----


> Function Module

2. For Every smartform,

There is one Function Module (se37)

3. This FM, is GENERATED DYNAMICALLY,

and the name is also dynamic.

4. IT MEANS, that the FM name will Be DIFFERENT

in DEV, QA and PRD Server.

5. Hence, we CANNOT HARDCODE the fm name.

6. So, to fetch the FM name, given the smartform name,

this fm SSF_FUNCTION_MODULE_NAME is used.

7. After that, we call the FM dynamically,

with some specified/pre-defined format.

regards,

amit m.

Read only

Former Member
0 Likes
1,139

this Function Module is to find out the Function module generated for the Smartform

after calling this u will get the FM name in the fm_name and call the Fm

sample cod ei sgivend below

data : v_phone(10) type n.

v_po_no type ekpo-ebeln.

data it_itab type standard table of ekpo with header line.

parameters : po_no like v_po_no,

p_form type tdsfname.

data fm_name type rs38l_fnam.

select * from ekpo into table it_itab

where ebeln = po_no.

*'/1BCDWB/SF00000184'

call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = p_form

  • VARIANT = ' '

  • DIRECT_CALL = ' '

importing

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

call function fm_name

exporting

  • ARCHIVE_INDEX = ARCHIVE_INDEX

  • ARCHIVE_INDEX_TAB = ARCHIVE_INDEX_TAB

  • ARCHIVE_PARAMETERS = ARCHIVE_PARAMETERS

  • CONTROL_PARAMETERS = CONTROL_PARAMETERS

  • MAIL_APPL_OBJ = MAIL_APPL_OBJ

  • MAIL_RECIPIENT = MAIL_RECIPIENT

  • MAIL_SENDER = MAIL_SENDER

  • OUTPUT_OPTIONS = OUTPUT_OPTIONS

  • USER_SETTINGS = 'X'

date = sy-datum

phone = v_phone

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO = DOCUMENT_OUTPUT_INFO

  • JOB_OUTPUT_INFO = JOB_OUTPUT_INFO

  • JOB_OUTPUT_OPTIONS = JOB_OUTPUT_OPTIONS

tables

it_itab = it_itab

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.