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
What is search help exit? : sap abap data dictionary
What is “call mode”?
Sal abap on hana interview
What is the length of function code at user-command?
What are the problems in processing batch input sessions? How is batch inputprocess different from processing online?
Is there any BAPI to retrieve list of customers and their sales areas i.e., Cust No, Distr Channel and Division for all the customers.
What is the use of abap data dictionary? : abap data dictionary
What is database utility? : abap data dictionary
what is mean be On Change of in Control Break statement
what are the two methods of modifying sap standard tables ?
How are BAPI different from Normal function modules ?
A function module can be called from a transaction screen outside an abap/4 program. State true or false. : abap modularization
Can you define a field without a data element?
what is call back in alv?
Table events aNd table maintains generation