09-07-2007 7:19 AM
I have a code like this:
My purpose is to have a header in my excel summary report.
But there's an error like this:
"Field "gv_HEADING-TEXT" is unknown. It is neither in one of the
specified tables nor defined by a "DATA" statement. "DATA" statement."
sample code in my program:
data: gv_heading(10) type c.
gv_HEADING-TEXT = 'Company Code'.
append IT_HEADING.
gv_HEADING-TEXT = 'RFQ Number'.
append IT_HEADING.
gv_HEADING-TEXT = 'RFQ Line Item'.
append IT_HEADING.
call function 'GUI_DOWNLOAD'
exporting
FILENAME = L_FNAME
FILETYPE = 'DAT'
tables
DATA_TAB = IT_FINAL
FIELDNAMES = gv_HEADING
Please help me in solving this problem.
more points!!
09-07-2007 7:25 AM
Hi Salma,
" i missed the declaration in my previous post.
* Excel fieldname heading
data : begin of IT_HEADING occurs 0,
TEXT(15),
end of IT_HEADING.
IT_HEADING-TEXT = 'Company Code'.
append IT_HEADING.
IT_HEADING-TEXT = 'RFQ Number'.
append IT_HEADING.
IT_HEADING-TEXT = 'RFQ Line Item'.
append IT_HEADING.
call function 'GUI_DOWNLOAD'
exporting
FILENAME = L_FNAME
FILETYPE = 'DAT'
tables
DATA_TAB = IT_FINAL
FIELDNAMES = IT_HEADING
Regards
Gopi
09-07-2007 7:21 AM
data : begin of GV_HEADING occurs 0,
TEXT(15),
end of GV_HEADING.
Regards
Pratyusha
09-07-2007 7:25 AM
Hi Salma,
" i missed the declaration in my previous post.
* Excel fieldname heading
data : begin of IT_HEADING occurs 0,
TEXT(15),
end of IT_HEADING.
IT_HEADING-TEXT = 'Company Code'.
append IT_HEADING.
IT_HEADING-TEXT = 'RFQ Number'.
append IT_HEADING.
IT_HEADING-TEXT = 'RFQ Line Item'.
append IT_HEADING.
call function 'GUI_DOWNLOAD'
exporting
FILENAME = L_FNAME
FILETYPE = 'DAT'
tables
DATA_TAB = IT_FINAL
FIELDNAMES = IT_HEADING
Regards
Gopi
09-07-2007 7:40 AM
Thanks to all masters!!!
Especially to master gopi!!! It works!!
'till next questions...ehehe
09-07-2007 7:26 AM
Hi,
gv_HEADING is of type C.
and it dont have and components TEXT..
I think your It_heading is having the component TEXT..
Now define.
data gv_heading type <It_heading type> .. I.e you might have it_heading of some type declare thesame for gv_heading..
or
types: begin of ty_heading ,
text(200) type c,
end of ty_heading.
data gv_heading type ty_heading.
rewards if useful,
regards,
nazeer
09-07-2007 7:32 AM
hi,
declare gv_heading as a workarea and use it as
types: begin of gv_heading1
text(15) type c,
endof gv_heading1.
data: gv_heading type gv_heading1.
gv_HEADING-TEXT = 'Company Code'.
append IT_HEADING.
gv_HEADING-TEXT = 'RFQ Number'.
append IT_HEADING.
gv_HEADING-TEXT = 'RFQ Line Item'.
append IT_HEADING.
call function 'GUI_DOWNLOAD'
exporting
FILENAME = L_FNAME
FILETYPE = 'DAT'
tables
DATA_TAB = IT_FINAL
FIELDNAMES = gv_HEADING
if helpful reward some points.
with regards,
Suresh Aluri.