abapgit 安装及使用

news2024/11/18 21:43:39

abapgit 需求 SA[ BASIS 版本 702 及以上

版本查看路径如下:

 

安装步骤如下:

1. 下载abapgit 独立版本 程序

链接如下:raw.githubusercontent.com/abapGit/build/main/zabapgit_standalone.prog.abap

2.安装开发版本

2.1 在线安装

    前置条件是你首先下载了GitHub 的证书,并且已经上传完成,步骤如下:

   注意:为预防不必要的安全问题发生,要求SAP下载中心的加密图书馆版本尽可能的等级更高

  查看方法如下:STRUST> Environment > Display SSF Version:

   

    ①.下载github的证书

     浏览器中输入 GitHub: Let’s build from here · GitHub

    

     按照顺序依次导出三个证书

     

② STRUST 安装证书

 

都导入成功会会出现中间证书列表。 最后点击保存 

③ SMICM 重启ICM

④ 测试 SSL证书是否安装完成

*&---------------------------------------------------------------------*
*& Report  ZABAPGIT_TEST_SSL
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT zabapgit_test_ssl.

* See https://docs.abapgit.org

********************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2014 abapGit Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
********************************************************************************

SELECTION-SCREEN BEGIN OF BLOCK sc_header WITH FRAME TITLE sc_titl1.
  SELECTION-SCREEN SKIP.
  SELECTION-SCREEN COMMENT 1(77) sc_txt1.
  SELECTION-SCREEN SKIP.
  SELECTION-SCREEN COMMENT /1(77) sc_txt2.
  SELECTION-SCREEN COMMENT /1(77) sc_txt3.
  SELECTION-SCREEN COMMENT /1(77) sc_txt4.
SELECTION-SCREEN END OF BLOCK sc_header.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN BEGIN OF BLOCK sc_serv WITH FRAME TITLE sc_titl2.
  PARAMETERS:
    p_url1 TYPE string LOWER CASE DEFAULT 'https://github.com' OBLIGATORY,
    p_url2 TYPE string LOWER CASE DEFAULT 'https://api.github.com',
    p_id   TYPE strustssl-applic DEFAULT 'ANONYM' OBLIGATORY.
* api.github.com is used when pushing code back to github
SELECTION-SCREEN END OF BLOCK sc_serv.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN BEGIN OF BLOCK sc_proxy WITH FRAME TITLE sc_titl3.
* proxy settings, fill if your system is behind a proxy
  PARAMETERS:
    p_proxy TYPE string LOWER CASE,
    p_pport TYPE string LOWER CASE,
    p_puser TYPE string LOWER CASE,
    p_ppwd  TYPE string LOWER CASE.
SELECTION-SCREEN END OF BLOCK sc_proxy.

CLASS lcl_report DEFINITION.

  PUBLIC SECTION.

    METHODS run
      IMPORTING
        iv_url TYPE string.

    METHODS display_response.

    METHODS f4_url
      RETURNING
        VALUE(rv_url) TYPE string.

  PRIVATE SECTION.

    TYPES:
      BEGIN OF ty_server,
        server TYPE w3server,
        url    TYPE w3url,
      END OF ty_server,
      ty_servers TYPE STANDARD TABLE OF ty_server WITH KEY server.

    TYPES:
      BEGIN OF ty_link,
        line     TYPE i,
        response TYPE string,
      END OF ty_link,
      ty_links TYPE STANDARD TABLE OF ty_link WITH NON-UNIQUE KEY line.

    DATA mt_links TYPE ty_links.

    METHODS display_error
      IMPORTING
        iv_text TYPE string.

    METHODS display_messages
      IMPORTING
        iv_response TYPE string.

    METHODS add_response_link
      IMPORTING
        iv_response TYPE string.

    METHODS get_servers
      RETURNING
        VALUE(rt_servers) TYPE ty_servers.

ENDCLASS.

CLASS lcl_report IMPLEMENTATION.

  METHOD run.

    DATA:
      lv_code          TYPE i,
      lv_url           TYPE string,
      li_http_client   TYPE REF TO if_http_client,
      lv_error_message TYPE string,
      lv_reason        TYPE string,
      lv_response      TYPE string.

    IF iv_url IS INITIAL.
      RETURN.
    ENDIF.

    cl_http_client=>create_by_url(
      EXPORTING
        url                 = iv_url
        ssl_id              = p_id
        proxy_host          = p_proxy
        proxy_service       = p_pport
      IMPORTING
        client              = li_http_client
      EXCEPTIONS
        argument_not_found  = 1
        plugin_not_active   = 2
        internal_error      = 3
        OTHERS              = 4 ).

    IF sy-subrc <> 0.
      display_error( 'HTTP Client Create' ).
      RETURN.
    ENDIF.

    IF p_puser IS NOT INITIAL.
      li_http_client->authenticate(
        proxy_authentication = abap_true
        username             = p_puser
        password             = p_ppwd ).
    ENDIF.

    li_http_client->send( ).

    li_http_client->receive(
      EXCEPTIONS
        http_communication_failure = 1
        http_invalid_state         = 2
        http_processing_failed     = 3
        OTHERS                     = 4 ).

    IF sy-subrc <> 0.
      display_error( 'HTTP Client Receive' ).

      li_http_client->get_last_error(
        IMPORTING
          message = lv_response ).

      display_messages( lv_response ).

      WRITE / 'Also check transaction SMICM -> Goto -> Trace File -> Display End'.
      RETURN.
    ENDIF.

* if SSL Handshake fails, make sure to also check https://launchpad.support.sap.com/#/notes/510007

    li_http_client->response->get_status(
      IMPORTING
        code   = lv_code
        reason = lv_reason ).
    IF lv_code = 200.
      WRITE: / iv_url, ': ok'.
    ELSE.
      WRITE: / iv_url, ': Error', lv_code, space, lv_reason.

      lv_response = li_http_client->response->get_cdata( ).

      IF lv_response IS NOT INITIAL.
        add_response_link( lv_response ).
      ENDIF.

      REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>cr_lf(1) IN lv_response WITH ``.

      display_messages( lv_response ).
    ENDIF.

  ENDMETHOD.

  METHOD display_error.

    WRITE: / iv_text, '- Error Number:', sy-subrc, /.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      DISPLAY LIKE 'I'
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

  ENDMETHOD.

  METHOD display_messages.

    DATA:
      lt_lines TYPE TABLE OF string,
      lv_line  TYPE string.

    SPLIT iv_response AT cl_abap_char_utilities=>newline INTO TABLE lt_lines.

    LOOP AT lt_lines INTO lv_line.
      WRITE / lv_line.
    ENDLOOP.
    SKIP.

  ENDMETHOD.

  METHOD add_response_link.

    DATA lv_link TYPE ty_link.

    WRITE / 'Display Error Response as HTML' COLOR = 6 HOTSPOT.

    lv_link-line     = sy-linno.
    lv_link-response = iv_response.
    APPEND lv_link TO mt_links.

  ENDMETHOD.

  METHOD display_response.

    DATA lv_link TYPE ty_link.

    READ TABLE mt_links INTO lv_link WITH TABLE KEY line = sy-curow.
    IF sy-subrc = 0.
      cl_abap_browser=>show_html(
        html_string = lv_link-response
        check_html  = abap_false ).
    ENDIF.

  ENDMETHOD.

  METHOD get_servers.

    DATA ls_server TYPE ty_server.

    ls_server-server = 'GitHub (Read Access)'.
    ls_server-url    = 'https://github.com'.
    INSERT ls_server INTO TABLE rt_servers.
    ls_server-server = 'GitHub (Write Access)'.
    ls_server-url    = 'https://api.github.com'.
    INSERT ls_server INTO TABLE rt_servers.
    ls_server-server = 'GitLab'.
    ls_server-url    = 'https://gitlab.com/test'.
    INSERT ls_server INTO TABLE rt_servers.
    ls_server-server = 'Azure DevOps'.
    ls_server-url    = 'https://dev.azure.com/<org>'.
    INSERT ls_server INTO TABLE rt_servers.
    ls_server-server = 'Bitbucket'.
    ls_server-url    = 'https://bitbucket.org'.
    INSERT ls_server INTO TABLE rt_servers.
    ls_server-server = 'Assembla'.
    ls_server-url    = 'https://git.assembla.com/<org>'.
    INSERT ls_server INTO TABLE rt_servers.

    SORT rt_servers.

  ENDMETHOD.

  METHOD f4_url.

    DATA:
      ls_server  TYPE ty_server,
      lt_servers TYPE TABLE OF ty_server,
      ls_return  TYPE ddshretval,
      lt_return  TYPE TABLE OF ddshretval.

    lt_servers = get_servers( ).

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
        retfield        = 'SERVER'
        window_title    = 'Git Server Selection'
        value_org       = 'S'
      TABLES
        value_tab       = lt_servers
        return_tab      = lt_return
      EXCEPTIONS
        parameter_error = 1
        no_values_found = 2
        OTHERS          = 3.
    IF sy-subrc <> 0.
      display_error( 'Server Value Help' ).
      RETURN.
    ENDIF.

    READ TABLE lt_return INTO ls_return INDEX 1.
    IF sy-subrc = 0.
      READ TABLE lt_servers INTO ls_server WITH KEY server = ls_return-fieldval.
      IF sy-subrc = 0.
        rv_url = ls_server-url.
      ENDIF.
    ENDIF.

  ENDMETHOD.

ENDCLASS.

DATA go_report TYPE REF TO lcl_report.

INITIALIZATION.
  sc_titl1               = 'Description'.
  sc_txt1                = 'This report tests the connection from this system to a Git server'.
  sc_txt2                = 'Select or enter the URL of the Git server and run the report. You can'.
  sc_txt3                = 'test two URLs at the same time, for example, if read and write'.
  sc_txt4                = 'access require different servers.'.
  sc_titl2               = 'Git Server'.
  %_p_url1_%_app_%-text  = 'URL (Read Access)'.
  %_p_url2_%_app_%-text  = 'URL (Write Access)'.
  %_p_id_%_app_%-text    = 'SSL Client Identity'.
  sc_titl3               = 'Proxy Settings (Optional)'.
  %_p_proxy_%_app_%-text = 'Hostname/IP'.
  %_p_pport_%_app_%-text = 'Port'.
  %_p_puser_%_app_%-text = 'Username'.
  %_p_ppwd_%_app_%-text  = 'Password'.

  CREATE OBJECT go_report.

AT SELECTION-SCREEN.
  p_proxy = replace(
    val   = p_proxy
    regex = 'http(s?)://'
    with  = ''
    occ   = 1 ).

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF screen-name = 'P_PPWD'.
      screen-invisible = 1.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_url1.
  p_url1 = go_report->f4_url( ).

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_url2.
  p_url2 = go_report->f4_url( ).

START-OF-SELECTION.
  go_report->run( p_url1 ).
  WRITE: /, '----', /.
  go_report->run( p_url2 ).

AT LINE-SELECTION.
  go_report->display_response( ).

至此 SSL证书安装算是完成了,我们开始在线安装开发版本的abapgit

    (1) 执行ZABAPGIT_STANDALONE 程序然后点击 new online

(2)   输入URL:  https://github.com/abapGit/abapGit/

  输入包名:$ABAPGIT

      如果包不存在,那么就先创建包。再创建连接,最后点击PULL

 2.2 离线安装

然后点击IMPORT ,点击PULL 即可

以上安装完成之后,那么就可以直接执行你的事务代码ZABAPGIT

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1270093.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

智慧公厕为城市智慧管理提供强力有的数据支持

在当今科技飞速发展的时代&#xff0c;城市管理正面临着前所未有的挑战与机遇。而在这个城市发展的脚步日新月异的同时&#xff0c;一项看似不起眼的技术却正在默默地为城市的智慧管理提供着强有力的支持——那就是智慧公厕。这些不起眼的公共设施不仅仅是人们日常生活的一部分…

Linux系统平均负载

我们经常会使用 top 命令来查看系统的性能情况&#xff0c;在 top 命令的第一行可以看到 load average 这个数据&#xff0c;如下图所示&#xff1a; load average 包含 3 列&#xff0c;分别表示 1 分钟、5 分钟和 15 分钟的 系统平均负载 系统平均负载&#xff1a; 如果将 …

多媒体信号处理复习笔记 --脑图版本

多媒体信号处理复习笔记 --脑图版本 依据 [2020多媒体信号处理复习笔记] 考前复习时使用Xmind制作 例图: PDF下载 BaiduYunPan 提取码&#xff1a;jbyw CSDN 下载

LeetCode2514.统计同位异构字符串数目

题目简单&#xff0c;关键是灵茶山艾府的代码写起来太优美&#xff0c;不得不记录一下 const int Mod 1e97; using ll long long; ll qmi(ll a,ll b,ll mod){ll res 1;while(b){if(b&1)res res*a%mod;aa*a%mod;b>>1;}return res; }class Solution { public:int c…

[黑皮系列] 计算机网络:自顶向下方法(第8版)

文章目录 《计算机网络&#xff1a;自顶向下方法&#xff08;第8版&#xff09;》简介作者目录前言配套公开课 《计算机网络&#xff1a;自顶向下方法&#xff08;第8版&#xff09;》 出版信息&#xff1a; 原作名: Computer Networking: A Top-Down Approach 作者: [美] Jame…

LangChain 15根据问题自动路由Router Chain确定用户的意图

LangChain系列文章 LangChain 实现给动物取名字&#xff0c;LangChain 2模块化prompt template并用streamlit生成网站 实现给动物取名字LangChain 3使用Agent访问Wikipedia和llm-math计算狗的平均年龄LangChain 4用向量数据库Faiss存储&#xff0c;读取YouTube的视频文本搜索I…

ApiSix的docker 容器化部署及使用

⼀&#xff0e;etcd安装 Docekr安装Etcd 环境准备 此处安装&#xff0c;是利⽤下载的 etcd 源⽂件&#xff0c;利⽤ docker build 构建完整镜像&#xff0c;具体操作如下&#xff1a; 1.环境准备 1.1. 新建⽂件夹 在磁盘某个路径下新建⼀个⽂件夹&#xff0c;⽤处操作 Dockerfi…

13:kotlin类和对象 -- 属性(Properties)

定义属性 类属性可使用var和val定义 class Address {var name: String "Holmes, Sherlock"var street: String "Baker"var city: String "London"var state: String? nullvar zip: String "123456" }属性使用 fun copyAddres…

00Hadoop数据仓库平台

在这里是学习大数据的第一站 什么是数据仓库常见大数据平台组件及介绍 什么是数据仓库 在计算领域&#xff0c;数据仓库&#xff08;DW 或 DWH&#xff09;也称为企业数据仓库&#xff08;EDW&#xff09;&#xff0c;是一种用于报告和数据分析的系统&#xff0c;被认为是商业智…

深度学习实现语义分割算法系统 - 机器视觉 计算机竞赛

文章目录 1 前言2 概念介绍2.1 什么是图像语义分割 3 条件随机场的深度学习模型3\. 1 多尺度特征融合 4 语义分割开发过程4.1 建立4.2 下载CamVid数据集4.3 加载CamVid图像4.4 加载CamVid像素标签图像 5 PyTorch 实现语义分割5.1 数据集准备5.2 训练基准模型5.3 损失函数5.4 归…

vuepress-----2、初体验

2、初体验 目标 创建GitHub账号创建Github项目初体验vuepress默认主体的首页 初体验 (opens new window) --- home: true heroImage: /hero.png heroText: Hero 标题 tagline: Hero 副标题 actionText: 快速上手 → actionLink: /zh/guide/ features: - title: 简洁至上deta…

mac安装homebrew/brew遇到443

文章目录 问题描述解决方法方法一方法二 参考文献 问题描述 brew 全称Homebrew 是Mac OSX上的软件包管理工具 想在mac终端安装&#xff0c;运行网上提供的指令 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)&quo…

【开源视频联动物联网平台】视频AI智能分析部署方式

利用视频监控的AI智能分析技术&#xff0c;可以让视频监控发挥更大的作用&#xff0c;成为管理者的重要决策工具。近年来&#xff0c;基于视频监控的AI分析算法取得了巨大的发展&#xff0c;并在各种智慧化项目中得到了广泛应用&#xff0c;为客户提供更智能化的解决方案。 然…

淘宝商品详情数据接口(店铺搬家、数据分析、代购商城、ERP选品、无货源铺货、品牌监控)

使用淘宝API接口需要以下步骤&#xff1a; 注册开发者账号&#xff1a;在淘宝开放平台&#xff08;https://o0b.cn/anzexi&#xff09;上注册一个开发者账号&#xff0c;并创建一个应用。 获取API密钥&#xff1a;在应用页面上获取API密钥&#xff0c;这是后续调用API接口的凭…

前端魔法:掌握动态 class,让网页元素随心所欲

前言 当你动态的添加类名&#xff0c;在某个变量匹配需求时自动切换到某个类名&#xff0c;实现其对应的效果。这个过程就是我们常说的动态 class&#xff0c;今天就和大家一起聊聊前端中的动态 class。 一、对象语法 1.1 绑定单个 class 我们可以传给 v-bind:class 一个对象&…

034.Python面向对象_综合案例

我 的 个 人 主 页&#xff1a;&#x1f449;&#x1f449; 失心疯的个人主页 &#x1f448;&#x1f448; 入 门 教 程 推 荐 &#xff1a;&#x1f449;&#x1f449; Python零基础入门教程合集 &#x1f448;&#x1f448; 虚 拟 环 境 搭 建 &#xff1a;&#x1f449;&…

linux用户管理_用户和组

2 用户管理 2.1 用户和组的基本概念和作用 2.1.1 账户实质 账户实质就是一个用户在系统上的标识&#xff0c;系统依据账户ID来区分每个用户的文件、进程、任务&#xff0c;给每个用户提供特定的工作关键&#xff08;如用户的工作目录、SHELL版本以及环境配置等&#xff09;&…

SDK emulator directory is missing

要进行uniapp真机测试&#xff0c;不得不安装配置一下安卓开发环境 &#xff0c;搞一个模拟器。。。然后又是各种坑。。对比来对比去还是IOS的环境使用着舒服&#xff0c;XCODE下载好&#xff0c;一切重点就是在编码了。。 安卓这个脑残货呀&#xff0c;哎&#xff0c;各种安装…

Springboot——HttpClient入门(Get和Post)

1. HttpClient 1.1 介绍 HttpClient 是Apache Jakarta Common 下的子项目&#xff0c;可以用来提供高效的、最新的、功能丰富的支持 HTTP 协议的客户端编程工具包&#xff0c;并且它支持 HTTP 协议最新的版本和建议。 HttpClient作用&#xff1a; 发送HTTP请求接收响应数据…

网站优化进阶指南:如何用Python爬虫进行网站结构优化

前段时间一个做网络优化的朋友找我&#xff0c;问我能不能通过爬虫的手段对他们自己的网络进行优化。这个看着着实比较新颖&#xff0c;对于从事爬虫行业的程序员来说&#xff0c;很有挑战性&#xff0c;值得尝试尝试。 说白了使用爬虫进行网站优化需要对网站的结构、内容、链…