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 / jitendra
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.
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.
SORT ITAB BY SAL DESCENDING.
READ TABLE ITAB INTO WA_IT INDEX '3'.
SAAL = WA_IT-SAL.
clear wa_it.
LOOP AT ITAB INTO WA_IT where sal eq saal.
*append wa_it to itab1.
write :/ wa_it-eno, 10 wa_it-sal.
ENDLOOP.
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the use of buffering?
What is the last entry in all bdc tables? : abap bdc
Explain what are the events used in interactive reports?
what are the important fields while preparing sales order,inquiry?
how 2 create the normal form by using functional module
What are the types of data types in the sap abap?
where are the passwords for ITS stores?
What are logical data bases used in hr module? : abap hr
What is a data dictionary? : abap data dictionary
What are Table control and tab strip control in dialog programming ?
How can I get ascii value of any letter? Is there any function?
Differentiate database index and match code.
What are the different modules of sap? : sap abap hr
What are the different types of mode (run code) in call transaction method?
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.