Retrieve name of Function Module behind Smartform

Problem: you want to print Smartform in your own report and need to get the name of the Smartform’s function module.

Solution: what you need to do is call FM SSF_FUNCTION_MODULE_NAME with parameter FORMNAME containing name of the Smartform you want to print. In return parameter FM_NAME will contain the name of the Smartform’s Function Module.

  DATA:
    lv_smartforms_fm TYPE rs38l_fnam.
 
  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
      formname           = SMARTFORM_NAME
    IMPORTING
      fm_name            = lv_smartforms_fm
    EXCEPTIONS
      no_form            = 1
      no_function_module = 2
      OTHERS             = 3.
  DATA:
    lv_smartforms_fm TYPE rs38l_fnam.

  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
      formname           = SMARTFORM_NAME
    IMPORTING
      fm_name            = lv_smartforms_fm
    EXCEPTIONS
      no_form            = 1
      no_function_module = 2
      OTHERS             = 3.

Komentowanie jest zakończone.