|Home • Trainings • Quiz • Tips • Tutorials • Functional • Cert Q's • Interview Q's • Jobs • Testimonials • Advertise • Contact Us|
Object oriented programming (OOP) explained with an example
Write the required code. Similarly for SET_BALANCE
Similarly for WITHDRAW.
Now we are almost done creating the object. Press CTRL + F3
to activate or hit the Matchstick.
We will see this in the status
Now we are done building the global class we can test it.
Click SET_BALANCE. Write the NEW_BALANCE and press ENTER.
We come back to Initial Screen. Now click DEPOSIT.
We see the return Values now.
Now let’s WITHDRAW 4000
Now the BALANCE is 2000
Lets try withdrawing 3000 now.
We get an exception.
Given below is an example code for using the global class we
REPORT ZGB_OOPS_BANK .
DATA: acct1 type ref to zaccountaa.
DATA: bal type i.
create object: acct1.
begin of block a.
method acct1->set_balance( p_amnt ).
= acct1->deposit( p_dpst ).
= acct1->withdraw( p_wdrw ).
This is the output.
Please send us your feedback/suggestions at webmaster@SAPTechnical.COM
©2006-2007 SAPTechnical.COM. All rights reserved.
product names are trademarks of their respective companies. SAPTechnical.COM
is in no way affiliated with SAP AG.
Graphic Design by Round the Bend Wizards