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

error in calling function module

Former Member
0 Likes
1,756

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,327

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

5 REPLIES 5
Read only

former_member195383
Active Contributor
0 Likes
1,327

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.

Read only

Former Member
0 Likes
1,328

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

Read only

Former Member
0 Likes
1,327

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

Read only

Former Member
0 Likes
1,327

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

Read only

Former Member
0 Likes
1,327

Hi,

check the data types for the g_vbeln,l_vbeln, Both should be same

Regards

Pavan