Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
mateuszadamus
Active Contributor

Introduction


Hi and welcome to my next SAP Community blog post.

This time I come to you with an easy to implement enhancement, which will forever change your lives as ABAP developers. 😉

How many times have you struggled with the ToCs cluttering your list of transports in the Versions Management view? Now there is a solution to that issue. After implementing the steps shown below you will be able to filter out all ToCs and enjoy clean list of transports. Enjoy!

Implementation



  1. Enhance class CL_VERS_OBJTYPE_UI_ALV


    1. Add private attribute MV_HIDE_TOC with type FLAG and default value of ABAP_FALSE.


      MV_HIDE_TOC attribute




    2. Add public method TOGGLE_HIDE_TOC.


      TOGGLE_HIDE_TOC method



    3. Implement the method with code shown below.
      METHOD toggle_hide_toc.
      IF mv_hide_toc = abap_true.
      mv_hide_toc = abap_false.
      ELSE.
      mv_hide_toc = abap_true.
      ENDIF.
      ENDMETHOD.



    4. Add "Post-Exit" to standard method OBJ_VERSION_INFO and implement it as shown below.


      Post-Exit for OBJ_VERSION_INFO method



      METHOD ipo_yx_eo_vers_objtype_ui_alv~obj_version_info.
      *"------------------------------------------------------------------------*
      *" Declaration of POST-method, do not insert any comments here please!
      *"
      *"methods OBJ_VERSION_INFO
      *" importing
      *" !IV_RFCDEST type RFCDEST
      *" changing
      *" !ET_VERS type VRSD_TAB
      *" raising
      *" CX_VERS_UI_EXCEPTION .
      *"------------------------------------------------------------------------*

      CONSTANTS:
      lc_transport_number_local TYPE verskorrno VALUE 'LOCAL',
      lc_transport_type_toc TYPE trfunction VALUE 'T'.

      DATA:
      lv_tabix LIKE sy-tabix,
      ld_version TYPE REF TO vrsd,
      lt_trkorr TYPE SORTED TABLE OF trkorr WITH UNIQUE KEY table_line.

      CHECK core_object->mv_hide_toc = abap_true
      AND et_vers[] IS NOT INITIAL.

      SELECT trkorr
      INTO TABLE lt_trkorr
      FROM e070
      FOR ALL ENTRIES IN et_vers
      WHERE trkorr = et_vers-korrnum
      AND trfunction <> lc_transport_type_toc.

      LOOP AT et_vers REFERENCE INTO ld_version
      WHERE korrnum IS NOT INITIAL
      AND korrnum <> lc_transport_number_local.

      lv_tabix = sy-tabix.

      READ TABLE lt_trkorr TRANSPORTING NO FIELDS
      WITH TABLE KEY table_line = ld_version->korrnum.
      CHECK sy-subrc <> 0.

      DELETE et_vers INDEX lv_tabix.
      ENDLOOP.
      ENDMETHOD.




  2. Open report SAPLSVRS_UI.


    1. Go to screen 0101 and enter the USER_COMMAND_0101 module.
      At the end of the CASE statement (end of module) add modification as shown below.


      USER_COMMAND_0101 module modification



        WHEN 'TOC'.
      gr_vers_objtype_ui_alv->toggle_hide_toc( ).



    2. Go to GUI status "VER_STATUS" and enter edit mode. Add new function key "TOC" and populated its details.


      TOC function key




    3. Add the newly added function key to the application toolbar. Activate first the function key (Function Code button in the toolbar) and then the GUI status.


      Application toolbar with TOC function key






Enjoy!


Now you can easily hide/show ToCs when needed. Hope this helps!


Toolbar with the new button



List of transports w/ ToCs



List of transports w/o ToCs

20 Comments
Garcia
Advisor
Advisor
Hey mateuszadamus ,

I´m not a developer myself but also struggle in version management when going for root cause analysis/debugg. Thanks for sharing the knowledge.

Side note: it would have been ever better if you added a "Before/after" screen shot with an example.

All the best,
mateuszadamus
Active Contributor
0 Kudos
Hi gonalo.garcia

Thank you for taking the time to comment. I hope the presented enhancement will make your life easier. 🙂

Kind regards,
Mateusz
Chad_He
Participant
Maybe somebody care about what ToCs is just like me, you could refer to this blog.

Transport Management with Transports of Copies
BiberM
Active Participant
Nice Version of hiding existing ToC-versions.

Just for Sake of completeness: you can modify the TMS Parameter VERS_AT_EXP to not create a Version for ToC at all.
olegbash599
Active Participant

Very glad to meet someone who cares about TOC and version management 🙂 Thank you very much!

from my side solution was like that:

https://github.com/OlegBash599/ZCTS_BROWSER

The main idea was to create additional function module in update task, which is switching off version management.

  DATA lv_control_active TYPE string VALUE '(SAPLSVRY)VERSION_CONTROL_ACTIVE'.

FIELD-SYMBOLS <fs_ver_active> TYPE char1.

PERFORM zbc009_never_exist_form IN PROGRAM saplsvry
IF FOUND.

ASSIGN (lv_control_active) TO <fs_ver_active>.
IF sy-subrc EQ 0.
CLEAR <fs_ver_active>.
ENDIF.

and call it before function TRINT_RELEASE_REQUEST

https://github.com/OlegBash599/ZCTS_BROWSER/blob/master/src/zbc_009rep_transport_cls1.prog.abap#L417

no changes in standard code and no enhancement is needed.

mateuszadamus
Active Contributor
Hi Oleg,

Seems to me that you wrote a separate tool to handle the transports. Must have taken a lot of work and time.

Kind regards,
Mateusz
mateuszadamus
Active Contributor
0 Kudos
Hi Michael,

Setting the parameter would make so much sense. However, I failed to find any information about it. The only thing I found was the VERS_AT_IMP parameter.

Can you point me to the appropriate documentation?

Kind regards,
Mateusz
BiberM
Active Participant
There exists a Blog Post that mentiones the Parameter and the corresponding note

https://blogs.sap.com/2016/12/02/transport-of-copies-and-version-management-with-charm/

olegbash599
Active Participant
yes, you are correct.

but the tool allows me to transport from any developer IDE/interface: from WebDynpro, from UI5, from ecliplse, intelliJ idea;

actually the initial target was eclipse, because in case of using eclipse in traditional manner you should go to se09 (classic dynpro) and transport a copy if you need.
matt
Active Contributor
How many times have you struggled with the ToCs cluttering your list of transports in the Versions Management view?

Well... never. I actually find it useful, as it happens that a change is made, gets into test and an error is found to have been introduced. (Debugging is the art of removing errors, programming the are of putting them in! 😄 ). Using version comparison, I can then see what was likely to have caused that error.

Similarly with local versioning in Eclipse.

But, when we create a ToC, we have a tool that clearly identifies them as such in the description. The description is copied from the source transport and TOC SYSKnnnnnn is added at the end of the description.

 
mateuszadamus
Active Contributor
0 Kudos
Thanks michael.biber2 , this is very helpful!
mateuszadamus
Active Contributor
0 Kudos

Hi matthew.billingham

Thanks for the comment.

I use version management on a daily basis and, like you said, it is a very useful feature, one that I could not work without. However, having a ToC version added to an object which was not changed, but "sits" in a transport of a larger solution, which is moved for tests multiple times creates a lot of "noise" in the version management list and makes it unreadable. Regardless if the description has a "TOC" prefix or not.

At least that's my personal experience.

Kind regards,
Mateusz

fabianlupa
Contributor
0 Kudos
Hmm, I thought this functionality was already available in SAP Standard. Or what does this button do?

fabianlupa
Contributor
0 Kudos
Nevermind, the button is inactive on non SAP internal systems 😞 (LSVRS_UIU01 line 109)
matt
Active Contributor
0 Kudos
I do see what you mean. For some of our objects there are hundreds of version reaching far back in time and, indeed a lot of noise (generated by standard transports). But it never really bothered me.

But what do you do when the object you're interested in has actually changed in a ToC.  You won't know.
mateuszadamus
Active Contributor
If something has changed between ToCs this means that the task is still in the development phase. Someone is still testing it, someone is still developing it. It's a rare situation that more than one developer works on the same object at the same time. And if it's changed by the original developer than they probably know the background of the change and the history of it.

And in case they want to keep the "old" version they can always generate the temporary version manually, e.g.: before making a big adjustment or refactoring the code.

Anyways, the purpose of this enhancement is to hide ToC transports per user's request, if they find the list too obscure. It does not disable ToC transports or ToC versions generation.
matt
Active Contributor
That's what's great about Eclipse - it keeps local versions. No need to make a temporary version.
mateuszadamus
Active Contributor
0 Kudos
I must say Eclipse has many advantages and is a step in right direction, but (and for me it is a big BUT) it is too slow. It loads for an eternity (at least on Citrix), and then it is still slow. I blame Java for all that. Which does not change the fact, that I use it only when I'm forced to (AMDP, CDS).

Would be nice to have VS Code as the main IDE.
matt
Active Contributor
I don't use Citrix and have no performance issues at all, so my guess is it's a Citrix issue.

I did have a problem with it taking ages to load - hence my blog: https://blogs.sap.com/2019/06/07/installing-lean-eclipse-with-adt/

Maybe this blog about VS and ABAP would be useful for you: https://blogs.sap.com/2019/12/06/abap-development-in-vs-code/
mateuszadamus
Active Contributor
I saw the blog about ABAP in VS Code, but since it is a Citrix environment I'm not able to install anything on my own there.

Anyways, this is a subject for a different blog post, I saw your already had one 🙂
https://blogs.sap.com/2022/06/24/eclipse-adt-vs-sap-gui-editor/