Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Please Help TTY/WA/IT q

former_member819050
Discoverer
0 Kudos

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.

  1. 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

4 REPLIES 4

Sandra_Rossi
Active Contributor
0 Kudos

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.

adityaIngale
Active Participant

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

0 Kudos

Aditya you are amazing!

Thank you so much for the explanation it really helped my understanding of APPEND & INTERNAL tables 🙂

matt
Active Contributor
0 Kudos

TTY/WA/IT q

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.