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!

4 thoughts on “Using abapGit on SAP GUI for Java – SOLVED!

  1. 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 🙂

Leave a Reply to Kjetil Kilhavn Cancel 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 )

Google photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s