Application Development 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: 

No functional module exist error in smartforms

Former Member
0 Kudos

Hi to all experts,

getting an error that no function module exist for the smartforms. i have checked the smartform function module exist in se37. what could be the possible reasons for this error .

here is my code

DATA: fm_name TYPE RS38L_FNAM.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    formname                 = 'ZM_MM_PHYINVBC_SMARTFORM'

 IMPORTING
   FM_NAME                  = fm_name
 EXCEPTIONS
   NO_FORM                  = 1
   NO_FUNCTION_MODULE       = 2
   OTHERS                   = 3
          .
IF sy-subrc = 0.
CALL FUNCTION fm_name
* EXPORTING
*   ARCHIVE_INDEX              =
*   ARCHIVE_INDEX_TAB          =
*   ARCHIVE_PARAMETERS         =
*   CONTROL_PARAMETERS         =
*   MAIL_APPL_OBJ              =
*   MAIL_RECIPIENT             =
*   MAIL_SENDER                =
*   OUTPUT_OPTIONS             =
*   USER_SETTINGS              = 'X'
* IMPORTING
*   DOCUMENT_OUTPUT_INFO       =
*   JOB_OUTPUT_INFO            =
*   JOB_OUTPUT_OPTIONS         =
  TABLES
    it_final                   = ziseg[]
 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.

1 ACCEPTED SOLUTION

former_member156446
Active Contributor
0 Kudos

make sure if the form is active, the FM will be generated only when you activate the form..

3 REPLIES 3

Former Member
0 Kudos

Try to reactivate the smartform again and get the generated function module & try to use the generated function module from SE38. If it works fine then we can check in different way.

former_member156446
Active Contributor
0 Kudos

make sure if the form is active, the FM will be generated only when you activate the form..

aris_hidalgo
Contributor
0 Kudos

Below is my code in calling Smartforms and it works.


DATA: ls_control  TYPE ssfctrlop,                       "#EC NEEDED
          ls_options  TYPE ssfcompop.

    CONSTANTS: lc_formname TYPE tdsfname VALUE 'ZFI_GUI_INVOICE'.

    DATA: lv_fmname TYPE rs38l_fnam.

    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname                 = lc_formname
*       VARIANT                  = ' '
*       DIRECT_CALL              = ' '
     IMPORTING
       fm_name                  = lv_fmname
     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 lv_fmname
        EXPORTING
*          control_parameters = ls_control
          output_options     = ls_options
          user_settings      = 'X'
        TABLES
          im_output          = gt_output
        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.