‎2008 May 01 10:45 AM
Now that I created a SmartForm and I called the FM
"SSF_FUNCTION_MODULE_NAME",
How can I call my created Smartform.
‎2008 May 01 10:49 AM
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.
‎2008 May 01 10:49 AM
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.
‎2008 May 01 10:55 AM
‎2008 May 01 11:08 AM
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
‎2008 May 01 11:36 AM
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.