cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding a web item through the command line URL

Former Member
0 Kudos

We use the Web API and command line processing heavily to pass in different filter values, variable values, data providers, etc. to our web reports. I had a requirement within a given area to launch our web reports with the Navigation block visible on the web template. In our commonly used 'default' web template, we currently allow the users to switch this item on/off once they are in the report, but we always have it come up Hidden initially.

My question is this: is there some trick to getting a web item property changed dynamically at execution time from Hidden=X to Hidden= ? I have tried numerous attempts to format a URL to change this behavior, but have been unsuccessful. A sample would be: &ITEM=GR6&MULTI=X&HIDDEN= --> this is intended to make all items with 'GR6' in the name unhidden. But in my case, it ends up making more web items visible than I want. Even specifying the Item name directly does not help.

I have also tried applying it in conjunction with a command sequence from the Web API docs. Is there a particular command that this has to go with (i.e. LDOC? RESET_WEB_ITEM? etc.)? We have a button on the web template that issues the command <SAP_BW_URL ITEM='GR6' MULTI='X' HIDDEN=''> when clicked -- this works fine. How do I apply the same type of logic to the initial URL within the command processing?

Any help would be appreciated. I know that I can resolve this by just creating a copy template with this web item set to Visible instead of Hidden at the launch. I was just thinking I could reuse the main web template and control it through the URL.

Thanks...

Jody Chassereau

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Joseph,

you would need to use a command sequence for this:

cmd=ldoc&template_id=yourTemplate&cmd_1=item%3dyourItem%26hidden%3d

please see

http://help.sap.com/saphelp_nw04/helpdata/en/71/6c013a53271a05e10000000a11402f/frameset.htm

for further information on command sequences.

Heike

Answers (1)

Answers (1)

Former Member
0 Kudos

Heike,

Thank you very much for your reply. While I have used command sequences many times in the past, I was just having trouble getting the exact syntax to make this change. Part of my confusion was that I thought the CMD_1 piece would have needed a separate CMD statement to go with it (e.g. as we have used when doing EXPAND, FILTER, etc.). Another problem I had was that I was trying to launch some test links to debug this from MS Word & apparently some of my changes were not behaving correctly as hyperlinks. Anyway, all it takes is one small syntax error to invalidate the results.

I am now able to get the intended command working with:

&CMD_1=ITEM%3DGR6%26MULTI%3DX%26HIDDEN%3D appended to the URL. Thanks again for your response & I have awarded your points...

Jody Chassereau

Former Member
0 Kudos

Heike,

maybe you can help me out on this one:

I'm trying to implement Tobias Kaufmann's How To Paper <i>Web Printing with Excel</i>.

Before calling the respective Abap classes from my web template, I want to hide the web item <i>Hierarchical Filter Selection</i> as this one comes out ugly when downloaded to Excel. So what I'm doing is, I first hide the Filter Selection and then call the Abap classes.

Here is the coding that I am using:

<!-- Web Print with Excel-->
<td class="SAPBEXNavLine"><A href="<SAP_BW_URL
 CMD_1='Item=HIERCONTEXTMENU_1&HIDDEN=X'
CMD_2='CMD=PROCESS_HELP_WINDOW&HELP_SERVICE=HELP_SERVICE_PRINT&ITEM=Table_1&SUBCMD=PRINT_EXCEL'>">
<IMG  alt="Web Print with Excel" src="/sap/bw/Mime/bex/icons/print.gif" border=0></A></td>

This coding is working fine.

The problem is however, that the <i>Hierarchical Filter Selection</i> is now hidden in my web template. To unhide it, I thought I'd use the coding as above, but add a third command (CMD_3) to make that item visible again.

Here is the coding:

<!-- Web Print with Excel-->
<td class="SAPBEXNavLine"><A href="<SAP_BW_URL CMD_1='Item=HIERCONTEXTMENU_1&HIDDEN=X'
CMD_2='CMD=PROCESS_HELP_WINDOW&HELP_SERVICE=HELP_SERVICE_PRINT&ITEM=Table_1&SUBCMD=PRINT_EXCEL'
CMD_3='Item=HIERCONTEXTMENU_1&HIDDEN='>">
<IMG  alt="Web Print with Excel" src="/sap/bw/Mime/bex/icons/print.gif" border=0></A></td>

Unfortunately, only the commands CMD_1 and CMD_3 are being executed (which is kind of useless), the main command CMD_2 however is not.

Do you have any idea why this is happening and how to avoid this?

Really appreciating your help,

Regards,

Yogen

Former Member
0 Kudos

Hi,

I found some sort of solution, if not the answer.I think the problem has something to do with the fact, that CMD_3 is executed before CMD_2, thus 'invalidating' CMD_2. This is probably so, because calling the Abap classes in CMD_2 takes much longer than hiding/unhiding a web item in CMD_3.

What is needed here is some sort of delay before CMD_3 is executed.

I implemented this, using the following two JavaScript functions:

function showItem(){
SAPBWOpenURL(SAP_BW_URL_Get()
+"&CMD_1=Item%3dHIERCONTEXTMENU_1
%26Hidden%3d");
}
function webprint(){
SAPBWOpenURL(SAP_BW_URL_Get()+"&CMD_1=Item
%3dHIERCONTEXTMENU_1%26Hidden%3dX&CMD_2=CMD
%3dPROCESS_HELP_WINDOW%26help_service%3dHELP_SERVICE_PRINT
%26ITEM%3dTable_1%26subcmd%3dPRINT_EXCEL");

window.setTimeout("showItem()", 15000);
}

The delay shouldn't be set too short. I'm using a delay of 15 seconds.

Cheers,

Yogen