10-28-2013 6:39 AM
Dear Friends,
When i am trying to redefine ( SYNC_DATA ) method in one subclass, i am getting the following error
please check the screen shot, could you please let me know what is the issue ?
Advance Thanks
Vijaya
10-28-2013 6:43 AM
Please check your methods, SYNC_DATA is already defined(i.e. inherited from parent)....
Please select the existing method for re-definition rather than creating new..
10-28-2013 6:43 AM
Please check your methods, SYNC_DATA is already defined(i.e. inherited from parent)....
Please select the existing method for re-definition rather than creating new..
10-28-2013 8:08 AM
Thanks Maju
could you please let me know , how to call this SYNC_DATA method in my program
Advance Thanks
Vijaya
10-28-2013 8:18 AM
Hi,
You can call your method using objects or from the "Pattern" button in ABAP editor..
Use Pattern so that it gives you the same interface as u call a function module.
1. From SE38, press "Pattern Button"
2. Click on ABAP Object patterns radio button
3. Now Select "call Method" radio button..
4. Instance: Provide the Object created for the class
Class/Interface: provide the class name
Method: provide the Method name
5. ENTER
10-28-2013 8:54 AM
SYNC_DATA is declared as protected
when i try to call this method i am getting " ACCESS TO PROTECT METHOD SYNC_DATA IS NOT ALLOWED" could you please let me know how to call this method in my program
Advance thanks
Vijaya
10-28-2013 9:38 AM
Hi Vijaya,
I would recommend you to first understand the Object oriented concepts and start your work..Please search through scn for threads and documents...
To being with see this: http://scn.sap.com/docs/DOC-10236
"In subclasses, it is not possible to access the protected components of the superior classes using reference variables of the type of the superior class, because otherwise an attribute of an object of the dynamic type of the superior class or another subclass could be changed."{SAP Documentation}
Please use the correct Object(instance) to access the method..
10-28-2013 6:57 AM
Hi Vijaya,
As Maju said, you need to redefine the same method from menu options. It won't allow you to create another method with the same name.
Also if you want to invoke the super class method in addition to your redefined code, you need to call super->SYNC_DATA() before the re-definition.
Thanks,
Ajay Bose
10-28-2013 7:02 AM
Hello Vijaya lakshmi,
Method is already Created in your above screen shot.
10-28-2013 8:19 AM
Dear Friends
could you please let me know , how to call this SYNC_DATA method in my program
Advance Thanks
Vijaya