Exercise 5 - ABAP Objects
Exercise 5 - ABAP Objects
6 Delta TrainingQuestions
ABAP Objects
Review Questions
1. In which of the three parts of an ABAP Objects program (Definition, Implementation,
or Use) do the following occur?
A. Specifying the parameters that a method takes
B. Instantiate an object
D. Specify that a method is available only to the class and its subclasses
4. What happens when you use MOVE to copy one reference variable to another?
•SET_BALANCE
• IMPORTING NEW_BALANCE TYPE DMBTR
–Sets the balance to a new value.
•DEPOSIT
• IMPORTING AMOUNT TYPE DMBTR
• RETURNING NEW_BALANCE TYPE DMBTR
–Adds a deposit amount to the balance and returns the new balance.
•WITHDRAW
IMPORTING AMOUNT TYPE DMBTR
•
• RETURNING NEW_BALANCE TYPE DMBTR
• EXCEPTIONS INSUFFICIENT_FUNDS
–Subtracts a deposit amount from the balance and returns the new
balance.
–Activate all elements of your class.
–Write a program called Z_USE_ACCOUNT_xx, where xx is the last two digits of
your logon ID. This program should do the following:
–Instantiate an instance of the Account class.
–Set the account balance to some initial value.
–Make several deposits and withdrawals, printing the new balance each
time. Do not allow the balance to become less than zero. (Use the
exception to detect this.)
–Test and debug your program.
•"Extra Credit": If you have extra time, try any of the following: