Skip to Content
Technical Articles
Author's profile photo Rohit Chouhan (Deloitte)

SAP Widget CLI Package: Simplifying SAP Widget Creation and Management

The SAP Widget package is a Node.js module designed to help developers create and use SAP widgets in their applications. With this package, developers can easily create, configure and use SAP widgets, and export them to various platforms, such as SAP Launchpad, SharePoint, and others.

preview

In this tutorial, we will cover the steps required to install and use the SAP Widget CLI package. We will start with the installation process and then move on to the various functionalities that can be achieved using the SAP Widget package.

Prerequisites:

Before we begin, you will need to have the following installed on your system:

  • Node.js
  • npm (Node Package Manager)

Installation:

To install the SAP Widget CLI package, follow these steps:
1. Open your terminal or command prompt.
2. Type the following command:

npm install -g sapwidget

3. Press Enter. npm will now download and install the SAP Widget package and all its dependencies globally on your system.

4. Now Just type sapwidget in CMD normally and check its installed or not.

YouTube Tutorial Video:

Usage:

Once the SAP Widget CLI package is installed, you can start using its functionalities by typing “sapwidget” in your terminal or command prompt. This will display the available commands and their descriptions.
Here are some of the most common commands that you can use with the SAP Widget CLI package:

There is few commands for sapwidet

  1. create
  2. props
  3. start
  4. export

1. create

This command is used to create a new SAP widget. You can pass in various parameters to customize the widget’s appearance and behavior.
Here’s an example of how you can use this command:

sapwidget create my-widget

In the above code, we are calling the create command and passing in various parameters such as the widget name, application ID, URL, width, height, language, and theme.

2. props

This command is used to add new property in project.
Here’s an example of how you can use this command:

sapwidget props color

In the above code, we are calling the props command and passing in the widget name, as well as the new width and height values that we want to update.

3. start

This command is used to start a local server to test the SAP widget.
Here’s an example of how you can use this command:

sapwidget start

In the above code, we are calling the start command and passing in the widget name, as well as the port number that we want to use to start the local server.

4. export

This command is used to export the SAP widget for production.
Here’s an example of how you can use this command:

sapwidget export

In the above code, we are calling the export command to export widget project for production, make sure you must have github account to export and load project to your repository.

Conclusion

In this tutorial, we have covered the steps required to install and use the SAP Widget CLI package. We have also covered some of the most common commands that you can use with this package to create, configure and export SAP widgets. With the

 

Assigned Tags

      3 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Bob Pfeiffer
      Bob Pfeiffer

      Nice, always wanted to create something like this, but didn't find the time to finish it. Will probably give some more detailed feedback in the repo later 🙂

      Also, you should consider renaming your project to not contain SAP in the name. Most companies including SAP don't "like" this as it could lead to confusion about the author and rights and so on.

      Author's profile photo Rohit Chouhan (Deloitte)
      Rohit Chouhan (Deloitte)
      Blog Post Author

      Hey Bob,

       

      Feel free to contribute to https://github.com/rohit-chouhan/sapwidget 🙂

       

      Thanks.

      Author's profile photo Rohit Chouhan (Deloitte)
      Rohit Chouhan (Deloitte)
      Blog Post Author

      Hey Bod, Happy to heared from you.

       

      Feel free to contribute 🙂

      Repository: github.com/rohit-chouhan/sapwidget

       

      Thanks