Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

Time:2021-10-20

SAP ABAP consultants and friends should have used saplink. If two ABAP NetWeaver systems do not establish transmission paths, we cannot use the standard se10 transaction code to create transmission requests for code transmission between the two systems. At this point, saplink has a place to play.

Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

Saplink is simply a collection of reports and a series of plug-ins. If we expect to transfer code between systems a and B, the steps are:

(1) Install saplink on both systems a and B, that is, manually create a report, and then copy the source code from the GitHub of saplink to activate it:
https://github.com/sapmentors…

(2) Execute saplink on system a and export the code you want to transfer into a local file.

(3) Execute saplink on system B to import the local file generated in the previous step.

Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

There are too many introduction articles of saplink on the network, so this article will not repeat them.

After the cloud era, the code version management of SAP cloud platform ABAP programming environment chose git based on abapgit, an open source project.

Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

Let’s follow Jerry and learn how to do it through a simple example.

The scenario of Jerry’s example is that I developed some ABAP code in the ABAP on premises system Ag3. I want to import these ABAP codes on the on premises system into the sap cloud platform ABAP environment through abapgit.

(1) First, find the source code of abapgit in the GitHub warehouse and copy it to the on premises system.

Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

Run the report after activation. The interface is as follows:

Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

(2) The ABAP code on the on premises system cannot be directly pushed to the sap cloud platform ABAP environment. A transit station, namely the code warehouse on github.com, is required. To this end, Jerry creates a new code warehouse: Test SAP ABAP cloud

Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

(3) Go back to the abapgit report of the on premises system, click the online hyperlink in the toolbar to establish an association with the GitHub warehouse created in step 2.

Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

The above figure means that the newly created development package in the on premises system, the code in $zjerry package, will be associated with the test SAP ABAP cloud warehouse of github.com.

Because no code has been created in my development package, no resource files related to ABAP code are displayed in abapgit except the package description XML file.

Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

(4) Now I create a hello world report in the on premises system:

Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

Go back to the abapgit in the on premises system and refresh. At this time, you can see the ABAP report I just created.

Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

Like the GIT client for Mac or windows, I first use abapgit to push the Hello World Report created by the on premises system to github.com:

Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

Maintain a push comment casually, such as the first commit from Jerry’s abapgit:

Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

After the successful push, the warehouse on GitHub can now see the report code and push comments just pushed from the on premises system: the first commit from Jerry’s abapgit
https://github.com/i042416/te…

Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

(5) Now we can import the code from the github.com repository into the sap cloud platform ABAP environment. Install the abapgit plug-in for ABAP development tools at eclipse.abapgit.org/updatesite

Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

After installation, open the abapgit view:

Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

Log in to the sap cloud platform ABAP programming environment and click the link button:

Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

Enter the warehouse address of github.com: https://github.com/i042416/te…

Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

Specify the package zjerry in the ABAP environment of SAP cloud platform to store the ABAP code from github.com:

Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

When we see the entry marked as imported in the abapgit view, it indicates that the import is successful. However, in the development package zjerry of SAP cloud platform ABAP environment, I didn’t see the Hello World Report in the on premises system. What’s the matter?

Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

Originally, in the sap cloud platform ABAP environment, there are only the following five carriers that allow developers to write ABAP code. ABAP reports created through se38 in the on premises environment are not supported. If we create an ABAP class in the on premises system, through the steps described in this article, we can successfully import the sap cloud platform ABAP environment and continue to develop on it.

Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

In the ABAP programming environment of SAP cloud platform, if we want to simulate the reports created in the on premises environment se38, we can create and implement the interface if_ OO_ ADT_ Classrun’s ABAP class.

Right click this category and select run as ABAP application (console).

Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

I hope this article can deepen your understanding of the concept of code management in SAP cloud platform ABAP environment through git in the figure below. Thank you for reading.

Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment

More reading

  • Jerry’s ABAP, Java and JavaScript stew
  • What should ABAP developers learn in the future
  • Jerry’s May Day holiday in 2017: ABAP implementation of 8 classical sorting algorithms
  • Jerry’s collection of ABAP original technical articles
  • 300 lines of ABAP code implement the simplest blockchain prototype
  • Use java + SAP cloud platform + SAP cloud connector to call functions in ABAP on premise system
  • Consume ABAP on premise OData service in the cloudfoundry environment of SAP cloud platform
  • ABAP vs Java, breaststroke vs freestyle
  • Talk about C language and ABAP
  • Use ABAP channel to develop some small tools to improve daily work efficiency
  • The boring things I’ve done with ABAP
  • Don’t like SAP GUI? Try eclipse for ABAP development
  • Writing and activating ABAP code using Visual Studio code
  • Did your ABAP program give light to the Buddha? Let’s try Jerry’s trick
  • Write the first ABAP program on the ABAP programming environment of SAP cloud platform
  • ABAP programming specification officially issued by SAP
  • Do you know the hidden functions of ABAP code inspector?
  • Are you still using ABAP for secondary development of SAP products? Let’s learn about this new concept of secondary development
  • Those parasitic programming languages in ABAP NetWeaver
  • Start with a blog on the sap community and talk about the feelings behind the naming of SAP products
  • ABAP restful service development in the cloud
  • How to expose CDs view as OData service in ABAP programming environment of SAP cloud platform

For more original articles on Jerry, please pay attention to the official account of “Wang Zixi”:
Use abapgit to transfer code between ABAP on premises system and SAP cloud platform ABAP environment