How to order a varchar2-field by click on a report column?

Hello,
I have a report an a table. One varchar2-column (name of the column is VORGANGSKENNUNG) in this table stores data in this format:
xxx/yyyy where
xxx is a ID from 1 until e.g. 140 and
yyyy is the year (2007, 2006, 2005...).
The first entry in a year starts with 1. So the last entries could be:
3/2007
2/2007
1/2007
140/2006
139/2006
I a query I can sort this field like this:
order by
to_number(substr(VORGANGSKENNUNG,-4)) desc,
to_number(substr(VORGANGSKENNUNG,1,instr(VORGANGSKENNUNG,'/')-1)) desc;
With this query I can sort the report descent.
But the users want to sort this field by click on the column header descending or ascending.
How can I do this?
Regards,
Mark

Hi Mark,
One way may be to modify the region template, add an onclick event to the header, write an own javascript function that's creating the order statement and at the end, write this order statement back to an application or page item. At the end of the function I would do a submit, that refreshs the page.
Your report query must be modified, that it is picking up the order statement from the application / page item. So I use something like this.
DECLARE
str_express varchar(2000);
str_order varchar(2000);
BEGIN
str_express := 'SELECT col1, col2, col3
FROM my_tabl ';
str_order := :P230_ORDER;
str_express := str_express || ' ' || str_order;
RETURN str_express;
END;
Hope this helps,
chrissy

Similar Messages

  • How can i transfer a field value in the main report to its sub-report?

    <p><font face="Arial" size="2">How can i transfer a field value in the main report to its sub-report?</font></p><p><font face="Arial" size="2">Please eloberate with example if possible!</font></p><p><font face="Arial" size="2">Thanks...</font></p><p> </p>

    <p>You can do a couple of things - one would be to pass the information using the data linking expert.  Right click on the subreport, choose &#39;Change Subreport Links&#39; and select the field(s) you are wanting to pass to the subreport.  CRW will build parameters and a record selection formula for you in the subreport, and if that&#39;s what you want, then great.  But you can also remove the selection formula from the subreport and work with the parameter fields in the subreport however you would like.</p><p>Alternatively, you can look to passing Shared variables back and forth from the main and subreport.  this link talks about the method to do this: http://diamond.businessobjects.com/node/251</p><p> </p>

  • How to add new customise field in standard SAP ME28 Report?

    Hi Anybody,
             How to add new customise field inside Standard SAP Screen report ME28?.
    Anybody, Please tell me how to do?.
    Thanks,
    Regards,
    S.Muthu.

    Hi Subramaniyam,
    You can find enhancement in me28 by following steps and then apply your logic in include of this enhancement.
    cmod>Give a project name>in enhancement column give the package name ME >f4>in package write ME-->ENTER>It will show you all enhancements available in me28> find which ever suits your requirement>save > click on components> from there you can make changes in include program.to add that particular field.

  • How to activate company code field on selection screen of report pc00_m40_f24q ?

    Hello,
    Client is upgrading form ECC 6.0 ehp3 to ECC6.0 ehp7 . The report is generated according to the company code ,but after upgrade the company code field got disabled. Can any tell what might be the reason for this?
    Regards,
    Yashika

    Go to SE38 - Pass program name HINCF24Q- select - attributes - click on display - click on HR report category - click on F7 - click on CTRL+F1 - allowable selection criteria - click on F5 - add company code from the drop downs and then check.
    Once resolved close the thread as well.
    Regards
    Venkatesh

  • Display the second report as modalform and filter with primary key value of first report when you click on first report column link

    Hi All,
    I have two reports.
    1. order report
    2. order detail report
    when you click on the order report column it display the order detail report as a modal form.
    i was done below steps.
    1. In page header i was written the below code
    <link rel="stylesheet" href = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/
    redmond/jquery-ui.css" type="text/css" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"> </script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"> </script>
    <script type="text/javascript">
    $( function() {
    $('#ModalForm1').dialog(
    autoOpen : false ,
    width :470,
    height: 500,
    resize :false,
    function openForm1()
    $('#ModalForm1').dialog('open');
    function closeForm()
    $('#ModalForm1 input[type="text"]').val('');
    $('#ModalForm1').dialog('close');
    </script>
    2. order report.
    3. order detail report
       select * from order_details where order_id = p_order_id;
    region header
    <div id="ModalForm1" title="Ordered Items" style="display:none">
    <p class="msg"></p>
    footer
    </div>
    4. created the hidden item in order detail report.
    5. in order report column attributes i was given link like below.
    javascript:$s('p_order_id','#order_id#');openForm1();
    when i click on the order report column link it passing the row primary key value to hiddent and open the report as modal form. however it is not filter the report with hidden item. it showing the no data found.
    problem is hidden item value is not submitting. once we submit that value it showing the 2nd report with filter data.
    can any help me to achieve above requirement.
    apex: 4.2
    oracle 11g
    Regards,
    Vijay.

    Vijay,
    Issue 1: Your usage of $s() JavaScript API seems to be wrong. For the first parameter, you need to use the name of the hidden page item and not p_order_id.
    javascript:$s('P1_ORDER_ID','#ORDER_ID#');openForm1();
    Issue 2: Seems like you are not setting the hidden page item's value in session state. Assuming your hidden page item is called P1_ORDER_ID, Under "Region Definition" tab of your "Order Detail Report" under "Source" tab, for page items to submit, enter the name of the hidden page item P1_ORDER_ID.
    Thanks!
    JMcG

  • How to populate the relavent fields when clicked on a field

    I am trying to populate the relevant fields of screen(MODULE POOL PROGRAM) when i am 
    clicking on a field. Search help/ value request is provided to that field.
    so Can any one help me with this scenario. IF POSSIBLE PLEASE SEND THE SOLUTION
    WITH THE CODES.
    POINTS WILL BE REWARDED.

    Hi
    use this for F4 help on field
    For F4 Values on Screen:
    PROCESS ON VALUE_REQUEST
    using module call starting with FIELD i.e FIELD field MODULE module
    There are number of function modules that can be used for the purpose, but these
    can fullfill the task easily or combination of them.
    DYNP_VALUE_READ
    F4IF_FIELD_VALUE_REQUEST
    F4IF_INT_TABLE_VALUE_REQUEST
    POPUP_WITH_TABLE_DISPLAY
    DYNP_VALUE_READ
    This function module is used to read values in the screen fields. Use of this
    FM causes forced transfer of data from screen fields to ABAP fields.
    There are 3 exporting parameters
    DYNAME = program name = SY-CPROG
    DYNUMB = Screen number = SY-DYNNR
    TRANSLATE_TO_UPPER = 'X'
    and one importing TABLE parameter
    DYNPFIELDS = Table of TYPE DYNPREAD
    The DYNPFIELDS parameter is used to pass internal table of type DYNPREAD
    to this FM and the values read from the screen will be stored in this table.This
    table consists of two fields:
    FIELDNAME : Used to pass the name of screen field for which the value is to
    be read.
    FIELDVALUE : Used to read the value of the field in the screen.
    e.g.
    DATA: SCREEN_VALUES TYPE TABLE OF DYNPREAD ,
    SCREEN_VALUE LIKE LINE OF SCREEN_VALUES.
    SCREEN_VALUE-FIELDNAME = 'KUNNR' . * Field to be read
    APPEND SCREEN_VALUE TO SCREEN_VALUES. * Fill the table
    CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
    DYNAME = SY-CPROG
    DYNUMB = SY-DYNNR
    TRANSLATE_TO_UPPER = 'X'
    TABLES
    DYNPFIELDS = SCREEN_VALUES.
    READ TABLE SCREEN_VALUES INDEX 1 INTO SCREEN_VALUE.Now the screen value for field KUNNR is in the SCREEN_VALUE-FIELDVALUE and can be used for further processing like using it to fill the internal table to be used as parameter in F4IF_INT_TABLE_VALUE_REQUEST ETC.
    F4IF_FIELD_VALUE_REQUEST
    This FM is used to display value help or input from ABAP dictionary.We have to pass the name of the structure or table(TABNAME) along with the field name(FIELDNAME) . The selection can be returned to the specified screen field if three
    parameters DYNPNR,DYNPPROG,DYNPROFIELD are also specified or to a table if RETRN_TAB is specified.
    CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
    EXPORTING
    TABNAME = table/structure
    FIELDNAME = 'field name'
    DYNPPROG = SY-CPROG
    DYNPNR = SY-DYNR
    DYNPROFIELD = 'screen field'
    IMPORTING
    RETURN_TAB = table of type DYNPREAD
    F4IF_INT_TABLE_VALUE_REQUEST
    This FM is used to dsiplay values stored in an internal table as input
    help.This FM is used to program our own custom help if no such input help
    exists in ABAP dictionary for a particular field. The parameter VALUE_TAB is used to pass the internal table containing input values.The parameter RETFIELD
    is used to specify the internal table field whose value will be returned to the screen field or RETURN_TAB.
    If DYNPNR,DYNPPROG and DYNPROFIELD are specified than the user selection is passed to the screen field specified in the DYNPROFIELD. If RETURN_TAB is specified the selectionis returned in a table.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    RETFIELD = field from int table whose value will be returned
    DYNPPROG = SY-CPROG
    DYNPNR = SY-DYNNR
    DYNPROFIELD = 'screen field'
    VALUE_ORG = 'S'
    TABLES
    VALUE_TAB = internal table whose values will be shown.
    RETURN_TAB = internal table of type DDSHRETVAL
    EXCEPTIONS
    parameter_error = 1
    no_values_found = 2
    others = 3.
    POPUP_WITH_TABLE_DISPLAY
    This FM is used to display the contents of an internal table in a popup window.The user can select a row and the index of that is returned in the CHOISE
    parameter.The VALUETAB is used to pass the internal table.
    A suitable title can be set using TITLETEXT parameter. The starting and end position of the popup can be specified by the parameters STARTPOS_COL / ROW and ENDPOS_ROW / COL .
    CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
    EXPORTING
    ENDPOS_COL =
    ENDPOS_ROW =
    STARTPOS_COL =
    STARTPOS_ROW =
    TITLETEXT = 'title text'
    IMPORTING
    CHOISE =
    TABLES
    VALUETAB =
    EXCEPTIONS
    BREAK_OFF = 1
    OTHERS = 2.
    e.g.
    DATA: w_choice TYPE SY-TABIX.
    DATA: BEGIN OF i_values OCCURS 0 WITH HEADER LINE,
    values TYPE I,
    END OF i_values.
    PARAMETRS : id TYPE I.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR id
    i_values-values = '0001'.
    APPEND i_values.
    i_values-values = '0002'.
    APPEND i_values.
    i_values-values = '0003'.
    APPEND i_values.
    i_values-values = '0004'.
    APPEND i_values.
    CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
    EXPORTING
    ENDPOS_COL = 40
    ENDPOS_ROW = 12
    STARTPOS_COL = 20
    STARTPOS_ROW = 5
    TITLETEXT = 'Select an ID'
    IMPORTING
    CHOISE = w_choice
    TABLES
    VALUETAB = i_values
    EXCEPTIONS
    BREAK_OFF = 1
    OTHERS = 2.
    CHECK w_choice > 0.
    READ TABLE i_values INDEX w_choice....now we can process the selection as it is contained
    ...in the structure i_values.
    Other FM that may be used to provide input help is HELP_START .
    Regards
    Anji

  • How to add a new field in Query Builder or Report

    Hi,
    I am writing a report using Oracle 6i query builder and report.
    example:
    QTY_1 QTY_2 QTY_3
    QTY_1 and QTY_2 are table fields and QTY_3 Is not. I need to show the value of (QTY_2-QTY_1) in QTY_3.
    I need to create a field QTY_3 which is not in the database table. How do I do that?
    Jun

    Hi,
    Try using formula to return the qty_1 - qty2.
    or
    select qty_1, qty_2, (qty_1 - qty_2) qty_3
    from table;
    regards,
    CB

  • How to add a function field into the existing matrix report

    Hi,
    I have a matrix report , now i wanted to add one moe field into the matrix which is getting the value from a function , this function is a part of the ref cursor query(group) , i'm able to get the value from the function but it cannot display on the existing matrix report. i wanted to add this in the repeating frame which is printing down. how could i do this , looking for your help. thanks . bcj

    Here the scenario like,
    Data from Table_1
    NAME UNITS DAYS RATE
    AAA 10 1 1.2
    BBB 12 2 3.1
    AAA 20 2 4.1
    CCC 23 1 5.2
    Here, In the matrix report the NAME and UNITS are row fields and 'DAYS' is column field , RATE would be the cell field, and
    Data from Table_2 ,
    NAME BASIC
    AAA 2
    AAA 2
    BBB 2
    CCC 3
    In the report i have to display the 'BASIC' along with the NAME in row level ( repeating frame printing down),
    To get the multiple 'Basic' for each 'Name' using a ref cursor .
    and, using a function to do further calculation based on the basic value
    begin
    select basic into v_basic where name =:name;
    return(caluculated_value);
    end;
    and return the calculated value to the report. But at that time cannot accommodate the value in the matrix report with other groups frequency.
    looking for your valuable help. Thanks Bcj

  • How to add "Team leader" field in standard BPC security report

    BPC Expert,
    We are using BPC MS 5.0 version.
    There is a checkbox in the security setup to make someone a "Team Leader" when you add him/her to a team and this checkbox determines who can post data and who cannot.  When we run the user report we see which team the user is in but we do not have visibility to whether or not they are a "Team Leader" which is what business owner needs to see to approve user access.
    I figured out "dbo.userteamassign" is the table which hold team leader value. Can anyone please tell me all the steps of adding team leader field in the standard BPC 5.0 security report.
    Thanks,
    Ketan

    Roberto,
    Thanks for the response. I know associated steps to declare business user as a team leader but my original question is "how to add a column in standard BPC security report that says who is team leader or who is not".
    Do you know the Dtx package that is responsible to supply the data to Standard BPC security report? We can enhance standard data package to pull/display extra "Team leader" column in standard security report.
    Appreciate your inputs.
    Thanks,
    Ketan

  • How to display the same field more than once in  report with diff. filters

    Hello,
    I have an RTF template I built out. There is a 1:M relationship of an opportunity:deal point.
    I want the user to be able to pass the opportunity and then see a report including all the deal points.
    The report looks something like this:
    Date: DP100
    Terms: DP200
    Duration: DP300
    and so on. to simplify things, the date will always be DP100, terms will lways be DP200, etc.
    Where do I set these filters? When using the query builder on the BI Publisher server i don't see anywhere to filter.

    Here is a copied piece of the RTF template illustrating what I'm trying to do in the word template builder.
    Tenant (Signing Entity): <Deal_Point_Value where Deal_point_name = 'DP231'>
    Tradename (D/B/A): <Deal_Point_Value where Deal_point_name = 'DP240'>
    State of Incorporation: <Deal_Point_Value where Deal_point_name = 'DP1330'>
    Landlord: <Deal_Point_Value where Deal_point_name = 'DP1560'>
    Premises: <Deal_Point_Value where Deal_point_name = 'DP144>
    Storage Space: <Deal_Point_Value where Deal_point_name = 'DP235'>
    Off Premises Equipment: <Deal_Point_Value where Deal_point_name = 'DP386'>
    Term: <Deal_Point_Value where Deal_point_name = 'DP940'>
    Options: <Deal_Point_Value where Deal_point_name = 'DP1200'>
    Rent Commencement: <Deal_Point_Value where Deal_point_name = '1136'>
    Estimated Delivery Date: <Deal_Point_Value where Deal_point_name = 'DP123'>

  • PS 2013 - Changing the formula in custom field not reflected in the report columns

    Hi, 
    The company where I work have a Sharepoint environment / EPM 2013 with about seven hundred registered projects. 
    We have a customer demand where it is necessary to change the formula of one of the custom fields of the environment. This field is used in some management reports made ​​in Reporting Services and accessed by the entire board. The report uses as a source
    'MSP_EpmProject_UserView' view. 
    The change in formula was simple, but we found that the change will not be reflected in the reports when the user saves the project in Sharepoint or publish the schedule associated with the Project. 
    I believe this is the expected behavior of the EPM, but I wonder if there is some other way than through the PSI, to publish all environmental projects.  
    Best regards,
    Armando Machado Gonçalves - Sharepoint / EPM 2013

    Hello,
    That is expected, it will not update until the project is open and republished. No automatic way to do this without automating project pro. Publishing all projects via the PSI wont cause the plan to recalculate, the plans will need to be opened.
    Paul
    Paul Mather | Twitter |
    http://pwmather.wordpress.com | CPS

  • Problem with 'order by' and comparison operator with varchar2 field

    I have a problem with the following sql query (field1 is varchar2):
    SELECT field1
    FROM tablename
    WHERE field1 > 'AA10BB'
    ORDER BY field1
    The contents of field1 is:
    AA10BB
    AA10-10BB
    AA10-12BB
    The sql query without the WHERE clause sorts field1 this way:
    AA10BB
    AA10-10BB
    AA10-12BB
    But the sql query with the WHERE clause has no hits.
    It seems that when sorting the minus character is greater than the 'B' character and
    at the comparison ( > 'AA10BB' ) the minus character is lower than the 'B' character!
    The database and client NLS_PARAMTER are GERMAN_GERMANY.
    The database is 9.2.0.7
    Has anyone an idea?

    thanks for your fast reply!
    My problem was that NLS_SORT was set to 'GERMAN' and NLS_COMP to 'BINARY'.
    NLS_SORT = GERMAN orders the varchar2 fields in form of 'a A b B ... 0 1 2 3 ..'
    NLS_COMP = BINARY compares binary (ASCII-Table).
    I use now:
    SELECT field1
    FROM tablename
    WHERE field1 > 'AA10BB'
    ORDER BY NLSSORT(field1, 'NLS_SORT = Binary'');

  • Sorting a varchar2 field in Report 10g

    Dear all,
    i have a table of salaries, which have a field RANK_NO VARACHAR2.
    I create a report and order it by RANK_NO. but it is not ordering what i want to be. it is ordered like
    1
    10
    11
    2
    3
    4
    5
    6
    7
    8
    9
    then i use the order by cluase like this,
    ORDER BY TO_NUMBER(REGEXP_SUBSTR(RANK_NO,'[0-9]+')),
    REGEXP_SUBSTR(UPPER(RANK_NO),'[A-Z]+').
    but the result is same .
    how to sort a varchar2 field in reports?
    Thanks & Regards

    Hi Muhammad,
    Use the following Order By clause hope it helps you,
    ORDER BY TO_NUMBER (REPLACE (RANK_NO, LTRIM (RANK_NO, '0123456789'))), RANK_NO
    Best Regards
    Arif Khadas

  • How to set custom widths for a particular report column?

    how could I set a custom width for a particular report column? Is there a way to do it using css?
    Thank you.

    Hi Leland,
    I have tested this here: [http://apex.oracle.com/pls/otn/f?p=267:18]
    All I have done is add the following into the report's Region Header:
    &lt;style type="text/css"&gt;
    #apexir_EMPNO {width:200px}
    #apexir_ENAME {width:200px}
    #apexir_DEPTNO {width:200px}
    .apexir_WORKSHEET_DATA TR TD {height:100px;}
    &lt;/style&gt;The headers have all be set to be left-aligned. Each column should be 200px wide (even though I'm setting the width on the headers, it will be applied to the entire column unless a cell's contents is wider, in which case the column is made wider). The final entry above adjusts the height of all TDs within the IR table.
    Andy

  • [new-GL]How can I make "order" and "WBS" field visible in KSV7 or KSU7?

    Hi,
    I found that sender/reciever screen of KSV7 or KSU7 is different from that of KSV1 or KSU1. There were no fields to enter order and wbs in KSV7 and KSU7.
    How can I add those field in KSV7 and KSU7?
    I tried t-code GCA6 but couldn't find what to do. Hel~~~~~~~~~p me plz.
    thanks

    Goto SPRO ..for IMG .. Controlling --> General Controlling --> Organization --> Maintain Versions. Select the version and then select the Controlling Area settings..Again select the version within and click on settings by fiscal year from the left hand side panel under Controlling Area Settings. Highlight the year you are considering for plan. and then enable the checkbox under Orders/projects named Integrated planning with cost centers/bus.processes. Then try KSU or KSV7

Maybe you are looking for

  • Can't see Stream Files in administration console !!

    I have created a new Directory called "mydir" into the Application Directory Of Flash Media Server. I copied my "mydir.flv" file into ths directory. But : Problem 1 : I can't see this file in the Stream Section of the Administration Console. Problem

  • Router connected to cable modem by Ethernet port cannot get IP address from DHCP.

    I have an ethernet cable on Fa0/0 connecting my 1841 router to my cable modem. The issue is that the router cannot obtain an IP address via DHCP when I have the "ACL-OUTSIDE-IN" ACL applied inbound on the Fa0/0 interface. I tried to allow all BOOTP a

  • BrowserKeystore$JSSPasswordCallbackInvocationHandler behaviour

    Hi all, excuse me if this isn�t the correct forum. i've configured jss in firefox and deployed a small applet that uses JSS classes. I've implemented a PasswordCallback following http://www.mozilla.org/projects/security/pki/jss/javadoc/org/mozilla/js

  • Extending 0BP_DEF_ADDRESS_ATTR to Extract Mobile Phone number

    I'm currently attempting to extend the 0BP_DEF_ADDRESS_ATTR to include the business partners mobile number. We have appended a "Z" field to the extract structure & are now trying to fill it from table ADR2, where r3_user = 3 If anyone has already don

  • CName / forwarding question

    Finishing my site design on iWeb, and want to use my own domain name. Two choices. 1) change the CName at Network Solutions, but they told me that it would only work if viewers type in the entire url (for ex www.mydomainname.com) It would not work if