0% found this document useful (0 votes)
48 views2 pages

Student Result ABAP Project

The document outlines an enhanced SAP ABAP program for a Student Result Management System. It includes functionalities for retrieving student data, calculating total and average marks, determining pass/fail status, and displaying the results. Additionally, it provides an option to download the results to a text file.

Uploaded by

diptisjt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views2 pages

Student Result ABAP Project

The document outlines an enhanced SAP ABAP program for a Student Result Management System. It includes functionalities for retrieving student data, calculating total and average marks, determining pass/fail status, and displaying the results. Additionally, it provides an option to download the results to a text file.

Uploaded by

diptisjt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SAP ABAP Project: Student Result Management System (Enhanced)

Enhanced ABAP Program Code

REPORT zstudent_result_enhanced.

PARAMETERS: p_studid TYPE char10.

TYPES: BEGIN OF ty_student,


student_id TYPE char10,
student_name TYPE char50,
marks1 TYPE i,
marks2 TYPE i,
marks3 TYPE i,
total TYPE i,
average TYPE p DECIMALS 2,
result TYPE char10,
END OF ty_student.

DATA: wa_student TYPE ty_student,


it_students TYPE STANDARD TABLE OF ty_student.

START-OF-SELECTION.

SELECT SINGLE student_id


student_name
marks1
marks2
marks3
INTO CORRESPONDING FIELDS OF wa_student
FROM zstudent_db
WHERE student_id = p_studid.

IF sy-subrc <> 0.
WRITE: / 'Student ID not found!'.
EXIT.
ENDIF.

PERFORM calculate_result USING wa_student CHANGING wa_student.


APPEND wa_student TO it_students.
PERFORM display_output.

FORM calculate_result USING p_student TYPE ty_student


CHANGING c_student TYPE ty_student.

c_student-total = p_student-marks1 + p_student-marks2 + p_student-marks3.


c_student-average = c_student-total / 3.

IF p_student-marks1 < 35 OR p_student-marks2 < 35 OR p_student-marks3 < 35.


c_student-result = 'FAIL'.
ELSE.
c_student-result = 'PASS'.
ENDIF.

ENDFORM.
SAP ABAP Project: Student Result Management System (Enhanced)

FORM display_output.

DATA: lv_line TYPE string,


lt_download TYPE STANDARD TABLE OF string.

WRITE: / 'Student Result Report'.


WRITE: / '======================='.
ULINE.
WRITE: / 'ID', 10 'Name', 30 'Marks1', 38 'Marks2', 46 'Marks3',
54 'Total', 62 'Average', 72 'Result'.
ULINE.

LOOP AT it_students INTO wa_student.


WRITE: / wa_student-student_id,
wa_student-student_name,
wa_student-marks1,
wa_student-marks2,
wa_student-marks3,
wa_student-total,
wa_student-average,
wa_student-result.

CONCATENATE wa_student-student_id
wa_student-student_name
wa_student-marks1
wa_student-marks2
wa_student-marks3
wa_student-total
wa_student-average
wa_student-result
INTO lv_line SEPARATED BY '|'.
APPEND lv_line TO lt_download.
ENDLOOP.

CALL FUNCTION 'GUI_DOWNLOAD'


EXPORTING
filename = 'C:\Users\Public\student_results.txt'
filetype = 'ASC'
TABLES
data_tab = lt_download.

ENDFORM.

You might also like