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

ALV report

Former Member
0 Likes
922

Hi,

I am working on an alv report.All the data which has to be displayed on the o/p is in gt_output table.

I have declared like this.

DATA: afield TYPE slis_fieldcat_alv,

yfield TYPE slis_t_fieldcat_alv.

DATA: l_count TYPE i.

  • company code

CLEAR afield.

l_count = l_count + 1.

afield-col_pos = l_count.

afield-tabname = gt_output.

afield-fieldname = 'RBUKRS'.

afield-ref_tabname = 'GLPCA'.

afield-key = 'X'.

APPEND afield TO yfield.

When I try to execute teh program it is giving error as 'The type of "afield-tabname" cannot be converted to the type of "GT_OUTPUT".

Can anyone tell me what would be the reason for this error?

Regards,

Hema

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
903
l_count = l_count + 1.
afield-col_pos = l_count.
afield-tabname = 'GT_OUTPUT'.  "gt_output.
afield-fieldname = 'RBUKRS'.
afield-ref_tabname = 'GLPCA'.
afield-key = 'X'.
APPEND afield TO yfield.

Hi,

I am working on an alv report.All the data which has to be displayed on the o/p is in gt_output table.

I have declared like this.

DATA: afield TYPE slis_fieldcat_alv,

yfield TYPE slis_t_fieldcat_alv.

DATA: l_count TYPE i.

  • company code

CLEAR afield.

l_count = l_count + 1.

afield-col_pos = l_count.

afield-tabname = gt_output.

afield-fieldname = 'RBUKRS'.

afield-ref_tabname = 'GLPCA'.

afield-key = 'X'.

APPEND afield TO yfield.

When I try to execute teh program it is giving error as 'The type of "afield-tabname" cannot be converted to the type of "GT_OUTPUT".

Can anyone tell me what would be the reason for this error?

Regards,

Hema

7 REPLIES 7
Read only

Former Member
0 Likes
904
l_count = l_count + 1.
afield-col_pos = l_count.
afield-tabname = 'GT_OUTPUT'.  "gt_output.
afield-fieldname = 'RBUKRS'.
afield-ref_tabname = 'GLPCA'.
afield-key = 'X'.
APPEND afield TO yfield.
Read only

Former Member
0 Likes
903

put gt_output within coutes and with caps letter....

Reward point if helpful

Read only

Former Member
0 Likes
903

keep that in Quotes and use CAPS.

afield-tabname = 'GT_OUTPUT'. "gt_output.

Read only

Former Member
0 Likes
903

GT_OUTPUT is the internal table. You have to write 'GT_OUTPUT', because you have to specify the table name.

Read only

Former Member
0 Likes
903

Hi,

you have to do like this

afield-tabname = 'GT_OUTPUT'.

Read only

Former Member
0 Likes
903

Dear Hema,

whatever you declare 'DATA: afield TYPE slis_fieldcat_alv,' this is reffers structureof slis_fieldcat_alv please convert this into internal table.

Thanks & Regards,

Murali..........

Read only

Former Member
0 Likes
903

Hi,Please put as below.

afield-tabname = 'GT_OUTPUT'.