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

Passing TABLES to Smartforms

Former Member
0 Likes
526

Good Morning,

I'm calling my SMARTFORM as follows:

      CALL FUNCTION func_mod_name
        EXPORTING
          control_parameters = w_ssfctrlop
          output_options     = w_out_options
          x_adrnr            = x_adrnr
          x_rcomp            = x_rcomp
          x_rzzvbund         = t_saldo-rzzvbund
          x_month            = p_period
          x_year             = p-ano
        IMPORTING
          job_output_info    = ls_job_output_info
        TABLES
          t_z3hfmbalance     = t_saldo_sf
        EXCEPTIONS
          formatting_error   = 1
          internal_error     = 2
          send_error         = 3
          user_canceled      = 4
          OTHERS             = 5.

TABLE t_z3hfmbalance is defined in the smartform interface this way

 T_Z3HFMBALANCE LIKE Z3HFMBALANCE

Z3HFMBALANCE is a structure i've created in SE11 with the same structure as t_saldo_sf.

The problem i have is, when running the program the system returns a ABAP Dump which states

<i>In the function module interface, you can specify only

fields of a specific type and length under "T_Z3HFMBALANCE".

Although the currently specified field

"T_SALDO_SF" is the correct type, its length is incorrect.</i>...

What am i doing wrong?

Best Regards,

Pedro Gaspar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
507

Hi Pedro,

In the form interface,

declare the table T_Z3HFMBALANCE with reference to table (not structure Z3HFMBALANCE) ,I think this wil solve your problem.

regards,

keerthi

Good Morning,

I'm calling my SMARTFORM as follows:

      CALL FUNCTION func_mod_name
        EXPORTING
          control_parameters = w_ssfctrlop
          output_options     = w_out_options
          x_adrnr            = x_adrnr
          x_rcomp            = x_rcomp
          x_rzzvbund         = t_saldo-rzzvbund
          x_month            = p_period
          x_year             = p-ano
        IMPORTING
          job_output_info    = ls_job_output_info
        TABLES
          t_z3hfmbalance     = t_saldo_sf
        EXCEPTIONS
          formatting_error   = 1
          internal_error     = 2
          send_error         = 3
          user_canceled      = 4
          OTHERS             = 5.

TABLE t_z3hfmbalance is defined in the smartform interface this way

 T_Z3HFMBALANCE LIKE Z3HFMBALANCE

Z3HFMBALANCE is a structure i've created in SE11 with the same structure as t_saldo_sf.

The problem i have is, when running the program the system returns a ABAP Dump which states

<i>In the function module interface, you can specify only

fields of a specific type and length under "T_Z3HFMBALANCE".

Although the currently specified field

"T_SALDO_SF" is the correct type, its length is incorrect.</i>...

What am i doing wrong?

Best Regards,

Pedro Gaspar

3 REPLIES 3
Read only

Former Member
0 Likes
508

Hi Pedro,

In the form interface,

declare the table T_Z3HFMBALANCE with reference to table (not structure Z3HFMBALANCE) ,I think this wil solve your problem.

regards,

keerthi

Read only

Former Member
0 Likes
507

Hi Ped,

I do also faced the same problem.

How I made changes:-

My Final internal table is t_final and am passing this internal into the smartform.

T_final is declared in print program as given below:-

t_final TYPE STANDARD TABLE OF zfinal_data,( "Z" Structure created )

CALL FUNCTION w_fmname

EXPORTING

w_header = w_header

w_adrc = w_adrc

w_adrc_forw = w_adrc_forw

w_adrc_comp = w_adrc_comp

TABLES

t_final = t_final

EXCEPTIONS "#EC *

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4.

Then in the FORM interface in "Tables" Tab

declare - t_final like zfinal_data...

Try this it may solve ur problem

regards

Avi...........

Read only

Former Member
0 Likes
507

hi

good

try to use the Z3HFMBALANCE in the place of t_saldo_sf,and see the difference i think there is some field length difference between these two structures and that may be the reason you r getting the dump.

Thanks

mrutyun^