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: 

Error Function module " " not found in Smartforms

Former Member
0 Kudos

Hi all,

Please help me out….

I created the form using the smartforms, check it and activated it. I can see the unique function module is assigned to the form. I wrote the ABAP program and use function module ‘SSF_FUNCTION_MODULE_NAME’and also define data types.

when I called the function module fm_name for passing values and tables from program to smartform. This is working perfectly in development server but in production it giving error like Function module " " not found.

Below I m pasting my code.

&----


*& Report ZCASHJOURNAL *

*& *

&----


*& *

*& *

&----


REPORT zcashjournal .

TABLES: bseg.

DATA: FM_NAME TYPE rs38l_fnam.

DATA:BEGIN OF it_bseg OCCURS 0.

INCLUDE STRUCTURE bseg.

DATA:END OF it_bseg.

DATA:BEGIN OF it_bseg1 OCCURS 0.

INCLUDE STRUCTURE bseg.

DATA:END OF it_bseg1.

DATA: gv_amt_in_words TYPE spell,

gv_word TYPE spell-word,

gv_decword TYPE spell-decword.

DATA:BEGIN OF gt_bkpf OCCURS 0.

INCLUDE STRUCTURE bkpf.

DATA:END OF gt_bkpf.

DATA:bktxt TYPE bktxt.

DATA:waers TYPE waers.

DATA:belnr TYPE belnr_d.

DATA:werks TYPE bukrs.

DATA:desc TYPE butxt.

DATA:awkey TYPE awkey.

DATA:docno TYPE matnr.

DATA:cajo TYPE awkey.

DATA:desc1 TYPE butxt.

DATA:dmbtr TYPE dmbtr.

SELECTION-SCREEN BEGIN OF BLOCK b2.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT (15) FOR FIELD s_belnr.

SELECTION-SCREEN POSITION 28 .

PARAMETERS : s_belnr TYPE bseg-belnr .

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT (15) FOR FIELD s_werks.

SELECTION-SCREEN POSITION 28 .

PARAMETERS: s_werks TYPE werks.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b2.

SELECT * FROM bkpf

INTO CORRESPONDING FIELDS OF TABLE gt_bkpf

WHERE belnr LIKE s_belnr

AND bukrs LIKE s_werks.

IF NOT gt_bkpf[] IS INITIAL.

SELECT * FROM bseg

INTO CORRESPONDING FIELDS OF TABLE it_bseg

FOR ALL ENTRIES IN gt_bkpf

WHERE bukrs EQ gt_bkpf-bukrs

AND belnr EQ gt_bkpf-belnr

AND shkzg EQ 'S'.

ENDIF.

LOOP AT gt_bkpf.

bktxt = gt_bkpf-bktxt.

waers = gt_bkpf-waers.

belnr = gt_bkpf-belnr.

werks = gt_bkpf-bukrs.

awkey = gt_bkpf-awkey.

docno = awkey+0(10).

cajo = awkey+10(4).

ENDLOOP.

LOOP AT it_bseg.

dmbtr = it_bseg-dmbtr.

ENDLOOP.

IF s_werks EQ '65'.

desc = 'JCBML - Heavy Equipments'.

ENDIF.

IF cajo EQ '0001'.

desc1 = 'PETTY CASH PLANT II'.

ENDIF.

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

amount = dmbtr

currency = waers

filler = space

language = sy-langu

IMPORTING

in_words = gv_amt_in_words

EXCEPTIONS

not_found = 1

too_large = 2

OTHERS = 3.

IF sy-subrc EQ 0.

MOVE : gv_amt_in_words-word TO gv_word,

gv_amt_in_words-decword TO gv_decword.

ENDIF.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZCASHRECPT'

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 'SSF_FUNCTION_MODULE_NAME'

  • EXPORTING formname = 'ZCASHRECPT'

    • variant = ' '

    • direct_call = ' '

  • IMPORTING fm_name = lf_fm_name

  • EXCEPTIONS no_form = 1

  • no_function_module = 2.

*

*v_vbeln = S_VBELN-low.

CALL FUNCTION FM_NAME

EXPORTING

bktxt = bktxt

waers = waers

belnr = belnr

werks = werks

desc = desc

docno = docno

cajo = cajo

desc1 = desc1

dmbtr = dmbtr

gv_word = gv_word

TABLES

T_ZDEB = it_bseg

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_member226234
Contributor
0 Kudos

Hi Rakesh,

This error occurs when the FM 'SSF_FUNCTION_MODULE_NAME' does not return the unique FM name. In the debugging, check if the FM name is returned from the FM 'SSF_FUNCTION_MODULE_NAME'. Check if the forms is activated in the required system or if the smartform has been renamed.

Regards,

Sandeep

7 REPLIES 7

Former Member
0 Kudos

Hi,

Check the following:

Has the activated SMARTFORM transported to PRDUCTION correctly from DEV.

Check it. May not be transported to PRD with all the relavent Texts etc, check whether it is active in PRD.

Because once the smartform is active, then this error should not occur.

reward if useful,

regards,

ANJI

former_member226234
Contributor
0 Kudos

Hi Rakesh,

This error occurs when the FM 'SSF_FUNCTION_MODULE_NAME' does not return the unique FM name. In the debugging, check if the FM name is returned from the FM 'SSF_FUNCTION_MODULE_NAME'. Check if the forms is activated in the required system or if the smartform has been renamed.

Regards,

Sandeep

0 Kudos

Hi Sandeep,

you are right FM 'SSF_FUNCTION_MODULE_NAME' does not return the unique FM name.i checked form is activated.what else i need to check..

regards,

Rakesh...

0 Kudos

Hi Rakesh,

In this case, i would check for the following.

1) Check if the smartform name is 'ZCASHRECPT' and has not been renamed.

2) Check if the form is active in the system

3) Execute the FM SSF_FUNCTION_MODULE_NAME in SE37 providing the

same inputs and check if the result is returned.

3) Ask a colleague to review it as i can assume and overlook the program

sometimes

There should be a very minor issue which is being overlooked.

Also, Uncomment the exceptions to get the actual error.

Please do let me know when the issue is resolved.

Regards,

Sandeep

0 Kudos

Hi Rakesh,

Also, you can execute the Smartform 'ZCASHRECPT' and get the FM name.

Hard code this FM name in your program and check if the program executes

perfectly.

Regards,

Sandeep

Former Member
0 Kudos

Hi rakesh,

Its only the request confusion . check that whether u have stored the print program also in the same request as the smartform . goto se09 just check out whether all objects are found in the request . may be this problem .

regards,

magesh

Former Member
0 Kudos

Hi Rakesh,

Check two things

1. Program tranpsorted to production without any error in request log.

2. Smartform tranpsorted to production without any error in request log and without renaming / misspelling it.


CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZCASHRECPT'
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.
*

Also try to uncomment the Message id part and it will show some meaningful message.

And to check whether actaually fucntion module is generated or not goto smartforms ->Smartform name -> Display -> Environment->Fucntion module name . if this is blank try to retransport smartform.

Hope that helps.

Regards

Kapadia

***Assigning points is the way to say thanks in SDN.***