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

Smart forms error

Former Member
0 Likes
909

Hi all,

When I am trying to use the function module SSF_FUNCTION_MODULE_NAME, it is giving a runtime error that the generated function module is not found.

please help me resolve this

This is the code i used:-

REPORT ZSSFFUNCTION.

DATA: fname TYPE rs38l_fnam.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = 'ZTESTINVOICE'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = FNAME

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 FNAME

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

INVOICE = '12345'

  • SALESORG =

  • DISTRIBUTION =

  • DIVISION =

  • DATE =

  • CUSTNO =

  • NAME =

  • CITY =

  • COUNTRY =

  • POSTALCODE =

ITEM = '12345'

  • MATNR =

  • DESC =

QUANTITY = '4'

NETVAL = '1000'

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

  • 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.

The error is Function Module FNAME is not found.

Edited by: Kartheek on Mar 3, 2008 8:31 PM

3 REPLIES 3
Read only

Former Member
0 Likes
530

Hello

Please check if the Form is in Active status .

Thanks

Praveen

Read only

0 Likes
530

yes, the form is active

Read only

0 Likes
530

Hi

Check this..declaration of l_f_fname

FORM call_smartform.

DATA : l_f_fname TYPE tdsfname,

l_t_control LIKE ssfctrlop,

l_t_out TYPE ssfcompop.

l_t_control-no_dialog = 'X' .

l_t_control-device = 'PRINTER'.

IF ok_code = 'GPRV'.

l_t_control-preview = 'X' .

ENDIF.

l_t_out-tdnewid = 'X' .

l_t_out-tddelete = ' ' .

l_t_out-tdimmed = 'X' .

l_t_out-tddest = p_prnter .

l_t_out-tddataset = 'SMART' .

l_t_out-tdcopies = '001' .

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = g_c_form

IMPORTING

fm_name = l_f_fname

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3.

IF sy-subrc <> 0.

CASE sy-subrc.

WHEN 1.

MESSAGE e004(ssfcomposer) WITH 'Z90VT_A030_01'.

WHEN 2.

MESSAGE e005(ssfcomposer) WITH 'Z90VT_A030_01'.

WHEN 3.

MESSAGE e003(ssfcomposer).

ENDCASE.

ELSE.

  • Passing the selected Data into another Table, Adjacent Duplicates

  • Deleted in The Smartform Call

g_t_formdata1[] = g_t_formdata[] .

CALL FUNCTION l_f_fname

EXPORTING

control_parameters = l_t_control

output_options = l_t_out

user_settings = ''

i_language = sy-langu

TABLES

g_t_data = g_t_formdata

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

IF sy-subrc <> 0.

CASE sy-subrc.

WHEN 1.

MESSAGE e602(ssfcomposer).

WHEN 2.

MESSAGE e001(ssfcomposer) WITH 'Z90VT_A030_01'.

WHEN 3.

MESSAGE e001(ssfcomposer) WITH 'Z90VT_A030_01'.

WHEN 4.

MESSAGE e012(ssfcomposer).

ENDCASE.

ENMDFORM call_smartform.

Hope it helps.