Quantcast
Channel: ABAP in Eclipse
Viewing all 206 articles
Browse latest View live

Controlling local changes in ABAP code using eclipse

$
0
0

Hello,

 

In this post I would like to demonstrate one tool in eclicpse IDE that in my opinion is very usefully, the Local Version History.

 

Through this tool, we can control the changes in source code, before task or request is released. Eclipse record all modifications in source code automatically always we save our code, keeping this changes in a local history.

 

To use the local history is very simply, we only need do a right click in a our source code and in the context menu choose, team -> show local history

 

There you will can see all the modifications made in your code. Of course, this a local history, but can help in many situations.

 

You also can compare the versions, apply the changes etc.

 

 

Imagem_post4.jpg

Imagem_post5.jpg

Imagem_post6.jpg


Local storage of entities in Eclipse

$
0
0

Recently I have developed some CDS views in Eclipse and I would like to share the source codes in github. I am relunctant to manually copy the source code of each view one by one, as a result I am checking whether there are some folders in my local laptops where the source code are cached.

 

I spent some time to research and here is the result.

 

I have created three ABAP projects in Eclipse:

clipboard1.png

And in this location C:\Users\i042416\workspace_adt\.metadata\.plugins\org.eclipse.core.resources.semantic\.cache


How do I find the path "C:\Users\i042416\workspace_adt"? Just right click ABAP project and choose Properties from context menu, and choose Resource->Linked Resources:


clipboard2.png

I could see three folders correspondingly:

clipboard3.png

Enter the first folder and then there are four sub folders. The folder ddic just stores the source code of CDS views which I am looking for.


clipboard4.png

Every CDS view in Eclipse has a corresponding folder in local file system:

clipboard5.png

The asddls file within that folder just contains exactly the source code of CDS view, which could be opened via any text editor.

clipboard6.png

Then I could just upload those folders to github very conveniently to avoid the manual ctrl + c and ctrl + v

[Brainstorming] Translation Tools for ABAP in Eclipse

$
0
0

Last week I've been at the DSAG ABAP Developments Days in Walldorf. At the usual visit of the tapas bar in the evening we had a discussion about the translation of development objects in ABAP in Eclipse (ABAP Development Tools ADT). SAP currently suggests, that we use the SE63 to translate the objects after we finished our developments.

At least my "development workflow" looks a bit different: every time I've created a translation relevant object, for example a new message or text element, I immediately translate this object (let it be from German to English or vice versa, depends on my current project).

 

Let’s play Design Thinking and give the Persona a name:

Hello, my name is Uwe and I’m an ABAP developer. On a daily basis I’m working with translation relevant objects. This is how I’m currently working

 

1. Text elements

I’m using the following format, because no comment for text-xxx is needed

WRITE:/ 'This is just a test'(001).

With <f2> on the text I’m creating the element.

Image2.png

Marking the element and going to the translation are just two clicks away

Image3.png

After entering the text, save and exit I’m finished.

Image4.png

2. Messages

MESSAGE i002(ytestmsg) WITH 'Another test'(002).

<F2> on “i002” and the message will be created.

Again: after entering the text I’m going directly to the translation

Image5.png

Translate the text save and exit. Finished

Image6.png

 

3. Data element labels

After entering the last Field label I’m going immediately to the translation

Image7.png

Translate all text save and exit. Finished

Image8.png

 

Or do you have another translation procedure? Do you have in-house rules?

 

In Eclipse we currently have this situation: after <f3> on a non-existing text element or message we get

Image9.png

(Object not found. Creation via navigation not supported)

 

To be honest: I had to google where to find the text elements. Here you are:

Image10.png

The result is, that we end in the SAP GUI. Would be nice if we’ll get an Eclipse tool for text element, but that’s not part of this blog post.

 

Now my dear developer college it’s up to us to help SAP to “translate” this workflow to the Eclipse world.

 

Suggestion 1

a new Eclipse view which is active for every translation relevant object

 

Suggestion 2

a new tab in the properties view

 

 

Image11.png

 

Looking forward to your opinion. (and I promise you: SAP is listening )

 

You can find me on Twitter and G+

ATD / ABAP Eclipse with SAP ChaRM CSOL Multisystem landscape - Workarround

$
0
0

Hello

we are working in a multi system setup:

 

MaintDEV -> MainTST -> PRD

ProjDEV  -> ProjTST -> prePRD

 

To handle changes in the two dev Systems we have we use Solution Manager Retrofit and CSOL etc.

Now me an my colleges are in the situation that we have transports arrived on project test system where tests are ongoing. Fine.

 

For new features we need to enhance development objects that are still under test.

In ADT we end up with the Error message:

CSOL Error.png

So no possibility to change the source in Eclipse right away.  (The mentioned SAP note does not help, it is responsible for the Error)

 

Workaround:

 

Go to good old SE80, edit every method in form based view:

Csol_se80.png

confirm the Messages, if you know what you are doing

 

csol_info.png

 

unfortunately, this seems not to be possible in adt, what makes it a big hazzle for us to use it with objects that are under test.

 

I hopeThomas Fiedler  & Team will have a solution soon.

Any feedback is welcome on this topic.

 

 

Second Work around:

use TA: /n/tmwflow/lockmon in Solman to delete the locks. 

- be sure, you know what you do -

 

Best

Timo

Solve ABAP Eclipse / ADT & CSOL Warnings when using SAP ChaRM without modification

$
0
0

Disclaimer: This is a proposal of an SCN Member and not an authorized solution by SAP. Pls. be aware what you do!


Motivation

CSOL Error.png

In my Post I pointed out the Issue that #adt can not handle #csol warnings as #SE80 can. I described a workaround using #SE80 and another using a dirty technique in solutionamanger.

For us in the project this was not sufficient.

The goal is to "auto confirm" the CSOL warnings as we can do in #SE80. Due to project requirements this would be the only way in any case at the moment.

 

You can solve this using two Enhancements and a helper class:

 

Create helper-class:

CLASS zcl_000_adt_service DEFINITION

  PUBLIC

  CREATE PUBLIC.

 

  PUBLIC SECTION.

    CLASS-DATA:

      sv_adt_call          TYPE abap_bool VALUE abap_false,

      sv_csol_check_called TYPE abap_bool VALUE abap_false.

 

  PROTECTED SECTION.

  PRIVATE SECTION.

ENDCLASS.

 

CLASS ZCL_000_ADT_SERVICE IMPLEMENTATION.

ENDCLASS.

 

 

 

Detect if called via ATD in SADT_REST_RFC_ENDPOINT

Create an enhancement at the top of SADT_REST_RFC_ENDPOINT:

 

ENHANCEMENT Z_SADT_REST_RFC_ENDPOINT.    "active version

  **********************************************************************

* Enhancement to register an ADT call.

**********************************************************************

     LOG-POINT ID z000_sap_code_enhancement SUBKEY sy-cprog FIELDS 'Z_SADT_REST_RFC_ENDPOINT'. "Optional

     zcl_000_adt_service=>sv_adt_call = abap_true.

ENDENHANCEMENT.

 

Catch the CSOL message in function module TMW_PRJL_CSOL_CHECK when called from #adt

 

We did not want to do real modification, such that we used a recursive call within the enhancement of TMW_PRJL_CSOL_CHECK. After the recursion we can catch the message if we are called via #adt an ignore it. Create an enhancement at the top:

 

ENHANCEMENT Z_TMW_PRJL_CSOL_CHECK.    "active version

 

**********************************************************************

* Because the confirmation of CSOLocks is still not possible via ADT/Eclipse

* this enhancement helps on an interim basis.

*

* IF a CSOL conflict occurs the Solution Manager (second call of function

* module /TMWFLOW/CHECK_OBJECT_LOCK_CSL) returns a specific message. This

* message will be raised as LOCKING_NOT_ALLOWED.

*

* The conflict will be confirmed with including the object to a transport

* request which is known by the Solution Manager. So catching the specific

* message by a recursive call (depth 2) and ignoring it will cause an

* automatic CSOL conflict confirmation.

*

* To differ a call of function module TMW_PRJL_CSOL_CHECK by Eclipse/ADT and

* by an se80 session there is a flag, which is set by an enhancement of

* function module SADT_REST_RFC_ENDPOINT.

**********************************************************************

 

"   LOG-POINT ID z000_sap_code_enhancement SUBKEY sy-cprog FIELDS 'Z_TMW_PRJL_CSOL_CHECK'.   Optional

 

   IF zcl_000_adt_service=>sv_adt_call = abap_true AND

      zcl_000_adt_service=>sv_csol_check_called = abap_false.

    "AND

    "  new zcl_001_user_service( )->is_user_parameter_set( 'Z_AUTO_CSOL_CONFIRM' ) = abap_true.  "Nice to have

 

     zcl_000_adt_service=>sv_csol_check_called = abap_true. "stop recursion

 

     CALL FUNCTION 'TMW_PRJL_CSOL_CHECK'

       EXPORTING

         iv_request         = iv_request

         iv_suppress_dialog = iv_suppress_dialog

         it_objects         = it_objects

         it_keys            = it_keys

         iv_trfunction      = iv_trfunction

       IMPORTING

         ev_no_check_performed = ev_no_check_performed

       EXCEPTIONS

         locking_not_allowed     = 1

         warning_conflicts_exist = 2

         OTHERS                  = 1.

 

     zcl_000_adt_service=>sv_csol_check_called = abap_false.

 

      CASE sy-subrc.

 

        WHEN 0.

          RETURN.

 

        WHEN 1.

          IF sy-msgid = '00' AND sy-msgty = 'E' AND sy-msgno = '001' AND

             ( sy-langu = 'E' AND sy-msgv1 = 'Customizable CSOL conflict for objects changed in'  AND sy-msgv2 = ' other TR (Note 1591120)' ) OR

             ( sy-langu = 'D' AND sy-msgv1 = 'Anpassbarer CSOL-Konflikt für in and. TA geänderte' AND sy-msgv2 = ' Objekte (Hinw. 1591120'  ).

            "ignore/accept CSOL conflict => confirm CSOL conflict

            RETURN.

          ENDIF.

 

          "re-raise

          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 RAISING locking_not_allowed.

 

        WHEN 2.

 

          "re-raise

          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 RAISING warning_conflicts_exist.

 

      ENDCASE.

   ENDIF.

ENDENHANCEMENT.

 

 

Additional

 

in the line:

 

  "  new zcl_001_user_service( )->is_user_parameter_set( 'Z_AUTO_CSOL_CONFIRM' ) = abap_true. 

 

we placed some code to ensure that the auto confirm of #csol is only done for user who have set the set/get parameter accordingly.

This is what the coding does.

 

Conclusion

 

Now we have a #adt that "confirms" CSOL warnings immediately such that we can continue to work as normal in #adt.

Thomas Fiedler  and the ATD Team are aware of this issue and are working on a standard solution.

Be aware of the disclaimer at the top.

 

Kind Regards

Timo

 


How to learn to love AdT

$
0
0

[I started to write this as a comment on How to get your colleagues into ABAP in Eclipse but the figured it's probably better to start a blog post on my own]

OK, I know this is a old blog, but I just now stumbled across it (via Abap in Eclipse | AIE - Code Gallery - SCN Wiki , which is a very good resource, as well).

 

 

I'm in the process of learning to love Eclipse right now, so anything pointing out some cool features helps:

 

1. read about the features

2. try them out in a test-report

3. next time you get in a situation, where it is useful, use it in your real programming

--> the more often you make this experience ("wow, that's cool!") them more you will like the new tool. (And, as you pointed out Florian Henninger, if you colleagues see how easy you do $task, they might get eager to be able to use it, too).

 

The problem I sometimes have is, that I'd need to have it the other way round:

 

1. I do some real programming

2. I'd need a feature (I know how it would be done in SE80/SE24, it's really easy there!)

3. But I just don't know how to easily do it in Eclipse.

-> that's a little frustrating!

 

I give you an example I had yesterday: redefining a method:

In SE24:

1. click on redefine

2. code away

--> really, really, easy! (but only because I know what button to click, I'm aware of that!).

 

In Eclipse:

??? I don't know   ???

-> I'm sure it's just as easy, you just need to know the right way.

 

In situations like that, it would be good to have an AiE-Expert (well, just someone using it in her/his daily work) sitting next to you -> you could just ask.

 

Also, events like CodeJam on AdT are great -> remember the features you didn't find and let the experts and peers help you.

 

[Edit 2016-06-16: Of course: Use SCN! There are lot's of resorces here. E.g. I just had that question:  How can I trigger Code Inspector checks with ADT in Eclipse -  and as you see I found the answer easily (using the Content-Tab and the Text-Filter)!

]

 

I'd also suggest NOT to revert to the old way on the first obstacle - as with everything new you try to learn, there is a learning curve -> it usually pays out to go through it!

 

I guess mostly everyone reading this is already an AdT expert, but do you remember you first attempts and frustrating "I don't know how to do it "-experiences? Share them in the comments, if you like!

 

 

best

Joachim

 

PS: Having a total of 3 sad smileys in this blog, I think a should compensate, as in general I do like AiD and lerning new things, so here we go:

Viewing all 206 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>