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

Problem in Call method

Former Member
0 Likes
766

Dear Experts

I m coding a ALV report using objects.

I hv collected all teh data into the internal table.

but when i write code as below it gives an error that statement is not accssible.

data: gr_table type ref to cl_salv_table.

call method cl_salv_table=>factory

IMPORTING

R_SALV_TABLE = gr_table

changing

t_table = i_faglflexa_open.

*... Display Table

gr_table->display( ).

Can any one help me in this issue.

Thanks in advance.

Regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
610

hi,

whenever you work with class try to create the objects as well calling the method inside the start of selection the class definition and implementation can come above it

try calling the method inside start of selection

hope this will surely help you!!!

Thanks & regards,

Punit Raval.

4 REPLIES 4
Read only

Former Member
0 Likes
611

hi,

whenever you work with class try to create the objects as well calling the method inside the start of selection the class definition and implementation can come above it

try calling the method inside start of selection

hope this will surely help you!!!

Thanks & regards,

Punit Raval.

Read only

0 Likes
610

Dear Punit

Thanks for ur reply .

i think ur suggestion wil lwork.

See, I hv declared type and then created an internal table of this type.

data : i_faglflexa_open type table of faglflexa

initial size 0 with header line.

data: gr_table type ref to cl_salv_table.

error msg: - i_faglflexa_open is not type compatible with formal parameter with t_faglflexa

Can u suggest something.

Regards

Read only

0 Likes
610

hi,

there are 2 ways of creating internal table ..

one is an outdated method which sap doesnt recommend any more and the other that you are using.

you have written the correct syntax the only thing is that in this format you dont have to specify the initial size ....

the syntax is :

DATA <itab> TYPE <type>|LIKE <obj> [WITH HEADER LINE].

also the outdated approach in that will use something like:

data : begin of <ittab> occurs n

end of <ittab>

donot specify the inital size 0 ....

also i believe that faglflexa may be a structured. if you have used a table type then write simply

data : <itab> type <internal type>

hope this will surely help you!!!

Thanks & Regards,

Punit Raval.

Read only

0 Likes
610

Get rid of the header line, or pass i_faglflexa_open[] as parameter.

You're sending your header line where the method requires a table.