Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Eclipse sync across open modules

pokrakam
Active Contributor
0 Likes
1,931

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

1 ACCEPTED SOLUTION
Read only

LukaszPegiel
SAP Champion
SAP Champion
0 Likes
1,888

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

11 REPLIES 11
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,888
Of course the easy way out is to lump everything into one include, which is what I do

When i worked with SE80, i used to create 2 includes -

  • ZI_TEST_D01 (Local Class Definition)
  • ZI_TEST_P01 (Local Class Implementation)

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

Read only

pokrakam
Active Contributor
0 Likes
1,888

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

Read only

LukaszPegiel
SAP Champion
SAP Champion
0 Likes
1,889

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

Read only

0 Likes
1,888

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

Read only

0 Likes
1,888

I'm pretty sure It was working for local classes as well, but I will check again.

Read only

0 Likes
1,888

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.

Read only

0 Likes
1,888

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

Read only

0 Likes
1,888

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.

Read only

0 Likes
1,888

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

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,888

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

Read only

0 Likes
1,888

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