Skip to Content
author's profile photo Former Member
Former Member

Using URL to Sort Values

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!!!!!

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 25, 2005 at 12:09 AM

    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,

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 23, 2005 at 07:26 PM

    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...

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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!!!

  • author's profile photo Former Member
    Former Member
    Posted on Mar 01, 2005 at 07:55 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.