Skip to Content
avatar image
Former Member

call function in driver program

Hi all,

I created one smartform and trying to assign it to a driver program and when I call the function module second time in SE38 and give the FM(number) generated then its throwing an error saying that' FM '' '' has been called'.

when I called the function module giving the number generated then I remove it and put 'fm_name'.

For all other forms I have done the same then what will be the problem wih this

Please answer

Thx

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Jul 16, 2009 at 10:21 AM

    Hi,

    Smartform generated FM is system dependent. it may be different when we transport to quality or production systems. so follow the below process:

    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

    EXPORTING formname = p_form -


    >Smartform Name
    • variant = ' '

    • direct_call = ' '

    IMPORTING fm_name = fm_name -


    > U ill get the Smartform Function Module Name.

    EXCEPTIONS no_form = 1

    no_function_module = 2

    OTHERS = 3.

    Now, u call the Smartform Function Module dynamically..

    CALL FUNCTION fm_name

    EXPORTING

    control_parameters = l_t_control

    output_options = l_t_out

    user_settings = space

    customer = customer

    bookings = bookings

    connections = connections

    EXCEPTIONS

    formatting_error = 1

    internal_error = 2

    send_error = 3

    user_canceled = 4

    OTHERS = 5.

    Hope it helps!!

    Rgds,

    Pavan

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Did you define customer ,bookings and connections in your smarform?

      I guess, u have not defined them in Form Interface Importing Parameters of the smartform.

      Rgds,

      Pavan

  • avatar image
    Former Member
    Jul 16, 2009 at 11:21 AM

    hi,

    you will face problem after transported to PRD, because in PRD the smartform generates different functionmodule.

    follow this.

    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = lf_formname
    importing
    fm_name = v_form_name
    exceptions
    no_form = 1
    no_function_module = 2
    others = 3.
      IF sy-subrc <> 0.
    *  error handling
        ent_retco = sy-subrc.
        IF sy-subrc = 1.
          MESSAGE e001(ssfcomposer).
        ENDIF.
        IF sy-subrc = 2.
          MESSAGE e002(ssfcomposer) WITH tnapr-sform.
        ENDIF.
        PERFORM protocol_update_i.
      ENDIF.
    
    if ls_control_param-preview is not initial.
      clear ls_control_param-getotf.
    *********************Preview*****************************
      CALL FUNCTION v_form_name
        EXPORTING
          archive_index      = toa_dara
          archive_parameters = arc_params
          control_parameters = ls_control_param
          mail_recipient     = ls_recipient
          mail_sender        = ls_sender
          output_options     = ls_composer_param
          is_ekko            = l_doc-xekko
          user_settings      = ' '"iv_user_settings  "Disable User Printer
          is_pekko           = l_doc-xpekko
          is_nast            = l_nast
          iv_from_mem        = l_from_memory
          iv_druvo           = iv_druvo
          iv_xfz             = iv_xfz
        IMPORTING
          JOB_OUTPUT_INFO    = w_return
          EV_ADDNR_VENDOR    = IV_ADDNR_VENDOR
        TABLES
          it_ekpo            = l_doc-xekpo[]
          it_ekpa            = l_doc-xekpa[]
          it_pekpo           = l_doc-xpekpo[]
          it_eket            = l_doc-xeket[]
          it_tkomv           = l_doc-xtkomv[]
          it_ekkn            = l_doc-xekkn[]
          it_ekek            = l_doc-xekek[]
          it_komk            = l_xkomk[]
        EXCEPTIONS
          formatting_error   = 1
          internal_error     = 2
          send_error         = 3
          user_canceled      = 4
          OTHERS             = 5. 

    Add comment
    10|10000 characters needed characters exceeded