Skip to Content
avatar image
Former Member

smart forms

hai ,

in printing smart forms first we use 'ssf_function_module_name' and we import 'fm_name' function , but we can't calling' fm_name' from function module there was a message ' fm_name ' does not exist ...........

how can can we call the ' fm_name' into the program or creation of it am the fresher in smart form explain me with program.

thank you.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Sep 10, 2008 at 08:23 AM

    Hi,

    That FM_Name is varaible which is used in ssf_function_module_name.

    1) First call ssf_function_module_name, Use fm_name as export parameter

    2) Call function module which is generated through smartform

    3) replace Smartf form Function madule name with varaible u have used in ssf_function_module_name, Dont change import and export and table s and etc.

    If you have still doubt reply.

    Regards

    Janardhan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 10, 2008 at 09:23 AM

    Hi yoga raj,

    Fm_name is not a function module name. It is just a variable name. You can keep any name instead of fm_name, that name should be in the structure of RS38L_FNAM.

    Once u created one smartform it will generate one function module. That name can be found by pressing F8 key or by from menu bar. ENVIRONMENT -> Function Module Name.

    This function module name only want to be called in u r program.

    when u calling ssf_function_module_name, you want to pass the one variable with type RS38L_FNAM to this function module.

    the name of the function module in smartforms is assigned to this variable.

    after we want to call that smartforms function module and assign this variable name instead of that function module name

    DATA : any_name TYPE RS38L_FNAM.

    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

    EXPORTING

    FORMNAME = 'ZRP_SD_PACKINGLIST'

    VARIANT = ' '

    • DIRECT_CALL = ' '

    IMPORTING

    FM_NAME = any_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 any_name

    EXPORTING

    .....

    ......

    ......

    ...

    Regards,

    ragu

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 10, 2008 at 09:41 AM

    Hi yoga raj,

    Check this sample code:

    Tables:
      scarr.
    DATA:
      w_form TYPE  tdsfname,               " Form name
      w_nam TYPE rs38l_fnam,               " Name of the function module
      
    DATA:
      t_scarr like standard
       table of scarr,
          fs_scarr type scarr.
    START-OF-SELECTION.
    perform display_data.
    perform loop_data.
    
    &---------------------------------------------------------------------
    
    &      Form  display_data
    &---------------------------------------------------------------------
    
     This Subroutine display the details from scarr
    ---------------------------------------------------------------------*
      There are no interface parameters to be passed to this subroutine. *
    ---------------------------------------------------------------------*
    form display_data .
    
    select *
    from scarr
    into table  t_scarr.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname                = w_form
     IMPORTING
       FM_NAME                  = w_nam
     EXCEPTIONS
       NO_FORM                  = 1
       NO_FUNCTION_MODULE       = 2.
        IF sy-subrc NE 0.
        MESSAGE 'form cannot be displayed' TYPE 'E' .
      ENDIF.                              " IF sy-subrc eq 0
      endform.                             " display_data
    
    &---------------------------------------------------------------------
    
    &      Form  loop_data
    &---------------------------------------------------------------------
    
           text
    ---------------------------------------------------------------------*
      There are no interface parameters to be passed to this subroutine. *
    ---------------------------------------------------------------------*
    form loop_data .
    loop at t_scarr into fs_scarr.
    
    CALL FUNCTION '   '----> Give the smartform generated function module
    
      EXPORTING
        fs_scarr           = fs_scarr
     EXCEPTIONS
       FORMATTING_ERROR           = 1
       INTERNAL_ERROR             = 2
       SEND_ERROR                 = 3
       USER_CANCELED              = 4.
    
       endform.                               " loop_data

    Regards,

    Sravanthi

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 10, 2008 at 11:43 AM

    hi dear,

    this is the simplest method to have parameters for fm_name.

    go to your smartform and in menu bar go to Environment->function module name

    copy the name of that function module.

    now call this function module thru pattern in your program for smartfomr

    you get all the parametrs in your program now.

    change the name of function module to fm_name.

    use the parametrs u need.

    any ckarifications pls revert back.

    thnks.

    amit

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 10, 2008 at 12:08 PM

    Hi yogaraj,

    While calling the fm_name dont enclose it with quotes.

    So what i guess is, you have called like this;

    CALL FUNCTION 'fm_name'

    Dont give like that, use like below;

    CALL FUNCTION fm_name

    Regards

    Karthik D

    Add comment
    10|10000 characters needed characters exceeded