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

Function module error

Former Member
0 Likes
766

To v_fm_name the function module name is passing but, its givng dump stating the v_fm_name is not avaiable in function library, i am calling this function module from SSF_FUNCTION_MODULE_NAME, can any one help me in this do i need create function module on name v_fm_name or anything else.

CALL FUNCTION 'V_FM_NAME'

EXPORTING

control_parameters = v_control_parameters

output_options = v_output_options

IMPORTING

document_output_info = st_ssfcrespd

job_output_info = st_ssfcrescl

job_output_options = st_ssfcresop

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.

ELSE.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
656

Remove the singlw quotes and check out if it works

CALL FUNCTION <b>V_FM_NAME</b>

5 REPLIES 5
Read only

Former Member
0 Likes
656

It(V_FM_NAME) should be given without quotes.

DATA: v_fm_name TYPE rs38l_fnam.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZSMARTFORM'

IMPORTING

fm_name = v_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 V_FM_NAME

EXPORTING

control_parameters = v_control_parameters

output_options = v_output_options

IMPORTING

document_output_info = st_ssfcrespd

job_output_info = st_ssfcrescl

job_output_options = st_ssfcresop

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.

ELSE.

Read only

Former Member
0 Likes
657

Remove the singlw quotes and check out if it works

CALL FUNCTION <b>V_FM_NAME</b>

Read only

0 Likes
656

The file is downloading to pc as pdf but the data is retriving but where i need to declare the internal table so that i can get display as output for the data here is my code.

&----


*& Include Z_PDF_CONVERSIONF *

&----


&----


*& Form f_validate_input

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM f_validate_input .

DATA: l_temp_ebeln(10) TYPE c .

*Checking if field is empty.

IF s_ebeln IS INITIAL.

MESSAGE i000(zcommon).

ENDIF.

*Checking whether purchase docuemnt no contains any character.

l_temp_ebeln = s_ebeln-low.

IF l_temp_ebeln+0(1) CA sy-abcde.

MESSAGE i001(zcommon).

ENDIF.

ENDFORM. " f_validate_input

&----


*& Form f_data_selection

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM f_data_selection .

CALL FUNCTION 'SSF_GET_DEVICE_TYPE'

EXPORTING

i_language = v_language

i_application = 'SAPDEFAULT'

IMPORTING

e_devtype = v_devtype

  • EXCEPTIONS

  • NO_LANGUAGE = 1

  • LANGUAGE_NOT_INSTALLED = 2

  • NO_DEVTYPE_FOUND = 3

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

*It gets the name of local printer.

v_output_options-tdprinter = v_devtype.

v_control_parameters-no_dialog = 'X'.

v_control_parameters-getotf = 'X'.

*Selecting data from the tables.

select ebeln from ekko into table i_ebeln where ebeln in s_ebeln.

.................GET SMARTFORM FUNCTION MODULE NAME.................

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = c_formname

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

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

...........................CALLING SMARTFORM............................

CALL FUNCTION V_FM_NAME

EXPORTING

control_parameters = v_control_parameters

output_options = v_output_options

IMPORTING

document_output_info = st_ssfcrespd

job_output_info = st_ssfcrescl

job_output_options = st_ssfcresop

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.

ELSE.

.........................CONVERT TO OTF TO PDF.......................

CALL FUNCTION 'CONVERT_OTF_2_PDF'

IMPORTING

bin_filesize = v_bin_filesize

TABLES

otf = st_ssfcrescl-otfdata

doctab_archive = i_docs

lines = i_line

EXCEPTIONS

err_conv_not_possible = 1

err_otf_mc_noendmarker = 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.

........................GET THE FILE NAME TO STORE....................

CONCATENATE 'smrt' '.pdf' INTO v_name.

CREATE OBJECT v_guiobj.

CALL METHOD v_guiobj->file_save_dialog

EXPORTING

default_extension = 'pdf'

default_file_name = v_name

file_filter = v_filter

CHANGING

filename = v_name

path = v_path

fullpath = v_fullpath

user_action = v_uact.

IF v_uact = v_guiobj->action_cancel.

EXIT.

ENDIF.

..................................DOWNLOAD AS FILE....................

MOVE v_fullpath TO v_filename.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

bin_filesize = v_bin_filesize

filename = v_filename

filetype = 'BIN'

TABLES

data_tab = i_line

EXCEPTIONS

file_write_error = 1

no_batch = 2

gui_refuse_filetransfer = 3

invalid_type = 4

no_authority = 5

unknown_error = 6

header_not_allowed = 7

separator_not_allowed = 8

filesize_not_allowed = 9

header_too_long = 10

dp_error_create = 11

dp_error_send = 12

dp_error_write = 13

unknown_dp_error = 14

access_denied = 15

dp_out_of_memory = 16

disk_full = 17

dp_timeout = 18

file_not_found = 19

dataprovider_exception = 20

control_flush_error = 21

OTHERS = 22.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDIF.

ENDFORM. " f_data_selection

Read only

Former Member
0 Likes
656

GIve without Quotes

you should also call the function SSF_FUNCTION_MODULE_NAME to get the

form name into v_fm_name.

call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = <Your smartform name> "In quotes

importing

fm_name = V_FM_NAME

exceptions

no_form = 1

no_function_module = 2

others = 3.

if sy-subrc = 0.

CALL FUNCTION V_FM_NAME

EXPORTING

control_parameters = v_control_parameters

endif.

Read only

Former Member
0 Likes
656

Hi,

Remove the quotes from V_FM_NAME it would work.

Thanks,

Prashanth