‎2016 Jul 11 5:22 PM
Hi,
One thing that bothers me about eclipse is that changes in open files are not recognised unless everything is activated. SE80 seems more integrated.
Example: I could have method definitions in include ZTEST_DEF, and their implementations in ZTEST_IMPL. This works well, and I can have the two open simultaneously in separate SE80 sessions.
Eclipse brings that into a tabbed / split environment, which is brilliant.... but not-quite-there.
To continue my example:
include ZTEST_DEF:
class lcl_test definition.
public section.
methods m1.
endclass.
include ZTEST_IMPL:
class lcl_test implementation.
method m1.
endmethod.
endclass.
If I add a method m2 definition in include _DEF and save it, I can implement it and call it in my class implementation. Works fine in SE80 just with saving, syntax check is happy, no activation necessary.
Not so in eclipse: The DEF complains that the implementation is missing, and the IMPL complains that the method is unknown. I can only get rid of the error by activating everything simultaneously.
Of course the easy way out is to lump everything into one include, which is what I do. But this is just one example, I've come across many such 'sync' situations that work fine in SE80 (e.g. adding parameters to a global class method that gets called by another global class).
Any opinions welcome.
Regards,
Mike
‎2016 Jul 12 5:26 AM
Mike,
The problem lies in your config of eclipse. Please activate syntax check on all tabs at once, then you can keep definition and implementation in separate includes without even need of saving changes when you switch the tabs.
Cheers
Lukasz
‎2016 Jul 11 6:45 PM
Of course the easy way out is to lump everything into one include, which is what I doWhen i worked with SE80, i used to create 2 includes -
In Eclipse i just put the whole class in an include ZI_TEST_L01 The syntax check complains that definitions and implementations must not be in the same include
Refactoring, method extraction etc. work smoothly when both the implementation & definition are in the same include. IMO the pros outweigh the cons and i can live with the syntax warning
BR,
Suhas
‎2016 Jul 11 10:27 PM
Actually there's another small but useful benefit to having all in one: In the outline view (bottom right by default), you can click on the class names and it will take you to the definitions, which doesn't work if it's split.
That said though, on thinking about it working with multiple global classes is probably the biggest annoyance for me as far as this behaviour goes.
Regards,
Mike
‎2016 Jul 12 5:26 AM
Mike,
The problem lies in your config of eclipse. Please activate syntax check on all tabs at once, then you can keep definition and implementation in separate includes without even need of saving changes when you switch the tabs.
Cheers
Lukasz
‎2016 Jul 12 7:15 AM
I nearly jumped for joy, but it doesn't work. It does seem to handle changes in global classes, but not local def/impl splits. I can live with it, I prefer the outline convenience anyway.
Thanks,
Mike
‎2016 Jul 12 7:28 AM
I'm pretty sure It was working for local classes as well, but I will check again.
‎2016 Jul 12 8:17 AM
Checked and worked as expected by me.
To be clear, I've opened two tabs one for definition of a local class and second for implementation from one FG. Then I've added in implementation one line: test_eclipse = 1.
I"ve got an error from syntax check.
Then I've added in the definition of a class: data: test_eclipse type i.
I've come back to implementation, error does not appear anymore. I didn't even saved the changes on definition.
Just be sure that syntax check on all tabs is active.
‎2016 Jul 12 9:20 AM
OK, this is starting to smell like a bug. Use my example above, with three source modules:
ZTEST:
REPORT ztest.
INCLUDE ztest_def.
INCLUDE ztest_impl.
ZTEST_DEF:
CLASS lcl_test DEFINITION.
PUBLIC SECTION.
METHODS m1.
ENDCLASS.
ZTEST_INCL:
CLASS lcl_test IMPLEMENTATION.
METHOD m1.
ENDMETHOD.
ENDCLASS.
Note you can only activate the DEF and INCL together.
Now add a method m2 into ZTEST_DEF. It will show an error, and using quick fix it will create the implementation in ZTEST_IMPL. So it is aware where the class implementation lives. But the error remains even after the method is implemented.
The implementation of m2 also throws an error saying it's not defined, so we end with a deadlock:
Activate both together and it's fine.
Add a call to m2 in m1 -> OK.
Add a parameter to m2 and use it in the call -> Fail.
Regards,
Mike
‎2016 Jul 12 9:37 AM
Hmm, with the includes in standard program (not a function group includes) I had same error as you as long as I didn't saved both includes. Activation wasn't necessary.
I work on 740 SP5 and I know that in newer SPs and 750 there were some improvements to the includes handling in eclipse.
‎2016 Jul 12 10:20 AM
Hi,
for my knowledge the problem occurs only with dirty sources. As long as you save the different includes, syntax check should work fine.
Reason is that the syntax check does not consider the content of other unsaved editors.
We already thought about improving this, but currently there are no concrete plans.
Regards,
Michael
‎2016 Jul 12 10:29 AM
Hi Michael,
Thanks for clarifying this up.
We already thought about improving this, but currently there are no concrete plans.
Until then, i'll continue placing the definitions & implementations in a single include
BR,
Suhas
‎2016 Jul 12 11:45 AM
Hi Michael,
thanks for your response on this. With dirty source, this would be perfectly sensible. Unfortunately it goes beyond that, it does this even when everything is saved (it's the first thing I made sure of).
Please try my example above; complete activation of everything is the only way I can get it to work. I've even run into situations where it would complain that a mandatory parameter is missing, and when I add it, it complains the parameter is not defined.
Regards,
Mike