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
On abap: did you set up a workflow? Are you familiar with all the steps for setting up a workflow?
What are Delivery classes? What data will you want to transport during client copy?
What are the functional areas? User groups? and how does ABAP query work in relation to these?
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 ) ?
Why bapi need then bdc ? : abap bdc
What are the different control break statements available inside a loop?
What is the major difference between pool tables and transparent tables?
In the abap/4 dictionary tables can be defined independent of the underlying database (t/f). : abap data dictionary
What is meant by stacked list?
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 .....
Where do you create indexes in abap?
What are the organizational related infotypes? : abap hr
Explain the concept of clusters in payroll
What is meant by hide area?
Can i Have Some Examples on Enhancements.