2022 Aug 29 5:52 PM
Hello Everyone!
Im new to SAP but and im really struggling with my applications to unknown scenarios, so for example i found a practice question which i cant answer.
Consider the code : which statments at the bottom are true?
TYPES: BEGIN OF tty_player,
jersey_number TYPE i,
player_name TYPE string,
runs_scored TYPE i,
END OF tty_player.
DATA: it_player TYPE STANDARD TABLE OF tty_player,
wa_player LIKE LINE OF it_player.
wa_player-jersey_number = 12.
wa_player-player_name = 'Yuvraj Singh'.
wa_player-runs_scored = 12000.
APPEND wa_player TO it_player.
wa_player-jersey_number = 17.
wa_player-player_name = 'AB De Villiars'.
wa_player-runs_scored = 12000.
APPEND wa_player TO it_player.
wa_player-jersey_number = 18.
wa_player-player_name = 'Virat Kohli'.
wa_player-runs_scored = 13000.
APPEND wa_player TO it_player.
wa_player-jersey_number = 7.
wa_player-player_name = 'MS DIONT'.
wa_player-runs_scored = 13000.
APPEND wa_player TO it_player.
SORT it_player BY runs_scored.
Which of the following statements are true?
AB De Villiers appears before Yuvrai sineh - 2nd attempt ans
Virat Kohli appears before is Dhoni
AB De Villiers appears before Ms Dhon
Ms Dhoni appears before Virat Kohl
Yuvraj Singh appears before AB De Villiers
Virat Kohli appears before Yuvrai Sinsh
2022 Aug 29 6:13 PM
I don't understand how you can "struggle with your applications", as you say, if you don't have an ABAP environment to practice. Just reading some code from interview questions (I guess) and getting the answers from other people won't help you. After you have installed your ABAP environment, you can debug the program, understand what the program does, and you can answer.
2022 Aug 29 6:20 PM
Hi Nura,
First you are appending the values to the internal table and then you doing sorting operation based on the score so, from low score to hight score value will be sort.
So the 3rd option i.e AB De Villiers appears before Ms Dhon is true in this scenario.
Regards,
Aditya
2022 Aug 30 1:13 PM
Aditya you are amazing!
Thank you so much for the explanation it really helped my understanding of APPEND & INTERNAL tables 🙂
2022 Aug 30 2:41 PM
I guess you mean table type, work area, internal table question. In which case, why not write it out in full instead of expecting people to guess.