on 08-06-2008 2:40 PM
how to pass variable name to smartforms using F_NAME function
Thanks for answer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If you want to pass the variable to SSF_FUNCTION_MODULE_NAME then declare variable f_name of type RS38L_FNAM and pass the variable to the function module.
When you call the function module for the first time, call it using the function module name generated by the smartform and then replace the name with f_name. You cant directly use the f_name
If it passing variables to the smartform function module at runtime...
then declare variables in the form interface in the import parameters
When you call the function module in your driver program or execute it directly you can pass the variable name at the space provided at the interface of the function module
regards
padma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check the Below demo code, You will get to know he procedure-
Tables:
vbak.
select-options:
s_vbeln for vbak-vbeln.
Data:
w_fmname(30) type c.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'SMARTFORM1'
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
FM_NAME = w_fmname
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
.
CALL FUNCTION w_fmname
TABLES
t_select = s_vbeln
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
.
In the above code Select-options is passed through F_name function module.In the function call t_select is the structure of the same type of select-options.You can Pass parameter value also in the same way.Just you have to mention the Variable of the same time in the form interface of the Smartforms.
Regards,
Sujit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In the FM F_NAME, define parameters which are passed to smart forms in EXPORT parameter and TABLE parameters.
And the same time, you receive the same in IMPORT and TABLE parameters in the FORM INTERFACE.
In this way we can pass parameters.
Thanks,
Phani Diwakar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Data: lf_formname type tdsfname.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = <smartform name>
IMPORTING
fm_name = v_form_fm
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
Call Smartfrom to print the document
CALL FUNCTION v_form_fm
EXPORTING
p_compensation = p_comp <--parameter list
p_skill = p_skill
p_deci_auhtority = p_da
TABLES
s_job = s_job <--select option list
s_level = s_level
s_date = s_date
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sam write:how to pass variable name to smartforms using F_NAME function
im not able to see F_NAME fm in my system.i think it shoud be:
SSF_FUNCTION_MODULE_NAME
data: lf_formname type tdsfname.
all function 'SSF_FUNCTION_MODULE_NAME'
exporting formname = lf_formname"your smartform name
* variant = ' '
* direct_call = ' '
importing fm_name = lf_fm_name
exceptions no_form = 1
no_function_module = 2
others = 3.
call lf_fm_name
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Add your variables, which you want to pass in the FORM INTERFACE section of the Smartform.
Now, you need to include that newly created variable in your Smartform driver program.
Then best way to do it is:
In Smartforms transaction, open your smartform
Press the Test button.
Now, you will be on SE37 screen. Copy the FM name.
Go to your Driver program.
Use Pattern button. Select the Function Module and paste the name
Press Enter.
It will give you all the import / Export parameters from the FORM interface.
Now, you can change the name of the FM, with the FM variable (F_NAME).
Regards,
Naimesh Patel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
61 | |
9 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.