‎2005 Jun 16 6:42 AM
hi all
this is amit from gurgaon. i m a new enterant to this wide world of SAP field. i want to know abot internal table.
i expect awarm response from u expert guys.
‎2005 Jun 16 6:54 AM
Hi Amit,
Welcome to SAP and to SDN. Hope you find it irresistably interesting!!:-)
Here's the link which tells you all you need to know about internal tables -
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35de358411d1829f0000e829fbfe/frameset.htm
Regards,
Anand Mandalika.
‎2005 Jun 16 6:54 AM
‎2005 Jun 16 7:22 AM
Dear
Internal types are just like table which you see in Microsoft Word with heading for example
Empno ename job salary deptno
-
-
-
-
-
1 SMITH MANAGER 2000 10
2 WARD ANALYST 3000 20
3 ALLEN CLERK 1500 10
4 ZEESHAN PRESIDENT 5000 30
you can get data from tables and put it in internal table for future use. at run time the data i fetch from database into internal tables.
after that you get the data from internal table line by line and process it.
There are three table kinds:
- standard tables,
- sorted tables
- hashed tables
most of the time standard tables are used.
if you want to declare an internal table based on a database table the syntex would be like this
DATA itab_scarr type standard table of scarr.
here itab_scarr is an internal table and has the same columns which scarr table has.
now i will give you an example of internal table
DATA itab_scarr TYPE STANDARD TABLE OF scarr.
DATA wa_scarr TYPE scarr.
SELECT * FROM scarr
INTO TABLE itab_scarr.
LOOP AT itab_scarr INTO wa_scarr.
WRITE: / wa_scarr.
ENDLOOP.
-
second example
you can also define an internal table on the base of you own type for example
TYPES: BEGIN OF template,
a TYPE c,
b TYPE c,
c1 TYPE c,
END OF template.
DATA itab_template TYPE STANDARD TABLE OF template.
DATA wa_template TYPE template.
wa_template-a = 'A'.
wa_template-b = 'B'.
wa_template-c1 = 'C'.
APPEND wa_template TO itab_template.
wa_template-a = 'C'.
wa_template-b = 'E'.
wa_template-c1 = 'F'.
APPEND wa_template TO itab_template.
wa_template-a = 'G'.
wa_template-b = 'H'.
wa_template-c1 = 'I'.
APPEND wa_template TO itab_template.
LOOP AT itab_template INTO wa_template.
WRITE: / wa_template.
ENDLOOP.
here you find another type that is wa_template that only hold one line at a time you store the value into wa_template then append (insert at the end) it to internal table.
if you want to know the operations on internal table replay be back.
Rai
‎2005 Jun 16 9:20 AM