Using abapGit on SAP GUI for Java – SOLVED!

When you try to add a new online repository using SAP GUI for Java, you will get weird error messages. That’s because the GUI can’t transport your Git parameters to the back end correctly.

To solve this problem, you need to modify ZABAPGIT_STANDALONE and use your Debug / Change skills.

Implement the following change; with your own username instead of mine:

      WHEN c_event-add_online_repo.

        " SAP GUI for Java fix {
*        mo_validation_log = validate_form( mo_form_data ).
*
*        IF mo_validation_log->is_empty( ) = abap_true.
*          mo_form_data->to_abap( CHANGING cs_container = ls_repo_params ).
*          lo_new_online_repo = zcl_abapgit_services_repo=>new_online( ls_repo_params ).
*          CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_repo_view
*            EXPORTING
*              iv_key = lo_new_online_repo->get_key( ).
*          rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page_replacing.
*        ELSE.
*          rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render. " Display errors
*        ENDIF.

        if sy-uname = 'X-KEREMKOS'.
          break-point. " Fill ls_repo_params here

          mo_form_data->to_abap( CHANGING cs_container = ls_repo_params ).
          lo_new_online_repo = zcl_abapgit_services_repo=>new_online( ls_repo_params ).
          CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_repo_view
            EXPORTING
              iv_key = lo_new_online_repo->get_key( ).
          rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page_replacing.

        else.
          mo_validation_log = validate_form( mo_form_data ).

          IF mo_validation_log->is_empty( ) = abap_true.
            mo_form_data->to_abap( CHANGING cs_container = ls_repo_params ).
            lo_new_online_repo = zcl_abapgit_services_repo=>new_online( ls_repo_params ).
            CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_repo_view
              EXPORTING
                iv_key = lo_new_online_repo->get_key( ).
            rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page_replacing.
          ELSE.
            rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render. " Display errors
          ENDIF.
        endif.
        "}

Activate, then execute ZABAPGIT_STANDALONE as usual; importing your online repository.

When you get to the break point, you will see that ls_repo_params is empty. That’s the bug we are trying to avoid. So; fill ls_repo_params with the same values.

And voila! The repository loads correctly!

Advertisement

Posted

in

,

by

Tags:

Comments

4 responses to “Using abapGit on SAP GUI for Java – SOLVED!”

  1. Gregor Avatar
    Gregor

    Have you filed this issue also at https://github.com/abapGit/abapGit/issues ?

    1. Dr. Kerem Koseoglu Avatar

      I did not, because they clearly state that SAPGUI for Java is not supported.

  2. Kjetil Kilhavn Avatar
    Kjetil Kilhavn

    I ran into this problem, used your solution to get abapGit set up, and found a better solution. There are still issues with GUI for Java, so the “not supported” bit cannot be removed yet, but at least I can now define new repositories without changing the abapGit source code.
    There is now a pull-request at abapGit for this non-filed issue 🙂

    1. Dr. Kerem Koseoglu Avatar

      Glad I could help! Thanks for the feedback.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s