Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Hi, My question is " How to display 3rd highest salary
record from the internal table. The internal table has 2
fields named emno(Employee number) and salary.".
Send answer to my mail shaiksha.it@gmail.com.
Thanking you.

Answer Posted / nandana sai

TYPES : BEGIN OF ty,
eno(6) TYPE c,
sal TYPE labst,
END OF ty.

DATA : itab TYPE STANDARD TABLE OF ty,
wa_it TYPE ty,
itab1 TYPE STANDARD TABLE OF ty,
wa_it1 TYPE ty.

DATA : saal TYPE labst.

wa_it-eno = '1000'.
wa_it-sal = '10000'.
APPEND wa_it TO itab.
CLEAR wa_it.

wa_it-eno = '1001'.
wa_it-sal = '19000'.
APPEND wa_it TO itab.
CLEAR wa_it.

wa_it-eno = '1002'.
wa_it-sal = '10500'.
APPEND wa_it TO itab.
CLEAR wa_it.

wa_it-eno = '1003'.
wa_it-sal = '10080'.
APPEND wa_it TO itab.
CLEAR wa_it.

wa_it-eno = '1004'.
wa_it-sal = '10200'.
APPEND wa_it TO itab.
CLEAR wa_it.

wa_it-eno = '1006'.
wa_it-sal = '10400'.
APPEND wa_it TO itab.
CLEAR wa_it.

wa_it-eno = '1005'.
wa_it-sal = '10400'.
APPEND wa_it TO itab.
CLEAR wa_it.

wa_it-eno = '1007'.
wa_it-sal = '19000'.
APPEND wa_it TO itab.
CLEAR wa_it.

SORT itab BY sal DESCENDING.

itab1 = itab.

DELETE ADJACENT DUPLICATES FROM itab1 COMPARING sal.

READ TABLE itab1 INTO wa_it1 INDEX '3'.
saal = wa_it1-sal.

LOOP AT itab INTO wa_it WHERE sal EQ saal.

WRITE :/ wa_it-eno, 10 wa_it-sal.
ENDLOOP.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is exception class and test class. How to use it?

1327


What is asap methodology? : sap abap hr

1032


What is payroll driver ? : abap hr

1058


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

1177


can anyone do BDC or BAPI for F-02 and F-04 transactions.If it LSMW also.Kindly let me know.

3665


What are the different types of luws. What are they?

1102


What abap statement will trigger list generation?

1018


singleton class

1335


What is an authorization in sap?

1147


What are the functions of lock objects?

1142


What is the difference between a dialog program and a report?

1032


It is not possible to create an abap/4 program, which contains only subroutines. State true or false. : abap modularization

1279


How many types of data classes are there in sap abap? : abap data dictionary

1028


What is img? : sap abap hr

1099


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

910