‎2007 Apr 18 2:16 PM
pls explain below :iam new to abap
1.data:begin of iab occurs 0
lifnr like lfa1-lifnr,
-
-
end of itab.
2.DATA:itab type kna1 occurs 0 with header line.
3.DATA: itab like standerd table of str with unique key.
‎2007 Apr 18 2:20 PM
Hi,
All are different ways of declaring internal tables
first one with just needed fields
second one with complete table fields
third one also like std table
so depending on your requirement you will be declaring and using the internal tables.
reward if useful
regards,
Anji
‎2007 Apr 18 2:23 PM
Hi
In the first scenario you can define more than one table fields in to an internal table.
Eg: Data: Begin of itab occurs 0,
lifnr like lfa1-lifnr,
kunnr like kna1-kunnr,
matnr like kna1-matnr,
text type c,
End of itab.
Like this you can define even variables in the internal table.
In the second scenario you can define one internal table with only one table. It means that one internal table can hold only one table records.
Regards
Haritha.
‎2007 Apr 18 2:25 PM
Hi,
Those nothing but internal table declarations. All are different ways of declaring internal tables.
First declaration is having just required fields.
Second one is having all the fields of the table kna1.
Third one is like std table kna1 having all the fields.
thanks,
sksingh
‎2007 Apr 18 2:26 PM
Hi,
1.data:begin of iab occurs 0
lifnr like lfa1-lifnr,
-
-
end of itab.
(this will be useful for including more than one data dictionary structure in an internal table and for incluuding some of the field in a data dictionary structure.)
2.DATA:itab type kna1 occurs 0 with header line.
(this will be useful incase of refering internaltable using only one data dictionary table)
rgds,
bharat.
‎2007 Apr 18 5:33 PM
All these are different ways of declaring internal tables.
1.data:begin of iab occurs 0
lifnr like lfa1-lifnr,
-
-
end of itab.
An internal table "itab" declaration,defining fields,
from one table or more than one table as required
and is with a header line.
The table is created with a header line - a field with
the same name as the table. Its type is the same as the
line type of the internal table.
2.DATA:itab type kna1 occurs 0 with header line.
An Internal table "itab" declaration, defining fields from table
'kna1', with a header line.The OCCURS value, determine the initial
number of table lines created.
The table is created with a header line - a field with
the same name as the table. Its type is the same as the
line type of the internal table.
3.DATA: itab like standerd table of str with unique key.
This should be:
data: itab like standard table of str with Default key with header line.
In the above case,
We cannot use the UNIQUE key addition with a standard table.
The key is always NON-UNIQUE by default.
An internal table "itab" declaration, defining fields from str and
is with header line.
The table is created with a header line - a field with
the same name as the table. Its type is the same as the
line type of the internal table.
Award points if useful.
Regds,
Ravi Sankara Kumar.