cancel
Showing results for 
Search instead for 
Did you mean: 

How to call smartform FM after using SSF_FUNCTION_MODULE_NAME?

Former Member
0 Kudos

Hi Experts,

How to call smartform FM after using SSF_FUNCTION_MODULE_NAME?

I mean, in driver program i called SSF_FUNCTION_MODULE_NAME to get the related FM for my smart form. after that How do I call it(smartform fm) . I tried to call by pressing PATTERN button in Report. but it is showing FM is not exist error.

Call function SSF_FUNCTION_MODULE_NAME

Export

formname = 'zsmartform'

import

fm_name = function_name.

function_name is stored the corresponding smartform fm. then How do i call it to process my smartform?

thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

former_member196280
Active Contributor

Do it like this...

copy the function module name from Smartform, environment--> function module name

Use pattern and paste the copied function module name.

Now, replace Call function function_name "<b>SSF_FUNCTION_MODULE_NAME</b>

Reward points to all useful answes.

Regards,

SaiRam

Message was edited by:

Sai Ram Reddy Neelapu

Former Member
0 Kudos

Hi Sai Ram,

just read my question properly. using ssf_function_module_name . i will get the related fm for my smartform. after that i do i call either manually or automaticalaly.

thanks

former_member188827
Active Contributor
0 Kudos

when u get ur fm name u'll have to call that using another call function statement...

let me kno if dere is still any confusion...

raymond_giuseppi
Active Contributor
0 Kudos

Look at <a href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRSF/BCSRVSCRSF.pdf">SAP Smart Forms (BC-SRV-SCR)</a>

Sample :

 CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
       EXPORTING
            formname           = '<form name>'
       IMPORTING
            fm_name            = fm_name
       EXCEPTIONS
            no_form            = 1
            no_function_module = 2
            OTHERS             = 3.
  IF sy-subrc <> 0.
*    <error handling>
  ENDIF.

  CALL FUNCTION fm_name
    EXPORTING
*     ARCHIVE_INDEX =
*     ARCHIVE_PARAMETERS =
*     CONTROL_PARAMETERS =
*     MAIL_APPL_OBJ =
*     MAIL_RECIPIENT =
*     MAIL_SENDER =
*     OUTPUT_OPTIONS =
*     USER_SETTINGS = 'X'
    g_carrid = <variable>
    g_connid = <variable>
    g_fldate = <variable>
*   IMPORTING
*     DOCUMENT_OUTPUT_INFO =
*     JOB_OUTPUT_INFO =
*     JOB_OUTPUT_OPTIONS =
    TABLES
      gt_sbook = <internal table>
    EXCEPTIONS
      formatting_error = 1
      internal_error = 2
      send_error = 3
      user_canceled = 4
      OTHERS = 5.
  IF sy-subrc <> 0.
*      <error handling>
  ENDIF.

Regards

former_member196280
Active Contributor
0 Kudos

do call it manually and remove the function module name and replace with the variable where function module name is stored. As told above.

Regards,

SaiRam

Former Member
0 Kudos

Hi

Run trx SMARTFORMS and press test icon, here you'll be in SE37, copy the function name and go to your program.

Here press PATTERN and past the function name generated by smartform.

In this way you'll insert in your program the call of the smartform:

CALL FUNCTION '/1BCDWB/SF00000003'
    EXPORTING
*     ARCHIVE_INDEX              =
*     ARCHIVE_INDEX_TAB          =
*     ARCHIVE_PARAMETERS         =
*     CONTROL_PARAMETERS         =
*     MAIL_APPL_OBJ              =
*     MAIL_RECIPIENT             =
*     MAIL_SENDER                =
*     OUTPUT_OPTIONS             =
*     USER_SETTINGS              = 'X'
      .................................

and after replace the name of fm of smartform with the variable function_name:

CALL FUNCTION function_name
    EXPORTING
*     ARCHIVE_INDEX              =
*     ARCHIVE_INDEX_TAB          =
*     ARCHIVE_PARAMETERS         =
*     CONTROL_PARAMETERS         =
*     MAIL_APPL_OBJ              =
*     MAIL_RECIPIENT             =
*     MAIL_SENDER                =
*     OUTPUT_OPTIONS             =
*     USER_SETTINGS              = 'X'
      .................................

Max

Answers (2)

Answers (2)

Former Member
0 Kudos

hi,

Chk this sample.

DATA: p_output_options TYPE ssfcompop, "occurs 0 with header line
p_control_parameters TYPE ssfctrlop. "occurs 0 with header line

p_output_options-TDCOPIES = 3. "number of copies.
p_output_options-tddest = 'LP01'. "def


p_control_parameters-no_dialog = 'X'. "no dilog box
p_control_parameters-preview = 'X'. "no preview


DATA : v_form_name TYPE rs38l_fnam.

*---- Function to get the function module name of the    ----
*---- specified Smart form.                              ----


CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'GIVE YOUR SMART FORM NAME'    
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
fm_name = v_form_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3 .

*---- Function Module to call the Smart Form          ----


*step 1 - go to ur smart form
*step2 - take environment
*step3-take function module name
*copy that unique number.
*step4 -come back to ur driver program.
*step5 - place ur cursur here. take patter,.give that unique number.
*at that time u will get the below code.
*step6 - rename that unique number with 'v_form_name' in the code generated by pattern.

CALL FUNCTION v_form_name
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_PARAMETERS =
control_parameters = p_control_parameters
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
output_options = p_output_options
user_settings = ' '
* ARCHIVE_INDEX_TAB =
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
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.

for any clarifiaction pls revert.

regards,

Reshma

Former Member
0 Kudos

Thanks experts,

I cleared and rewarded marks according to answers

former_member188827
Active Contributor
0 Kudos

use after ssf_function_module call:

call function function_name

providing import and export parameters

Message was edited by:

abapuser