‎2008 Aug 28 8:44 AM
Hi,
i have Method that i write like below and its working o.k.
i ant to change the way i write it but i have error how can i solve it?
Regards
CALL METHOD leaf_ref->find_leaf "working o.k.
EXPORTING
node_tab = node_tab
RECEIVING
leaf_tab = leaf_tab.have Error :
leaf_tab = leaf_ref->find_leaf( node_tab ) .You can only omit the parameter name if the method only has a
non-optional parameter or an optional IMPORTING parameter that is
identified by "PREFERRED PARAMETER". by "PREFERRED PARAMETER".
‎2008 Aug 28 9:03 AM
Hi Cosmo Kramer,
Why do you want to go for the second way...
The Best way while working with patterns is the best way to get rid of those errors... The functionality is
for both the ways.. in that case i agree with you...
So why dont you go with the first way... and use PATTERN option in the editor...
And Use the PATTERN if you are using the global classes..
Go with the second method if you are defining local classes..
Hope this would help you.
Good luck
Narin
‎2008 Aug 28 8:47 AM
well you once again need thet "call method" thingie.
best way not to stumble into such things is to use the pattern-button in SE80.
select pattern for ABAP-OO and hit ENTER. Rest should be self explaining.
‎2008 Aug 28 8:54 AM
Hi,
leaf_tab = leaf_ref->find_leaf( node_tab = node_tab ) .
Regards,
Bert
‎2008 Aug 28 9:09 AM
Hi Bert Deterd ,
Thanks its work ,
maybe u can explain shortly why it work o.k. in parameter like this :
node_tab = child_ref->find_hier( znodefather ).
and in table it work like u write.
leaf_tab = leaf_ref->find_leaf( node_tab = node_tab ) .
Regards
‎2008 Aug 28 9:01 AM
it is working fine for me. I am not getting any error.
REPORT ztest_obj.
CLASS lcl_test DEFINITION.
PUBLIC SECTION.
METHODS test_method
IMPORTING flag TYPE i
RETURNING value(flag2) TYPE i.
ENDCLASS. "lcl_test DEFINITION
CLASS lcl_test IMPLEMENTATION.
METHOD test_method.
flag2 = flag + 10.
ENDMETHOD. "test_method
ENDCLASS. "math IMPLEMENTATION
START-OF-SELECTION.
DATA oref TYPE REF TO lcl_test.
DATA: flag TYPE i,
test type i value 4.
CREATE OBJECT oref.
flag = oref->test_method( test ).
‎2008 Aug 28 9:03 AM
Hi Cosmo Kramer,
Why do you want to go for the second way...
The Best way while working with patterns is the best way to get rid of those errors... The functionality is
for both the ways.. in that case i agree with you...
So why dont you go with the first way... and use PATTERN option in the editor...
And Use the PATTERN if you are using the global classes..
Go with the second method if you are defining local classes..
Hope this would help you.
Good luck
Narin