‎2008 Jul 02 7:34 PM
I am getting the following error when I check some code:
E:"LT_TAB1" is a table without a header line and therefore has no component called "COMPONENT1".
I have defined the table as:
DATA: lt_tab1 type standard table of /BI0/Ptable initial size 0,
ls_tab1 type /BI0/Ptable.
It was originally defined as:
DATA: lt_tab1 LIKE /BI0/Ptable OCCURS 0,
ls_tab1 LIKE LINE OF lt_tab1.
But the second definition was giving an error otherwise.
Can someone advise? Thanks
‎2008 Jul 02 7:36 PM
Hello,
The table that you've declared doesn't have a header line like before. Instead you need to read it (using READ lt_tab1... INTO ls_tab1) or do a LOOP lt_tab1 ... INTO ls_tab1 to works with the data in this.
I suggest you to do not use the WITH HEADER LINE because this command has some restriction in ABAP Objects.
Extract from SAP Help
Note
These statements for processing individual table rows have short forms that implicitly use the header line as work area. These short forms are allowed only outside of ABAP Objects.
Regards.
‎2008 Jul 02 7:36 PM
Hello,
The table that you've declared doesn't have a header line like before. Instead you need to read it (using READ lt_tab1... INTO ls_tab1) or do a LOOP lt_tab1 ... INTO ls_tab1 to works with the data in this.
I suggest you to do not use the WITH HEADER LINE because this command has some restriction in ABAP Objects.
Extract from SAP Help
Note
These statements for processing individual table rows have short forms that implicitly use the header line as work area. These short forms are allowed only outside of ABAP Objects.
Regards.
‎2008 Jul 02 7:38 PM
You need to post more code, like specifically WHERE the error occurs.
Chance are you are using lt_tab1 where you should be using ls_tab1.
matt
‎2008 Jul 02 7:38 PM
Hi,
Try using the option 'WITH HEADER LINE' and see if it helps.
Rugmani.
‎2008 Jul 02 7:56 PM
Thanks for this. The work is part of SAP BI update rules. Where I have carried out the following in a start routine:
DATA: lt_tab1 type standard table of /BI0/Ptable initial size 0,
ls_tab1 type /BI0/Ptable
***********
REFRESH lt_tab1.
SELECT field1
FROM /BI0/Ptable
INTO TABLE lt_tab1
FOR ALL ENTRIES IN lt_other_table
WHERE field1 EQ lt_other_table-field1
AND OBJVERS EQ 'A'.
IF sy-subrc = 0.
SORT lt_tab1 BY field1 ASCENDING.
ENDIF.
I am not reading the table and will make modifications to do the same. Have awarded points