Skip to Content
0
Apr 23, 2009 at 11:58 AM

Enhancing Save View button functionality

49 Views

Hi All,

I have a business requirement to enhance what the save view button currently does.

I will try to explain what we need to achieve.

As it stands the current Save View button just opens a new window requesting Description and Technical Name of the view and a tick box to Overwrite Existing View.

javascript:SAPBWOpenWindow(SAP_BW_URL_Get() + '&CMD=PROCESS_HELP_WINDOW&HELP_SERVICE=HW_SAVE_VIEW&item=QueryName', 'SaveView',500,250);

However this is not very practical from a user experience point of view, since they will not know the technical names of the views they are looking at from the Query View Selection web item (Selection box).

So what I attempted to do was to place the table from the dialog box into a hidden div element and when they click on the button show the div element and populate the technical name and description of the view they currently have displayed. :-

      function showPopup(p)
      {
        greyout(true);
        document.getElementById(p).style.display = 'block';
        var sel = document.getElementsByName("VIEWLISTDD")[0];
        var selIndex = sel.options.selectedIndex;
        var technam = document.getElementById("TECH_NAME_0"); 
        var desc = document.getElementById("DESCRIPTION_0");
        if (selIndex != 0) 
        {
        technam.value = sel.options[selIndex].value;
        desc.value = sel.options[selIndex].text; 
        }
      }
      function hidePopup(p)
      {
        greyout(false);
        document.getElementById(p).style.display = 'none';
      }

But the problem I have now is how to interact with the back end help service to be able to save the view either new or overwriting existing as it currently works.

I have tried replacing the FORM action with a onsubmit event and calling a new function as below :-

function saveview()
  {
     var template = SAPBWTemplateProp[9];
     document.VIEW.action = template+'&CMD=PROCESS_HELP_WINDOW&HELP_SERVICE=HW_SAVE_VIEW&ITEM=QueryName&SUBCMD=SAVE';
  }

But this doesn't work.

Essentially I need the help service to not open a new window but become part of the existing document so I can fill in the missing technical name and description dynamically.

Can anyone offer any help with this?

Thanks

Craig