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

What are the steps to be followed to set lockobjects? : sap abap data dictionary

621


What are the prerequisites for creating foreign key relationship?

653


When a program is created and need to be transported to prodn does selection texts always go with it? If not how do you make sure? Can you change the cts entries? How do you do it?

568


What is the difference between bdc_open_group and bdc_open_dataset. : abap bdc

601


hi frends this is bala raju from pune.i want to know diff between 4.7ee and ecc 5.0.if possible give me brief explanation.this question was asked in EDS(tele interview) in pune bye.

1708






Interactive Report that list purchase order details of a vendor. When the user double clicks on material number it shows detail list with fields matkl, meins, brgew, ntgew, gewei.The selection screen consist of sales organisation, distribution channel and material number. plz mention the detail coding Tahnks, Rahul

3252


In sap scripts, how will you link form with the event driven?

548


​​What is amdp (abap managed data procedures)?​​

636


How do you write manual bdc session method? : abap bdc

590


What are the objects of the abap dictionary or what types of objects can be created in the abap dictionary? : abap data dictionary

533


Why bapi need then bdc ? : abap bdc

573


What are data classes? What are the various data classes available for selection? : abap data dictionary

548


Explain get pernr concept when we use logical data base? : abap hr

744


What is generic area buffering in abap?

564


Explain how data is stored in cluster table?

650