You are on page 1of 2

Hi Jashim,

Try to write a program which displays the below output.


Display the below in the same order.
1.
My first ABAP program (Hint using variable)
2.
Date: 11.06.2014, Time: system time. (Hint - Try
to use system variable)
3.
Your first name, last name, company, designation
and location. (Using structure)
4.
Display the above separated by comma.
5.
Use the variable A = 25, B = 5. Display A, B,
addition, subtraction, multiplication and division of A & B .
6.
Use the constant X = 5. Display an error message
when it is not initial.
7.
Use the above constant. Display Fail if less than 5.
Success when equal to 5. (Use IF else statement)
8.
Use the variable S of value 10. If, S is 2 display 2, if
S is 3 display 3, if S is 4 display 4 else display The value of
S is 10.
9.
Also Use case statement for the above case.
10. Display loop count for 3 times
11. Replicate the below outputs using Do 5 times.
(CONTINUE, CHECK and EXIT)
1245
345
1234

OUTPUT EXACTLY LIKE BELOW.


My first ABAP program
Date: 11.06.2014

Time: System time

First name Last name Company designation Location


First name, Last name, Company, designation, Location
25 5 30 20 125 5
X is not initial
Success
The value of S is 10.
The value of S is 10
123
1245
345
1234

*&---------------------------------------------------------------------**& Report Z_ABAPCLASS1*&


*&---------------------------------------------------------------------**&*&
*&---------------------------------------------------------------------*REPORT Z_ABAPCLASS1." 1. My
first ABAP program (Hint using variable)DATA : NAME1(40) TYPE c.NAME1 = 'mY FIRST
abap PROGRAM'.WRITE NAME1.WRITE SY-ULINE."2.
Date: 11.06.2014, Time:
system time. (Hint - Try to use "system variable) Data : date1 type D. DATA : TIME1
TYPE T. DATE1 = SY-DATUM. TIME1 = sy-uzeit. WRITE : 'DATE :' , DATE1. WRITE : 'TIME :',
TIME1. WRITE SY-ULINE. "3.
Your first name, last name, company, designation and
"location. (Using structure)data : BEGIN OF structure1, firstname(10) type c,
Lastname(10) type c, Company1(10) TYPE c, Designation1(10) TYPE c, End of
structure1. structure1-firstname = 'Mohammed'. structure1-lastname = 'jashim'.
structure1-company1 = 'TechM'. structure1-Designation1 = 'Sr. Engineer'. Write :
structure1-firstname , structure1-lastname ,structure1-company1, structure1designation1. WRITE sy-uline." 4.
Display the above separated by comma.write :
structure1-firstname,',', structure1-lastname, ',',structure1-company1 , ',',structure1designation1. WRITE sy-uline. "Use the variable A = 25, B = 5. Display A, B, addition,
subtraction, "multiplication and division of A & B .DATA : a(4) type n VALUE 25.DATA : b(4)
TYPE n VALUE 5.Data : Addition(2) TYPE n ,
subtraction(4) TYPE n ,
multiplication(4)
TYPE n,
division(2) TYPE n. subtraction = a - b.multiplication = a * b.division = a / b .
Addition = a + b.Write : Addition.Write : subtraction .write : multiplication.WRITE :
division .WRITE sy-uline."6.
Use the constant X = 5. Display an error message
when it"is not initial.CONSTANTS : x(1) TYPE c VALUE '5'.write x .if x is INITIAL. write 'x
value is initial'. ELSE.
write 'x is not initial'.
ENDIF.

You might also like