on 09-22-2008 9:44 AM
Hello experts, I have redefined the inbound IP_FORMPRDETAIL from component ContractListStart, but when I copy the standard code and paste in the IP_FROMPRDETAIL redefined, give me some errors of methods:
me->create_empty_contracts( EXPORTING ir_col_pods = lr_col_pods
CHANGING cr_col_newcontracts = lr_col_newcontracts ).
me->update_newcontracts( EXPORTING ir_col_pods = lr_col_pods
CHANGING cr_col_newcontracts = lr_col_newcontracts ).
store_selected_contracts( ).
The systems doesn't recognize this methods, and tell me that this methods don't exist or are unkonwn, How I can solve this. How I can call this methods. Instance an object??
Thanks in advance best regards.
Hello,
Try to add 'super' to the method call, like this:
super->create_empty_contracts( EXPORTING ir_col_pods = lr_col_pods
CHANGING cr_col_newcontracts = lr_col_newcontracts ).
super->update_newcontracts( EXPORTING ir_col_pods = lr_col_pods
CHANGING cr_col_newcontracts = lr_col_newcontracts ).
Super just refers to the super class, the class from which you inherited. When you copy or enhance a certain object, all the related classes are created in the customer namespace (Z) and thus these Z classes inherit from the 'super' class.
Hope this helps,
Kind regards,
Joost
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, thanks for your help, when I use SUPER in IP_FROMPRDETAIL for the method store_selected_contracts(). Like this:
SUPER->store_selected_contracts( ).
And Give me the error: You cannot access private method STORE_SELECTED_CONTRACTS. not allowed.
This methods is in IP_FROMPRDETAIL of Component IUICCON, and view ContractListStart. Can you help me please ?
Hello,
If the method is private you cannot access it from a class that inherits from this class, this behaviour is a key principle of object oriented programming.
To be able to solve your problem:
Try to redefine the STORE_SELECTED_CONTRACTS method and copy paste the code from the class you inherited from. The function is still private (you cannot change the modifier of inherited methods) but has a local definition within your class, so you can access and use it.
Another solution would be to identify if the STORE_SELECTED_CONTRACTS method is used/called in another method of that same class and hope that that class is public (public = can be called by inherited classes)
Hope this helps,
Kind regards,
Joost
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.