0% found this document useful (0 votes)
899 views4 pages

SAC Application Designer - ScriptVariable Calculated Measure OnInitialization - SAP Community

Uploaded by

ARPITA BISWAS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
899 views4 pages

SAC Application Designer - ScriptVariable Calculated Measure OnInitialization - SAP Community

Uploaded by

ARPITA BISWAS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
  • Introduction and Problem Description
  • Detailed Code Explanation
  • Community Answers and Expert Input
  • Engagement Rules and Conclusion

1/10/24, 9:37 PM SAC Application Designer - ScriptVariable Calculated Measure OnInitialization | SAP Community

Community

 Mark Your Calendars 


Mark Your Calendars with these Here’s what you need to know to prepare.
Important Dates. SAP Community is
moving in January 2024!

Ask a Question Write a Blog Post Login

Search Questions and Answers

Alexander Blasl
Sep 10, 2021 at 01:17 PM

SAC Application Designer - ScriptVariable Calculated Measure


1
OnInitialization
775 Views

Follow RSS Feed

Hi,

I have a an issue with refreshing/waiting of the values that are used in two charts.

In my first chart(Chart_1) I have a Calculated Measure(51805389-8222-4318-b069-992824982274)that uses a


ScriptVariable(ScriptVariable_WorkDay)in its Calculation that is beeing calculated OnInitialization:

var Workdays = Chart_0.getDataSource().getResultSet({"@MeasureDimension": "006EI34SHHHXV97BFEZ


var WorkdaysRW = Workdays[0]['@MeasureDimension'].rawValue;
ScriptVariable_WorkDay = ConvertUtils.stringToNumber(WorkdaysRW);

On the other hand I have a second Chart(Chart_2) that uses the ResultSet/rawValue of Chart_1 as another
Calcuated Measure(40644977-8839-4838-a889-240783914589) and gets the value from

https://answers.sap.com/questions/13479410/sac-application-designer-scriptvariable-calculated.html 1/4
1/10/24, 9:37 PM SAC Application Designer - ScriptVariable Calculated Measure OnInitialization | SAP Community

ScriptVariable(ScriptVariable_SalesPWPlan).

var Sales_Plan_PW = Chart_1.getDataSource().getResultSet({"@MeasureDimension": "51805389-8222-


var Sales_Plan_PW_VAR = Sales_Plan_PW[0]['@MeasureDimension'].rawValue;
ScriptVariable_SalesPWPlan = ConvertUtils.stringToNumber(Sales_Plan_PW_VAR);

That ScriptVariable(ScriptVariable_SalesPWPlan)is now the a part of the value of Calculated Measure(40644977-


8839-4838-a889-240783914589) that is used in Chart_2.

The Problem is now that I dont get the actual/refreshed value of the ScriptVariable_SalesPWPlan in Chart_2.

I made a button with the code like OnInitialization. Clicking the button once I get same effect as OnInitialization. But
when I click that button twice Chart_2 has now the right value. So I need some kind of "waiting" that the rawValue in
Chart_1 is updated and then put into the Calculated Measure of Chart_2.

Any ideas how I could get this done?

Add a Comment | Alert Moderator

Assigned Tags

SAP Analytics Cloud

SAP Analytics Cloud, analytics designer

JavaScript

Similar Questions 
How to get a rawValue of a Chart into a Script Variables Default Value?
Alexander Blasl Jul 22, 2021

SAP Analytics Cloud -Dynamic text modification


Neha Verma Dec 06, 2021

https://answers.sap.com/questions/13479410/sac-application-designer-scriptvariable-calculated.html 2/4
1/10/24, 9:37 PM SAC Application Designer - ScriptVariable Calculated Measure OnInitialization | SAP Community

1 Answer

Sort by: Votes | Newest | Oldest

Martin Kreitlein
Sep 14, 2021 at 01:37 PM

Hello Alexander,
0
I think this SAP Help page should help you:

https://help.sap.com/viewer/00f68c2e08b941f081002fd3691d86a7/release/en-
US/142a436d0f2a4e97a9af15853ca9b739.html

BR, Martin

Add a Comment | Alert Moderator | Share

 1 comment

Alexander Blasl Sep 17, 2021 at 12:13 PM

Hello Martin Kreitlein,

thanks a lot. Could you maybe share some Code ideas? I would need something like a queue. When calculation is done write it
into ScriptVariable, then after ScriptVariable is filled, start with next...
I am not sure how a timer could do that, because I dont know that exact loading times and dont want to wait longer.

BR

Alex
Like 0 | Share | Alert Moderator

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want
the poster to clarify the question or provide more information, please leave a comment instead, requesting
additional details. When answering, please include specifics, such as step-by-step instructions, context for
the solution, and links to useful resources. Also, please make sure that your answer complies with our Rules
of Engagement.

https://answers.sap.com/questions/13479410/sac-application-designer-scriptvariable-calculated.html 3/4
1/10/24, 9:37 PM SAC Application Designer - ScriptVariable Calculated Measure OnInitialization | SAP Community

Rules of Engagement 

Know someone who can answer? Share a link to this question.

You must be Logged in to submit an answer.

Please provide a distinct answer and use the comment option for clarifying purposes.

10 characters required.

Submit your Answer

Find us on

Privacy Terms of Use

Legal Disclosure Copyright

Trademark Cookie Preferences

Newsletter Support

https://answers.sap.com/questions/13479410/sac-application-designer-scriptvariable-calculated.html 4/4

(https://answers.sap.com/users/login.html?redirect_to=%2Fquestions%2F13479410%2Fsac-application-designer-scriptvariable-calc
1/10/24, 9:37 PM
SAC Application Designer - ScriptVariable Calculated Measure OnInitialization | SAP Community
https://answer
(https://answers.sap.com/users/login.html?redirect_to=%2Fquestions%2F13479410%2Fsac-application-designer-scriptvariable-calc
(mailto:?subject=%27SAP%20Community%27) (mailto:?subject=%27SAP%20Community%27) (https://instagram.com/sap/) (https://instag

You might also like