SAP Datasphere Command Line Interface as a project accelerator

Irvin

Written By: Irvin - 21 March 2024
(updated on: 05 July 2024)

The Command Line Interface (CLI) is an API developed by SAP for programmatic interaction with SAP Datasphere. The areas of application can include, among other things, generating objects and orchestrating ETL processes. This results in some interesting use cases that you can use in your projects. In this article, we explain the general procedure and provide examples from our practice.

SAP Datasphere offers users from the business department an intuitive, easy-to-use interface. However, developers need a programmatic interface to interact with the system in order to automate recurring tasks. For this purpose, SAP offers access via the command line. This is implemented in the form of a Node.js package, which you can download via the Node Package Manager (npm) from https://www.npmjs.com/. Below we will look at some examples.

Generating views automatically

This allows you to use the command line interface to read the definitions of Datasphere objects such as tables and views using a local Python script and also to generate new objects. The definition of objects is transferred in CSN / JSON format. We have successfully used this approach to automatically generate a view for each remote table.

generate-objects_Command_Line_Interface

 

Orchestration of task chains

Another area of application is the orchestration of task chains. Task chains make it possible to group several tasks and execute them regularly. Task chains are the Datasphere counterpart to process chains in SAP BW.


Download the whitepaper and find out
which product is best for your data warehousing strategy

Neuer Call-to-Action


Here you can use the command line interface to start task chains from an external program. You can also specify that a task chain should be started depending on a specific event. Furthermore, you can use this interface to query the status of a task chain and start another task chain once the previous one has been successfully completed.

orchestrate-task-chains_Command_Line_Interface

 

Other areas of application

Unfortunately, there are also some restrictions on the use of the interface. Not all Datasphere functions are supported. For example, it is not yet possible to create task chains via the command line interface. However, you can tap the HTTP POST request that SAP Datasphere itself uses and transfer this to the system. This allows you to work around possible restrictions.

deploy-task-chains_Command_Line_Interface

 

Command Line Interface - Our Summary

With Command Line Interface (CLI), SAP provides a powerful tool for automating recurring tasks. This allows you to reduce project runtimes and save costs. Possible areas of application include the creation of Datasphere objects and the orchestration of task chains.

However, there are currently still some restrictions. In these cases, you can use the HTTP POST method.

Do you have questions about SAP Datasphere? Are you trying to build up the necessary know-how in your department or do you need support with a specific issue? Please do not hesitate to contact us.

Learn more about  SAP Datasphere

Topics: SAP Data Warehouse, Datasphere

Share article