03-11-2009 2:38 AM
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.
03-11-2009 2:47 AM
make sure if the form is active, the FM will be generated only when you activate the form..
03-11-2009 2:47 AM
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.
03-11-2009 2:47 AM
make sure if the form is active, the FM will be generated only when you activate the form..
03-11-2009 4:00 AM
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.