Skip to Content
Technical Articles
Author's profile photo Johannes Huhn

Sample Scenario: SAP Analytics Designer API integration with SAP Analytics Cloud Calendar

Introduction

In fact, SAC’s calendar provides an integration into Analytics Designer. Analytic Applications can easily interact with SAC calendar processes and workflows via API. Moreover, Analytic Applications can programmatically participate in workflows to submit, approve or even reject SAC calendar events. Next to that, an Analytic Application can even create new workflows directly into the SAC calendar. The scenario in the video shown below will explain the capabilities along one scenario of Human Resources planning.

 

Video

Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Gabriel Berthion
      Gabriel Berthion

      thanks Johannes for this blog.

      If I well understood you were able tocreate a new composite task in the calendar "on the fly" when you created a new position.

      Is there any possibility for you to share the script used in Analytic designer please ?

      Thanks in advance

      Author's profile photo Aleksey Salinin
      Aleksey Salinin

      maybe this video will help you, starting at 06:41 about the Calnedar API script

      Planning Process with Analytics Designer

      Author's profile photo Gabriel Berthion
      Gabriel Berthion

      thanks Aleksey !!!

      Author's profile photo Johannes Huhn
      Johannes Huhn
      Blog Post Author

      Great you appreciate the content. I pasted the code snippet below to start a new workflow:

      var newTask = CalendarIntegration.createCompositeTask({
      	 name: "Approve new Headcount",
      	 startDate:new Date(Date.now() + 10000),	 
               dueDate: new Date(Date.now() + 259200000), //+3 days
      	 workFiles: [{ //one single file, the current opened file
      		 //id: Application.getInfo().id,
      		 id: '99183002E75E0E06CD6D1CE0193D526B',
      		 type: CalendarTaskWorkFileType.AnalyticApplication,		 
      	 }],
      	//each user is a string
      	assignees: ["SMILLER" , "MYUSER"]
      });
      Author's profile photo Gabriel Berthion
      Gabriel Berthion

      thanks Johannes. In the meantime I finally found a way and did that script and added 2 rounds for reviewers. I also added a "non member by email" but I don't ubderstand how it works. The non member received the email but he still needs an SAC access when clicking the link received by email.  Unfortunately, we cannot add viewers for the moment :

      CalendarIntegration_1.createCompositeTask({
           name: "newCompositeTask 1",
      	startDate:new Date(Date.now() + 10000),
      	
           dueDate: new Date(2022, 0, 16, 0, 0, 0),
           workFiles: [{
               id: Application.getInfo().id,
               type: CalendarTaskWorkFileType.AnalyticApplication,        
           }],
          assignees: [Application.getUserInfo().id], 
          description: "Calendar Composite Task description",
          reviewers: {
              "1": ["USER1", "xyz@gmail.com"] // email is a non member
              ,
              "2": ["USER2"]
              }   
          }, {
          autoActivate: true
      });
      Author's profile photo Ioannis Angelopoulos
      Ioannis Angelopoulos

      Thanks Johannes for your video it was really helpful!

       

      I am looking for a way to get the names of the assignees and reviewers through the Calendar API but I can't find the proper API statement for that.

      Seems like you can create a Composite Task but what about if you have an already created Composite task (via your calendar) and just want to see the assignees and reviewers in your Analytic Application? Essentially I want to have the same information as when I click calendar toolbar->details where I can see the people involved.

       

      Best Regards,

      Ioannis