NAVAPAT_T

ABAP : MAX,MIN with name(JOIN)

Jul 21st, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ABAP 0.75 KB | None | 0 0
  1. TABLES : zpat_student,zpat_subject.
  2. data : max_score type zpat_student-score,
  3.       names type zpat_student-name,
  4.       min_score type zpat_student-score.
  5. *--------------find max,min score-------------------------
  6. select max( score ) min( score ) into (max_score, min_score)
  7.   from zpat_student.
  8.   write : / 'NAME', 20 'SCORE', 40 'GRADE', 60 'SUBJECT'.
  9.   uline .
  10. *-------------find name matching with score---------------
  11.   SELECT * from zpat_student where score = max_score or score = min_score.
  12. *---------------Join table with ZPAT_STUDENT-------------
  13.     SELECT * from zpat_subject where grade = zpat_student-grade.
  14.     write : / zpat_student-name, 20 zpat_student-score, 40 zpat_subject-grade , 60 zpat_subject-subject.
  15.     ENDSELECT.
  16.   ENDSELECT.
Advertisement
Add Comment
Please, Sign In to add comment