Hello everyone,

So as a continuation of the previous blog post I would like to take it further and go a bit more into the details for performing various operation on the input enabled queries. Such as Recalculate, Save and Reset to Client/server.

If you havent had a chance to go through my first blog yet, you may do so here : #1 Planning in Design Studio 1.3

  1. You have the following methods available via script editor which you can use in your planning application :

/wp-content/uploads/2014/05/4_463239.png

2.  Let’s create one button for each function and see how we can use each of them

/wp-content/uploads/2014/05/5_463240.png

Each button has the following script assigned to it respectively :

     a. Recalculate :

     Planning.recalculate();

   b. Save :

     Planning.save();

   c. Server Reset :

     Planning.reset();

   d. Client Reset :

     Planning.clientReset();

   e. Check unsaved changes :

if ((Planning.hasUnsavedChanges() == true)) {

   APPLICATION.alert(“Application has unsaved changes”);

} else {

   APPLICATION.alert(“Application does not have any unsaved changes”) ;

}

     f. Check not recalculated client Changes :

if ((Planning.hasClientChanges() == true)) {

   APPLICATION.alert(“Application has client(not recalculated) changes”);

} else {

   APPLICATION.alert(“Application does not have any client(not recalculated) changes”) ;

}


3. Now let’s look into the working of each method :

a. Initial view of the application :

  /wp-content/uploads/2014/05/6_463251.png

b.     Let’s change the Current salary value for Employee ID = E06 to 1000 EUR and then click on recalculate button

     /wp-content/uploads/2014/05/7_463252.png

         Result : you can see that the value gets changed and is updated in the Result for Employee ID E06 as well.


c.     Click on save and the new data gets saved in the backend. Every time you refresh the application now, always the newly saved data will be reflected for the data source in the application.

d.     There are two reset methods, one is the server reset and the other is the client reset.

Server Reset :

This is to take you to the last unsaved state of the data for your input enabled query.

Client Reset:

This is mainly to go back to your last recalculated state.

You can check this by changing some value in any of the input fields, say change the value of salary of employee E11 to 2000 Euro and click on recalculate.

Now click on server reset and you will see the value will be set back to the last unsaved state i.e. 1 EUR

Similarly in order to check Client reset again change the value of salary of employee E11 to 2000 Euro and recalculate and then change it to 3000 but do not recalculate this time.

Now click on Client reset and you will see the value will be set back to the last client (not recalculated) state i.e. 2000 EUR

e.    hasUnsavedChanges and hasClientChanges:

These two methods are mainly to check whether there are any unsaved or client(not recalculated) changes currently in your application respectively.

hasUnsavedChanges :

To check this lets change the value of salary of employee E11 to 2000 Euro and click on recalculate.

Now click on the button “Check unsaved changes”.

Based on the scripting done earlier, You will get the alert message :

/wp-content/uploads/2014/05/8_463262.png

Now click on the button Server Reset and hit the button “Check unsaved changes” again.

Based on the scripting done earlier, You will get the alert message :

/wp-content/uploads/2014/05/9_463263.png

hasClientChanges :

Similarly now change the value of salary of employee E11 to 2000 Euro and do not recalculate.

Now click on the button “Check not recalculated client Changes”.

Based on the scripting done earlier, You will get the alert message :

                    /wp-content/uploads/2014/05/10_463264.png

Now click on the button Client Reset and hit the button “Check not recalculated client Changes” again.

Based on the scripting done earlier, You will get the alert message :

                    /wp-content/uploads/2014/05/11_463265.png

RELATED:

#1 Planning in Design Studio 1.3

To report this post you need to login first.

8 Comments

You must be Logged on to comment or reply to a post.

  1. S K

    Hi Kriti, Thanks for sharing, I’ve started developing a planning application (Adhoc Analysis as a template with panels) with two tabs (two different datasources) – the application have “Export to Excel, CSV, Print, Filter, Navigation, Save  etc) works well when I am on Tab 1. When I switch to second tab all the above buttons still pointing to Tab1 Data source, can you please let me know how to make respective datasource active while switching the Tabs.

    (0) 
    1. Kriti Paliwal Post author

      Hi Sai,

      Is your question wrt input enabledness of the datasource or the actions of the Excel, csv etc buttons in your application?

      (0) 
  2. Daniel Scheiner

    Hello Kriti,

    can you tell me: what type of data (JSON, etc.) does the SAP Standard Crosstab use? (when fed with data by a query on top of a aggregation level)

    And how can this data be accessed or changed before writing it back to the server, e.g. via Planning.save()?


    Thank you sincerely!

    Yours,

    Daniel

    (0) 
    1. Kriti Paliwal Post author

      Hi Daniel,

      I am not sure i understand what you mean.

      What would you like to do with the data? Could you tell me the use case?

      Best Regards,

      Kriti

      (0) 
  3. Wenjing Zhou

    hi Kriti,

    I use the exactly same code with your’s, and I encountered a problem, after I change data in the table, then click “copy” button to call an planning sequence to save it to the backround, then click “save” button to call planning.save(). the first time is ok, but if I want to change data in the table for the second time, when I click “copy” button, it shows an Error: “Error during script processing.Contact the Application Designer to resolve the issue”.  only when I re-run the app or refresh the web ,it can process the script again.

    Do you have any suggestion´╝č

    Thank you sincerely!

    Wendy

    (0) 
  4. Aaron Benner

    Hi Kriti,

    Have you compared the operation of the planning / input enabled functionality in DS between the NW and BO versions?  We are having issues enabling the planning functionality in BO , whereas the NW version works correctly (same dashboard just different platform launch).

    Aaron

    (0) 
  5. S K

    Hi Kriti,

    The Copy and Paste is a key function in SAP BW IP world which is available in WAD (Java script) from long time,  Most of our users prefer to use Copy and Paste functionality instead of punching data in each and every input cell. Just wondering if you have any information bringing this functionality to SAP Design studio.

    Thanks

    SAI

    (0) 

Leave a Reply