Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Karol-K
Advisor
Advisor
0 Kudos

The Situation

when you load a bookmark, your filters get modified. This is caused by the way how filters interact with variables and multiple data sources (last variable values wins after bookmark load). Example for this scenario - Bookmarks not work when more than one filter panel is used in an application

The Proposal

if you face such scenario, you can do following:

  • save your filter per data source somewhere - eg. hidden text component
  • save the bookmark

and on load:

  • load the bookmark (which also contains the hidden component with the filter values
  • apply the filter values explicitelly after the bookmark is loaded

Script for Save



// assure your filters are acutal
TEXT_FILTER.setText(DS_1.getFilterExt("0BC_PERS1"));
// save bookmark
var bookmark = Bookmark.saveBookmark();
// add on drop down
DROPDOWN_1.addItem(bookmark, DS_1.getFilterExt("0BC_PERS1"));

Script for Load


// load selected bookmark
var bookmarkId = DROPDOWN_1.getSelectedValue();
Bookmark.loadBookmark(bookmarkId);
// now, apply the saved filter from the hidden text
DS_1.setFilterExt("0BC_PERS1", TEXT_FILTER.getText());

General Information

you can use also such hidden fields to store yourselt any other information in the bookmark, as bookmark is saving everything what is in the application. More in Insides on Bookmarking blog.


Example App


An Application with example can be downloaded at the BIAPP Repository (name: SCN_STORE_RESTSTORE_FILTERS) :

I hope this helps.

3 Comments