2008 Jan 16 6:56 AM
Hi,
I want to declare an internal table or structure which has all the fields as in table scustom. how to go abt it?
2008 Jan 16 6:58 AM
Hi
DATA: itab like scustom occurs 0 with header line.
Cheers
Shakir
2008 Jan 16 6:58 AM
Hi
DATA: itab like scustom occurs 0 with header line.
Cheers
Shakir
2008 Jan 16 7:01 AM
Hi,
Types: begin of ty_itab,
matnr type mara-matrn,
.....
end of ty_itab.
or
types: begin of ty_itab.
include type mara.
types: end of ty-itab.
data: lt_itab type table of ty_itab.
data: wa_itab type ty_itab.
regards,
Santosh Thorat
2008 Jan 16 7:02 AM
2008 Jan 16 7:02 AM
Hi Chaitra,
Refer below statement :
DATA : ITAB TYPE STANDARDTABLE OCCURS 0 WITH HEADER LINE.
OR
DATA : BEGIN OF ITAB OCCURS 0.
INCLUDE STRUCTURE STANDARDTABLE
DATA : END OF ITAB
Regards,
Piyush
2008 Jan 16 7:02 AM
Hi,
Internal table:
data: itab TYPE TABLE OF mara WITH HEADER LINE.
Structure:
Data : wk TYPE mara.
2008 Jan 16 7:06 AM
Hi
Hope it will help you.
Standard table:
The key access to a standard table uses a sequential search. The time required for an access is linearly dependent on the number of entries in the internal table.
You should usually access a standard table with index operations.
Sorted table:
The table is always stored internally sorted by its key. Key access to a sorted table can therefore use a binary search. If the key is not unique, the entry with the lowest index is accessed. The time required for an access is logarithmically dependent on the number of entries in the internal table.
Index accesses to sorted tables are also allowed. You should usually access a sorted table using its key.
Hash table:
The table is internally managed with a hash procedure. All the entries must have a unique key. The time required for a key access is constant, that is it does not depend on the number of entries in the internal table.
You cannot access a hash table with an index. Accesses must use generic key operations (SORT, LOOP, etc.).
Hashed tables
This is the most appropriate type for any table where the main operation is key access. You cannot access a hashed table using its index.
The response time for key access remains constant, regardless of the number of table entries. Like database tables, hashed tables always
have a unique key. Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for
processing large amounts of data.
TYPES VECTOR TYPE HASHED TABLE OF I WITH UNIQUE KEY TABLE LINE.
TYPES: BEGIN OF LINE,
COLUMN1 TYPE I,
COLUMN2 TYPE I,
COLUMN3 TYPE I,
END OF LINE.
DATA ITAB TYPE HASHED TABLE OF SPFLI
WITH UNIQUE KEY CARRID CONNID.
reward if help.
2008 Jan 16 7:46 AM
Hi Chaitra,
You can declare the data as follows:
-
DATA: it_scustom LIKE TABLE OF scustom
WITH HEADER LINE.
-
Herer it_scustom will work both as internal table as well as structure.
ok teke care & try the code if necessary.