‎2007 Oct 26 1:48 PM
hi gurus
i have detsiled functiuonality of this FM ssf_function _ module _name
what are the parameters passed to it in details
try to send ASAP
Regards
baskar
‎2007 Oct 26 1:49 PM
‎2007 Oct 26 1:50 PM
Say i have a program in which I have called the smartform in direct method by using the function module generated.
Now if I change that smartform so much, sometimes a new function module will be generated. or if I delete that smartform and create a new one with same name, a new function module will be generated. Then I need to go and change all programs that call this smartform directly.
In the two step process, it is not necessary. Everytime the function module related to a smart form changes, the SSF_FUNCTION_MODULE_NAME fetches the latest. So we dont need to update our report programs each time we manipulate the smartform
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.
Check this Smartforms steps document.
refer program....
data : v_phone(10) type n.
v_po_no type ekpo-ebeln.
data it_itab type standard table of ekpo with header line.
parameters : po_no like v_po_no,
p_form type tdsfname.
data fm_name type rs38l_fnam.
select * from ekpo into table it_itab
where ebeln = po_no.
*'/1BCDWB/SF00000184'
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = p_form
VARIANT = ' '
DIRECT_CALL = ' '
importing
fm_name = fm_name
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.
endif.
call function fm_name
exporting
ARCHIVE_INDEX = ARCHIVE_INDEX
ARCHIVE_INDEX_TAB = ARCHIVE_INDEX_TAB
ARCHIVE_PARAMETERS = ARCHIVE_PARAMETERS
CONTROL_PARAMETERS = CONTROL_PARAMETERS
MAIL_APPL_OBJ = MAIL_APPL_OBJ
MAIL_RECIPIENT = MAIL_RECIPIENT
MAIL_SENDER = MAIL_SENDER
OUTPUT_OPTIONS = OUTPUT_OPTIONS
USER_SETTINGS = 'X'
date = sy-datum
phone = v_phone
IMPORTING
DOCUMENT_OUTPUT_INFO = DOCUMENT_OUTPUT_INFO
JOB_OUTPUT_INFO = JOB_OUTPUT_INFO
JOB_OUTPUT_OPTIONS = JOB_OUTPUT_OPTIONS
tables
it_itab = it_itab
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.
‎2007 Oct 26 2:05 PM
hi
U just follow the link
u can get more information.
http://www.sapbrainsonline.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
Reward points if useful.
Thanks,
usha
‎2007 Oct 26 2:09 PM
Hi,
try this:
DATA: FM_NAME TYPE RS38L_FNAM.
*
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
Your formular
<b> FORMNAME = 'Z_TEST'</b>
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
CALL FUNCTION FM_NAME
EXPORTING
<b>* look in the FM via se37</b>
TABLES
<b>* look in the FM via se37</b>
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
*
Hope it helps.
Regards, Dieter
‎2007 Oct 26 2:09 PM
hi
some more info about that function module.
Integrating the Smart Form into the Application
Use
You trigger form printing by calling only two function modules. The first module uses the name of the form to determine the name of the generated function module. Then you call this module.
The name of the generated function module is unique only within one system.
Therefore, you must always call the function module first that uses the form name to determine the current name of the generated module.
Prerequisites
You defined the form interface in your form and activated the form.
Procedure
1. In the Form Builder call the function Environment -> Name of the function module and use STRG-Y and STRG-C to copy its name.
2. In the data retrieval program define a variable of type rs281_fnam for the name of the generated function module:
data fm_name type rs38l_fnam.
You can call the Smart Form in other parts of the application program as well.
However, in this case you must make sure that the system can access the data to be passed from that place. We recommend to encapsulate the data retrieval in a
function module as well.
3. If desired, you can call the function module SSF_FIELD_LIST. It returns a list of the form parameters actually used in the form. You can use this information to limit data selection, if necessary.
4. Call function module SSF_FUNCTION_MODULE_NAME. It returns the name of the generated
function module:
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.
5. Call the generated function module. To do this, use the Insert statement function for CALL FUNCTION in the ABAP Editor and use the name you copied in step 1. (to avoid having to copy all interface parameters manually). Then replace the function module name with the variable fm_name defined in step 2.
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.
In this example, three variables and an internal table are passed. The parameters
G_CARRID, G_CONNID, G_FLDATA, and GT_SBOOK have been defined before in the form interface.
6. In the interface pass all data you want to transfer to the form.
Result
The generated function module processes the form logic defined in the Smart Form. Its output is sent to the printer spool for processing.
As long as you do not change the form interface, you can make any changes to the form. When you activate it again, the system generates the current version of the form as soon as you call the function module. Only if you change the form interface, you must adapt the interface in the data.
Reward points if useful.
Thanks,
Usha