‎2009 Sep 15 9:24 AM
Hi all,
i am using the following code to call a smartform from the driver program .
data: l_vbeln type vbeln,
l_age(3) type c,
l_mahza type mahza.
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
g_vbeln = l_vbeln
g_age = l_age
g_mahza = l_mahza.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
P_FORM is my smartform name.
now when i execute this i am getting the dump as G_VBELN cannot Be changed. the dump shows the error is in calling the function FNAME.
in the smartform i have declared these 3 variables in form interface import parameters (g_vbeln,g_age,g_mahza).
please suggest me the changes which i have to do for getting rid of this problem
Edited by: seenukesavaraju on Sep 15, 2009 10:27 AM
‎2009 Sep 15 9:33 AM
Hi,
While using the form interface variables, don't use them directly in the smartforms because form interface variable, workareas and tables are read only (in ur case g_vbeln,g_age,g_mahza). Instead of that declare a global variable in the smartform of the same type and In the initiialization tab assign print parameter values to global fields and use them in the smartform. This case holds good when u are passing tables and work areas to smartforms from print program.
Revert back if u face any problem.
Regards,
Gautham Paspala
‎2009 Sep 15 9:33 AM
I can see two possible scenarios, which may be causing the error.
1. Please check in smartform, where you have declared the variables. You should declare them in
Global Setting --> Form interface
2. Also check, wheather the type of g_vbeln in smartform and l_vbeln in print program are same.
‎2009 Sep 15 9:33 AM
Hi,
While using the form interface variables, don't use them directly in the smartforms because form interface variable, workareas and tables are read only (in ur case g_vbeln,g_age,g_mahza). Instead of that declare a global variable in the smartform of the same type and In the initiialization tab assign print parameter values to global fields and use them in the smartform. This case holds good when u are passing tables and work areas to smartforms from print program.
Revert back if u face any problem.
Regards,
Gautham Paspala
‎2009 Sep 15 9:33 AM
Hi Dear,
you should declare I_vbeln as type VBELN_VA.
e.g.
data: l_vbeln type VBELN_VA,
Hope this resolve your issue.
Regards,
Vijay
‎2009 Sep 15 9:35 AM
hi
Check this
R u sure u r passing the data for vbeln?
fm_name TYPE rs38l_fnam.
vbeln having same data type in smartforms?
Thanks
‎2009 Sep 15 10:17 AM
Hi,
check the data types for the g_vbeln,l_vbeln, Both should be same
Regards
Pavan