Saturday, July 18, 2015

Standard Internal Table

Standard table is an index table which has non-unique key. It can be accessed by index or key also. If we want to access by key then the key must be defined otherwise default key would be considered. The declaration is as follows:

DATA: it_mat TYPE STANDARD TABLE OF ty_mat WITH NON-UNIQUE KEY matnr.
OR
DATA: it_mat TYPE TABLE OF ty_mat WITH NON-UNIQUE KEY matnr.
                        OR
DATA: it_mat TYPE TABLE OF ty_mat.

If we don’t mention “STANDARD TABLE OF” clause then by default the system takes it as a standard internal table. We can enter data into a standard internal table by using the APPEND statement. APPEND always enters data at the last row of the table.
APPEND wa_mat TO it_mat.

We can sort data records in the standard table.
SORT itab BY item.
Here item is the field of the table. We can sort table by any of its fields or multiple fields. Here we have an example of Standard table.

REPORT  zabap_gui.

* Declaring the local structure of internal table
TYPES:
      BEGIN OF ty_tab,
        item     TYPE char10,
        quantity TYPE i,
        price    TYPE i,
      END OF ty_tab.

* Declaring the Standard internal table with non unique key
DATA:
      itab TYPE STANDARD TABLE OF ty_tab WITH NON-UNIQUE KEY item,
      wtab TYPE ty_tab.

* Entering records to each field
wtab-item = 'Rice'. wtab-quantity = 2. wtab-price = 80.

* Now one single row has been fulfilled with data
* Next appending one single row data into the table
APPEND wtab TO itab.

wtab-item = 'Suger'. wtab-quantity = 1. wtab-price = 90.
APPEND wtab TO itab.

wtab-item = 'Tea'. wtab-quantity = 1. wtab-price = 100.
APPEND wtab TO itab.

wtab-item = 'Rice'. wtab-quantity = 3. wtab-price = 150.
APPEND wtab TO itab.

wtab-item = 'Horlicks'. wtab-quantity = 1. wtab-price = 200.
APPEND wtab TO itab.

wtab-item = 'Suger'. wtab-quantity = 2. wtab-price = 70.
APPEND wtab TO itab.

WRITE:  /3 'Item',
        17 'Quantity',
        32 'Price'.
WRITE / '=========================================='.
SKIP. " Skipping one single line

LOOP AT itab INTO wtab.

  WRITE:  /3 wtab-item,
          12 wtab-quantity,
          25 wtab-price.
ENDLOOP.

SKIP.
WRITE '=========================================='.


21 comments:

Bhavya Kumar said...

Best blog.Got to learn new things.Thanks for this Blog SAP Success Factors Training in Chennai

GANESH BISWAL said...

Great Learning . Thanks Roy .

Shalini said...


Hi, This is shalini from Chennai learned SAP Training in Chennai from mr.karthick. The training really was good and i got selected in leading mnc company as SAP Consultant.

You can contact 8122241286 for Best SAP Training in Chennai or reach www.thecreatingexperts.com

sina farham said...

Hi,this ist the beste blog.

sushma said...

SAP Success Factors Real Time Hands on Training in Chennai...

Don't always Depend on Training Institute Alone and so please aware of Best Trainers too..

http://thecreatingexperts.com/sap-successfactors-training-in-chennai/

If You need a Best Trainer over SAP Success Factors Means??? Please ready for an DEMO From the Trianer MR.Karthick
CONTACT:8122241286

Both Classroom/Online Training is Available!!!!!!

Shruti Ramalingam said...

SAP Success Factors Real Time Hands on Training in Chennai…

Don’t always Depend on Training Institute alone.Please aware of Best Trainers too..

http://thecreatingexperts.com/sap-successfactors-training-in-chennai/

If You need a Best Trainer in SAP Success Factors??? Then be ready for a DEMO From the Trainer MR.Karthick
CONTACT:8122241286

Both Classroom/Online Training is Available!!!!!!

sanayamohit said...

SAP Success Factors Real Time Hands on Training in Chennai…

Don’t always Depend on Training Institute alone.Please aware of Best Trainers too..

http://thecreatingexperts.com/sap-successfactors-training-in-chennai/

If You need a Best Trainer in SAP Success Factors??? Then be ready for a DEMO From the Trainer MR.Karthick
CONTACT:8122241286
http://thecreatingexperts.com/sap-mm-training-in-chennai/

Both Classroom/Online Training is Available!!!!!!

sushma said...

Best SAP Success Factor Training in Chennai

http://thecreatingexperts.com/sap-training-in-chennai/
http://thecreatingexperts.com/sap-successfactors-training-in-chennai/
http://thecreatingexperts.com/sap-mm-training-in-chennai/
http://thecreatingexperts.com/sap-fico-training-in-chennai/

suganya said...

SAP Success Factors Real Time Hands on Training in Chennai…

Don’t always Depend on Training Institute alone.Please aware of Best Trainers too..

http://thecreatingexperts.com/sap-successfactors-training-in-chennai/

If You need a Best Trainer in SAP Success Factors??? Then be ready for a DEMO From the Trainer MR.Karthick
CONTACT:8122241286
http://thecreatingexperts.com/sap-mm-training-in-chennai/

Both Classroom/Online Training is Available!!!!!!

suganya said...

SAP Success Factors Real Time Hands on Training in Chennai…

Don’t always Depend on Training Institute alone.Please aware of Best Trainers too..

http://thecreatingexperts.com/sap-successfactors-training-in-chennai/

If You need a Best Trainer in SAP Success Factors??? Then be ready for a DEMO From the Trainer MR.Karthick
CONTACT:8122241286
http://thecreatingexperts.com/sap-mm-training-in-chennai/

Both Classroom/Online Training is Available!!!!!!

Priyasekar said...


SAP Success Factors Real Time Hands on Training in Chennai…

Don’t always Depend on Training Institute alone.Please aware of Best Trainers too..

http://thecreatingexperts.com/sap-successfactors-training-in-chennai/

If You need a Best Trainer in SAP Success Factors??? Then be ready for a DEMO From the Trainer MR.Karthick
CONTACT:8122241286
http://thecreatingexperts.com/sap-mm-training-in-chennai/

Both Classroom/Online Training is Available!!!!!!

Unknown said...


Best SAP MM Material Managemnt Real time hands on Training in chennai

http://thecreatingexperts.com/sap-mm-training-in-chennai/

Anonymous said...

http://thecreatingexperts.com/sap-fico-training-in-chennai/

sushma said...

Hey informative blog...THE CREATING EXPERTS is one of the leading trainers in SAP abap and basis Real Time Hands on Training in Chennai…


http://thecreatingexperts.com/sap-abap-training-in-chennai/


CONTACT:8122241286

http://thecreatingexperts.com/sap-basis-training-in-chennai/

Priyasekar said...

Thanks for your info...Here THE CREATING EXPERTS provide hands on training with real time scenarios

http://thecreatingexperts.com/sap-abap-training-in-chennai/

contact +91-08122241286

sanayamohit said...

Hi, I learned SAP Training in Chennai from THE CREATING EXPERTS. The training was good and i got selected in leading MNC company as SAP Consultant.

contact 8122241286

www.thecreatingexperts.com

ragu varan said...

Best SAP HANA Training in Chennai by leading HANA Consultant.
Reach at 9003085882 or http://thecreatingexperts.com/category/sap-hana-training-in-chennai/

Anonymous said...

hello SANDIP ROY,
great work you dome for the learners. now i have a small doubt about using standard table and sorted table what is the difference of using
1. standard table applying sorting on it and
2. directly using sorted table
can we use binary search on first one .
hope i get response from you,
thankyou.

Anonymous said...

Keep up the good work!!!

Unknown said...

Really very informative and creative contents. This concept is a good way to enhance the knowledge.sap hr abap online classes

calfre services said...

Very good work.sap hr apap training