cancel
Showing results for 
Search instead for 
Did you mean: 

Using URL to Sort Values

Former Member
0 Kudos

Hi,

I am using Web Application Designer. I have a table which has a column of numbers (these numbers are derived using a formula in the query). I want to sort (ascending/descending) this column of numbers using the SAP_BW_URL so that I can make links to sort by asc or desc.

I tried following this help doc: http://help.sap.com/saphelp_bw30b/helpdata/en/50/0a433ab9fb960ee10000000a11402f/content.htm

But I can't get it to work. I use sort_type = 'V' but when you do that, it ignores the iobjnm characteristic value. Instead, it expects value for structure_member. This doesn't make sense to me. I don't want to sort an entire structure... just one characteristic in the structure. Can someone clarify that?

OR (alternative solution????)

In the context menu of the column, I can choose sort, then sort in Ascending Order or sort in Descending Order. Is there a way to get the URL of that link in the context menu?

Thanks!!!!!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Does anyone know how to call the same JavaScript fuctions that are used in the context menu?

I want to put a link on the page which does the same thing as going to a key figure's context menu, choosing Sort, and then choosing Sort in Ascending Order.

Thanks,

Former Member
0 Kudos

Hi Audrey,

I think your problem is with the dataprovider

Is DP correct?

<SAP_BW_URL DATA_PROVIDER='DP' CMD='SORT' SORT_TYPE='V' SORT_DIRECTION='A' STRUCTURE_MEMBER_1='3WWA4FB5R1K1YDEPYWXEHR91A'>

Also a good solution would be, to execute your template with &snippet_operations= (add this to your URL). Now for each step a new URL will be generated and you can see this in the browser address bar. Check the settings here and change your SAP_BW_URL notation accordingly.

The javascript functions in the context menu are not released for customer usage. Of course you could just call the same function, but this of course might be changed in a SP for example.

Heike

Former Member
0 Kudos

Hi,

I am having this problem also.

I have the dataprovider and other bits correct. I know this because I have managed to get the sort url working to sort characteristics using SORT_TYPE='T' and IOBJNM='technical name for characteristic'.

The problem comes when trying to sort a structure. I have done everything as said in the help documents posted above but it does not work.

Can anyone help us?

Former Member
0 Kudos

I too was able to get it to work when I changed the field that I was sorting on to a characteristic. But it still doesn't work on a formula.

Can anyone help?

Thanks.

Former Member
0 Kudos

Hi all,

there had been an error in the documentation

The actual documentation states sort_type=W and not V

http://help.sap.com/saphelp_nw04/helpdata/en/50/0a433ab9fb960ee10000000a11402f/frameset.htm

Also the exmple is not correctly translated in the most up to date documentation.

Heike

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks. Changing the V to W works.

Now I have another question.

Usually, you can take your SAP_BW_URL parameters and put them in the object tag for the data provider. The result is a default parameterized report.

My SAP_BW_URL is <SAP_BW_URL DATA_PROVIDER='DP' CMD='SORT' SORT_TYPE='W' SORT_DIRECTION='A' STRUCTURE_MEMBER_1='3WWA4FB5R1K1YDEPYWXEHR91A'> which now works perfectly.

I want my report to default to my key figure (total tickets) to being sorted ascending.

So, incorporating the SAP_BW_URL parameters into my object tag, results in...

<object>

<param name="OWNER" value="SAP_BW"/>

<param name="CMD" value="SET_DATA_PROVIDER"/>

<param name="NAME" value="DP"/>

<param name="QUERY" value="ZEIC_7010_TOPCUSTOMER_INTER"/>

<param name="INFOCUBE" value="0SAL_DS01"/>

  • <param name='CMD' value='SORT' />

  • <param name='SORT_TYPE' value='W'/>

  • <param name='SORT_DIRECTION' value='A'/>

  • <param name='STRUCTURE_MEMBER_1' value='3WWA4FB5R1K1YDEPYWXEHR91A'/>

<param name='HELP_SERVICE' value='ZPRINTING'/>

<param name='HELP_SERVICE_CLASS' value='Z_PRINT_HELP_SERVICE'/>

DATA_PROVIDER: DP

</object>

I put *'s in front of the revelant parameters.

When I run my report with this code, I get an error "Messages: Error loading item TITLE." in my Internet Exploer browser.

Does anyone know what I'm doing wrong?

Thanks.

Former Member
0 Kudos

Hi Audrey,

you have now 2 cmd parameters in your Data-Provider-Tag. This is not working of course. Adding commands like this works only for generic commands (like filter) What you need to do: use a command sequence.

<object>

<param name="OWNER" value="SAP_BW"/>

<param name="CMD" value="SET_DATA_PROVIDER"/>

<param name="NAME" value="DP"/>

<param name="QUERY" value="ZEIC_7010_TOPCUSTOMER_INTER"/>

<param name="INFOCUBE" value="0SAL_DS01"/>

<param name='CMD_1' value='CMD=SORT&SORT_TYPE=W&....' />

</object>

Also as I see it just in your template. As possible do not assign the Help-Service to the DataProvider assign it to a web item instead!

Heike

Former Member
0 Kudos

It worked! Thank you for all your help!

former_member188975
Active Contributor
0 Kudos

Hi Audrey,

I just saw the link that you posted and it does mention that IOBJNM is only for characteristics and is omitted when you sort by values.

About Structure Member, I can only make a guess...If you look into your query, you notice that all Key Figures are always in a structure. By the structure member ID (as also shown in the Actual Sales example), I think they are referring to the key figure by its technical ID in the structure.

One way to see this is in the formula builder (I don't know if there is an easier way)...if you start creating a new formula in your KF structure, you can see a technical name / ID for the key figures that are part of the structure. So if you put the ID of the KF that you want to sort in the URL, I think it might work...

I am still not clear what they mean by the second structure member ID (if you have 2 structures in your query), but if you have just one structure you may want to try the above.

Hope this helps...

Former Member
0 Kudos

Thanks for replying.

I tried putting the technical name of my formula column in the structure_member parameter. But it didn't work. I don't understand why you'd reference a structure. How does it know which characteristic's value you want to sort if you only pass it the structure name???? I'm confused!!

Any ideas about the alternate solution that I proposed? How can I get the URL for the "Sort in Ascending Order" and "Sort in Descending Order" links in the context menu? this seems to be the most straightforward way but I can't find any documentation.

Thanks!!!!!!!!!!!!!

Former Member
0 Kudos

My terminology is bad. I should have said...

How does it know which KEY FIGURE's value you want to sort if you only pass the structure name???

former_member188975
Active Contributor
0 Kudos

No...see. You are not putting in the structure name. You are putting in the technical ID that represents the key figure in the structure. I think this is required because for a characteristic, you can include each only once in a query, so you can identify it by the object name.

But you can include the same key figure more than once, may be for different calculations, or restrictions etc...lets say you have Sales in 2 columns restricted to different Sales Orgs, then how do you decide which one you want to sort...I guess this is where the technical ID comes into action...

Former Member
0 Kudos

Hi Audrey,

and to get the UIDs of the structure member (which you have to provide with your URL) read

the hint in chapter

http://help.sap.com/saphelp_nw04/helpdata/en/76/80a1393e3a6942e10000000a11402f/frameset.htm

Heike

Former Member
0 Kudos

I followed these instructions...

"In the Web application designer, drag the Web item Dropdown Box into your Web template. Assign the desired data provider to the Web item. Under the attribute Characteristic/Structure for the Web item Dropdown Box, select the respective structure. Here you can see the UID. If you execute the Web template, you can copy this UID from the HTML code."

...from the link you provided. Under the attribute Characteristic/Structure for the web item, I have 2 entries. 1) Person of Interest 0BP_EMPLO (which is in my rows) and 2) Report Key Figures (which is the strucutre in my columns; in this structure is my formula which i need to sort). Should I have expected to see my formula?

Anyway, I got the 25 char number for my formula field (FYI, it's call Total Tickets) by going to the transport connector. You can see the number there. And I put that number into my URL tag. My tag looks like this:

<SAP_BW_URL DATA_PROVIDER='DP' CMD='SORT' SORT_TYPE='V' SORT_DIRECTION='A' STRUCTURE_MEMBER_1='3WWA4FB5R1K1YDEPYWXEHR91A'>

When I run this web app and click on my link, it does NOT sort the Total Tickets column. Instead, it sorts Person of Interest (remember, this is what I have in the rows).

So, I'm all confused and I don't know what to do now.

Hope someone can help.

Thanks!!!