Transport packages with one key stroke: install with TRM – Part 2
2023-12-12 22:2:37 Author: blogs.sap.com(查看原文) 阅读量:4 收藏

Today we’re going to see how transporting (or installing) a package from one system to another can be achieved using the open-source project TRM.

This is part 2 of 5 TRM related blog articles:

  • Part 1: Introduction
  • Part 2: Install your first package
  • Part 3: Publish your first package
  • Part 4: Dependencies
  • Part 5: Setup a CI/CD pipeline with Github Actions

Before we start…

On a personal note, I’d like to thank you for the interest in the project.

This goes to show that the SAP Open Source community is very active and welcoming new projects!

Your feedback was received and hopefully this and the upcoming articles about TRM will explain what can be achieved in a more detail (because let’s face it, introductions are boring, we want to see it action 😎).

TRM Setup

Currently, trm-client has only been tested on Windows: support for other operating systems will be provided in later development stages.

The setup for both client and server side packages is explained in the documentation.

To sum up, the requirements are:

Once all the requirements are installed, run the command

npm install trm-client -g

and you should be able to use the TRM CLI.

Connecting to your development system

TRM Cli can connect in three different ways depending on your scenario:

  1. Alias: a file with the system connection configuration is saved with login data and the user is prompted the name given during the alias creation
  2. Direct connection: you pass the connection configuration as arguments to the commands that require a connection
  3. SAP GUI Connections: a list of all the connections saved in your local SAP GUI is showed and the user must pick a system from the list

Installing hello-world

A full and in depth tutorial for this is available in the official documentation.

The first package we’re going to install with TRM is called “hello-world”: it contains a simple program with a WRITE command.

Source code of this package can be found on GitHub here:

https://github.com/RegestaItalia/trm-hello-world

To install the package, run the following command:

trm install hello-world

you’ll be prompted with

  • System connection
  • Input name for package
    • You should input the name of the devclass (SAP Package) that will be created on your development system. Inside, the content of the sample package will be placed. For this demo, you can use a temporary package named $TRM_HELLOWORLD.

The hello-world package should now be installed into your system.

You can view it with transaction SE80, and test the program ZTRM_HELLOWORLD with transaction SE38.

List and view commands

Other commands you can try after installing the hello-world package are list and view.

With the list command you can see all the packages installed in your system.

Simply run

trm list

After connecting to the system (like we did earlier) you should see the list of packages.

With the view command you’ll have more details about a package, like its manifest values.

Run

trm view hello-world

and connect to your development system again to see the command in action.

Notice how it’s also comparing the installed version with the latest available on the registry.

Demo

Wanna see this in action?

Here’s a demo!

Comparing packages between two systems

The compare command can be used to compare the same packages between 2 or more systems.

I’ve installed again hello-world, but this time I used a Z package (making it transportable), and manually imported the transport generated by TRM during install to QUA.

In this screenshot, I’m running the command

trm compare hello-world

in order to compare the hello-word package installed in DEV and QUA.

trm-server does not need to be installed into the QUA system for this command!

Conclusion

We’ve demonstrated how it’s possible to install a package into your SAP system with one keystroke.

Moreover, the package comes with a descriptor, giving the package a name and a semantic version: this enables an easy way for comparing package releases between multiple systems.

Now that we’ve seen how to install a package, let’s learn how to make one!

Next blog post: Publishing packages (Part 3).

If you want to know more about TRM, check out the official documentation.


文章来源: https://blogs.sap.com/2023/12/12/transport-packages-with-one-key-stroke-install-with-trm-part-2/
如有侵权请联系:admin#unsafe.sh