Application Development and Automation 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: 
Read only

Calling a SmartForm

Former Member
0 Likes
624

Now that I created a SmartForm and I called the FM

"SSF_FUNCTION_MODULE_NAME",

How can I call my created Smartform.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
599

Hi Shaheen,

1. First call the below FM and pass the name of the Smart Form in Formname and :

DATA:
  w_fname TYPE rs38l_fnam.             " Form Name

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
      formname                 = 'SMART_FORM_NAME'
*     VARIANT                  = ' '
*     DIRECT_CALL              = ' '
    IMPORTING
      fm_name                  = w_fname
    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.
  ELSE.
*" Subroutine Call to Call the Smart Form .............................
    PERFORM call_smart_form.
  ENDIF.

2. Goto your SMART FORM, then go to ENVIRONMENT and click on FM name and copy the FM name.

3. Then in Driver Program click on Pattern and paste the FM name.

4. Then Replace the Name with w_fname (i.e. Import Parameter from First FM), as shown below:

CALL FUNCTION w_fname
  EXPORTING
*   ARCHIVE_INDEX              =
*   ARCHIVE_INDEX_TAB          =
*   ARCHIVE_PARAMETERS         =
*   CONTROL_PARAMETERS         =
*   MAIL_APPL_OBJ              =
*   MAIL_RECIPIENT             =
*   MAIL_SENDER                =
*   OUTPUT_OPTIONS             =
*   USER_SETTINGS              = 'X'
    p_vbeln                    = p_vbeln                         " User Parameter
* 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.

Refer Below Site for More Info:

http://www.saptechnical.com/Tips/SmartForms/FMImportance.htm

Regards,

Sunil.

4 REPLIES 4
Read only

Former Member
0 Likes
600

Hi Shaheen,

1. First call the below FM and pass the name of the Smart Form in Formname and :

DATA:
  w_fname TYPE rs38l_fnam.             " Form Name

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
      formname                 = 'SMART_FORM_NAME'
*     VARIANT                  = ' '
*     DIRECT_CALL              = ' '
    IMPORTING
      fm_name                  = w_fname
    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.
  ELSE.
*" Subroutine Call to Call the Smart Form .............................
    PERFORM call_smart_form.
  ENDIF.

2. Goto your SMART FORM, then go to ENVIRONMENT and click on FM name and copy the FM name.

3. Then in Driver Program click on Pattern and paste the FM name.

4. Then Replace the Name with w_fname (i.e. Import Parameter from First FM), as shown below:

CALL FUNCTION w_fname
  EXPORTING
*   ARCHIVE_INDEX              =
*   ARCHIVE_INDEX_TAB          =
*   ARCHIVE_PARAMETERS         =
*   CONTROL_PARAMETERS         =
*   MAIL_APPL_OBJ              =
*   MAIL_RECIPIENT             =
*   MAIL_SENDER                =
*   OUTPUT_OPTIONS             =
*   USER_SETTINGS              = 'X'
    p_vbeln                    = p_vbeln                         " User Parameter
* 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.

Refer Below Site for More Info:

http://www.saptechnical.com/Tips/SmartForms/FMImportance.htm

Regards,

Sunil.

Read only

Former Member
0 Likes
599

Yes thank you Sunil after this step how can I proceed.

Read only

0 Likes
599

Hi,

After coding, u just run the program. The Function Module

SSF_FUNCTION_MODULE_NAME captures the Function Module which is generated in the smartform and runs the smartform automatically.

U need to pass the parameter p_vbeln.

Generally the smart forms are runned by Function Module.

So we are capturing that function Module in our program and we are running the smartfrom from thr program.

Hope this helps...

Best regards,

raam

Read only

0 Likes
599

Hi Shaheen,

Refer to the Below Link and you will get whole Idea of the Working of this Procedure:

http://www.saptechnical.com/Tips/SmartForms/FMImportance.htm

Regards,

Sunil.