110 likes | 110 Views
Enroll now for SAP MM course at best SAP training and placement institute in Pune. Learn from industry experts and become an expert in SAP Material Management.<br>
E N D
How to create SAP ABAP Internal Tables: BY www.AspireIT.Net
What is Internal Table? SAP HANA is popularly referred to as an in-memory, columnar, relational databasemanagement system RDBMS, for storing and real-time operation of enormous volumes of data. SAP HANA Administration Training is being adopted a lot of by the enterprises that are observing differentiating their offerings with speed and real intelligence. This path-breaking technology is deployed on-premise and additionally on-cloud. This course meant for apt proficiency in administration, operation, and support of the in-memory platform – SAP HANA- whereas process high-volumes of data in the period of time. It includes each info administration and user management. However, info administrator can beware of most stuff like sound unit stops/begin performance standardization and keep a copy adminpart. www.AspireIT.Net
Data types of internal table The internal table is fully stated by line type, table and key type. Line type: The line type of an internal table can be any data type. The data type of an internal table is normally a structure. Each component of the structure is a column in the internal table. However, the line type may also be elementary or another internal table. Table type : In table type abap will access particular table entries. The internal tablesare three type – standard, sorted and hashed tables. You can create internal table as a database by using types statements. This statement use LIKE or TYPE clause to an existing table. The syntax to create internal table is: TYPES <internal_tab> TYPE|LIKE <internal_tab_type> OF <line_type_itab> WITH <key> INITIAL SIZE <size_number>. www.AspireIT.Net
What is work area? Work area is a single row of data. Work area is a variable declared with type of an database table. It can save only one file at time. It is like a structure declared in c. www.AspireIT.Net
There are two types of internal table: • Internal tables with HEADER lines • Internal table without HEADER lines • Internal Tables with Header Line • Here the system automatically creates the work area. • The work area has the same data type as internal table. • This work area is called the HEADER line. • It is here that all the changes or any of the action on the contents of the table are done. As a result of this, records can be directly inserted into the table or accessed from the internal table directly. www.AspireIT.Net
Internal Tables without Header Line • Here there is no work area associated with the table. • Work area is to be explicitly specified when we need to access such tables. • Hence these tables cannot be accessed directly. • Internal table is a temporary two dimensional memory structure similar to database table. We can store multiple files in internal table. • Work area is a variable declared with TYPE of a database table. It will store only one file at a time. www.AspireIT.Net
Create internal table: • Internal table with type statement • The Syntax is • Types : begin of line, • column1 type I, • column2 type I, • end of line. • By referring other table • You can create internal table with existing table. • Syntax : • Data <f> <type> [with header line]. www.AspireIT.Net
1) Append Data: By using append stmt you can add one line from other work area. • Syntax: APPEND [<wa> TO / INITIAL LINE TO] <itable>. • <wa> Here work area • The initial line is appended to the internal table • 2) Collect statement: • The COLLECT statement is used for populate internal table. Basically it used for inserting line to internal table with unique standard key. • Syntax: COLLECT [<wa> INTO] <itable>. • 3) Insert statement: Insert statement is used for adding lines to the internal table. We can use INDEX clause with insert statement for adding new lines. • Syntax: INSERT [<wa> INTO / INITIAL LINE INTO] <itable> [index <idx>]. • <wa> is work area • Initial line is inserted in to internal table <itable> at index <idx>. Populating internal tables: www.AspireIT.Net
The contents of one internal table can be copied to another by using the APPEND LINES or INSERT LINES statement. A more simpler way is to usetany of the following syntax's. MOVE <itab1> To <itab2>. OR <itab1> = <itab2>. Read Internal Tables 1) Using Loop -Endloop Syntax: LOOP AT <itable> [INTO <wa>] .............. ENDLOOP. the internal table ITABLE is read line by line. You can access the values of the columns for that line during any part of the LOOP-ENDLOOP structure. The value of the SY-SUBRC is set to 0, even if only one record is read. Copying Internal Tables www.AspireIT.Net
Using Read : • Syntax: • READ TABLE <itable> [INTO <wa>] INDEX <idx>. • This statement reads the current line or line as specified by index <idx>. The value of SY-TABIX is the index of the line read. If an entry with the specified index is found, then SY-SUBRC is set to 0. If the specified index is less than 0, then run-time error occurs. If the specified index exceeds table size then SY-SUBRC is set to 4. • Deleting internal tables: • Deleting lines in a loop: • Syntax: • DELETE <ITABLE>. www.AspireIT.Net
ThankYou • Click link in Description for free demo onSAP MM,DemoRegistration • Best IT Training & Placement Institute inPune • Online & Classroom training with 100 % Free PlacementAssistance • Visit our websitewww.aspireit.netor call us on9960965965/ 9960935600 Follow Us Email aspireerpsolution@gmail.com