A database table contains 3
fields(Student_no,Section,Total_marks).I want retrieve top 10
students from each section.Note:(Section contains data like
A,B,C.Each section contains more than 10 students).

Answer Posted / waseem

DATA itab LIKE zabc OCCURS 10 WITH HEADER LINE.
SELECT * FROM zbad5 INTO TABLE itab.
SORT itab BY sclass smarks.
data : count type i value 0.
LOOP AT itab.

AT NEW sclass.
count = count + 1.
IF ( count LE 10 ).
WRITE: / itab."-sno1, itab-sclass, itab-smarks.
ENDIF.
ENDAT.

AT END of sclass.
count = 0.
ENDAT.



ENDLOOP.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

On abap: did you set up a workflow? Are you familiar with all the steps for setting up a workflow?

582


What are Delivery classes? What data will you want to transport during client copy?

989


What are the functional areas? User groups? and how does ABAP query work in relation to these?

715


Kindly help me to Know the process of mapping in EDI from R/3 to a convertor(third party which translates IDoc flatfile to EDIFACT /XML / FTP /HTTP ) ?

1554


Why bapi need then bdc ? : abap bdc

582






What are the different control break statements available inside a loop?

586


What is the major difference between pool tables and transparent tables?

517


In the abap/4 dictionary tables can be defined independent of the underlying database (t/f). : abap data dictionary

713


What is meant by stacked list?

601


the problem is that , while i am undergoing with my practice session, i am creating too many new programs.they are occupying much space in my hard-disk. how to delete un-necessary programs completely from my data- base........... plz help me with this .....

1570


Where do you create indexes in abap?

628


What are the organizational related infotypes? : abap hr

590


Explain the concept of clusters in payroll

2130


What is meant by hide area?

660


Can i Have Some Examples on Enhancements.

1983