Beruflich Dokumente
Kultur Dokumente
Note: All the following objects to be created should follow a naming convention YEMPID_##$$
%%. ##$$ indicates the exercise number whereas %% indicates the question number in the
exercise.
Exercise on Subroutines:
1) Write a subroutine to print the user name, run date, and run time and invoke the
subroutine.
2) Write a program to accept two numbers and an arithmetic operator. Perform the specified
arithmetic operation on the number inputs, in a subroutine by passing the accepted inputs
by value. Print the numbers, the operator and the result in the main program. If the
accepted values are invalid, display that information on the list. (Use another subroutine to
validate the inputs).
3) Accept a number N from the user and print the first N numbers of the fibonacci series
using a subroutine. Implement this using recursion technique.
Plant Description
0100 YASH plant1
0110 YASH plant2
0200 Test plant
Display the contents of the second internal table, only when there are corresponding
entries in the first internal table.
Exercise 02.04 - Modularizing ABAP programs
Exercise 02.04 - Modularizing ABAP programs
Plant: 0100 YASH plant1
Material Material type Quantity
MAT001 Raw material 30
MAT002 Trading goods 5
MAT003 Finished goods 12
b) Write a subroutine to populate the internal table with the data as specified below:
6) Create a program to output the contents of the internal table created in the previous
question as specified below. Print user details like the user name, run date and run time
using the subroutine, which is created in question 1.
7) Write a function module to determine whether a given year is a leap year or not.
8) Write a function module to generate a random number. (You are at your liberty to use any
logic to generate a random number).
9) Write a function module to accept a date and display the date in the following format.
Ex: Wednesday September 18, 2002
10) Write a program to populate the internal table with the following data and calculate the
loss/gain and display the contents of the internal table. Use a function module to calculate
the loss or gain by passing the internal table by value to the function module.
Output:
Airline Carrid Connection Id Loss/Gain
LH 0400 Gain
LH 0404 Gain
SQ 0786 Gain
AI 0987 Gain
AI 0009 Loss
UA 0007 Loss
11) Write a program to populate an internal table with the following data:
Exercise on Macros:
12) Write a program to accept two numbers and an arithmetic operator. Write a macro to
perform the arithmetic operation on the number inputs and invoke another macro from it to
print the numbers, the operator and the result.
13) Write a program to print a given character string, for the user specified offset and length
using a macro. Validate the user input using another macro.
14) Write a program to calculate the factorials of first 5 numbers using a macro. Display the
output in the following format using another macro.
Factorial of 1 is 1.
Factorial of 2 is 2.
Factorial of 3 is 6.
Factorial of 4 is 24.
Factorial of 5 is 120.