‎2006 Jan 04 2:44 PM
Hi All,
Is there a way of defining an 'Internal Table' without using 'Occurs n' specification.
Regards
‎2006 Jan 04 2:47 PM
‎2006 Jan 04 2:47 PM
‎2006 Jan 04 2:49 PM
‎2006 Jan 04 2:48 PM
Hi
You can write like thi....
TYPES: TYP_MARA TYPE STANDARD TABLE OF MARA.
DATA: T_MARA TYPE TYP_MARA.
Thanks,
Ramakrishna
Message was edited by: Ramakrishna Prasad
‎2006 Jan 04 2:51 PM
Yes U can declare an internal table without using Occurs n specification. Declare internal table of TYPES....Then declare internal table using this TYPES.
Below is a small code which will help U.
TYPES : BEGIN OF TY_VENDOR_MASTER,
FLAG TYPE C,
LIFNR TYPE LIFNR,
BUKRS TYPE BUKRS,
KTOKK TYPE KTOKK,
END OF TY_VENDOR_MASTER.
This is the TYPES internal table. Now declare internal table as
DATA : IT_VENDOR_MASTER TYPE STANDARD TABLE OF TY_VENDOR_MASTER.
This one u can use to store data which is fetched from database.
To use this internal table for other operations u have to use workarea...
DATA : WA_IT_VENDOR_MASTER TYPE TY_VENDOR_MASTER.
Hope this will be useful.
Pl. award appropriate points.
Is there a way of defining an 'Internal Table' without using 'Occurs n' specification.
‎2006 Jan 04 3:05 PM
Thanks Rich, Ramakrishna and Ramesh,
Thanks to all of you.
Rich, Is it better to use 'WITH HEADER LINE' option or 'WORK AREA' option from a Performance perspective.
Ramesh, Actually i used TYPE STANDARD TABLE OF statement for storing data. I then tried to use this internal table with 'FOR ALL ENTRIES IN it'. It gave me an error saying that the 'it' has not been declared using OCCURS.
Thanks to you guys.
Regards.
‎2006 Jan 04 3:14 PM
‎2006 Jan 04 2:59 PM
Hi George,
If you want to declare a internal table without a 'occurs n' you can do it only if you know an structure name.
For Eg.
You know there is database table called mara. If you want an internal table with the structure similar to mara then use...
data: it_mara like mara-matnr.
For your information if you write an itab without 'occurs n' it becomes a structure.
Hope it helps.
Regards,
Maheswaran.B