Apex: Removing leading and trailing blanks

Hi,
when observing end users working with my little apex application I noticed the input of leading and trailing blanks in a report search field. What do you recommend for removing this undesired input?
I tried an ltrim(rtrim(:p1_searchfield)) in the report SQL query - the result is fine.
But I have not found a way to keep the higlighting of the search word in the result set. There is a "highlight" property in the report field attributes dialog. But it looks like there is no way to enter any trim funtion over there. So the highlighting of matches does not work if there is a leading or trailing blank.
Any ideas?
Thanks & Cu
Walter

Walter,
I would use an "after submit" computation on :p1_searchfield
trim(:p1_filter)This way you won't have to change your select statement and the highlight term.
~Dietmar.

Similar Messages

  • Removing Leading And trailing Zeros

    Hi Guys ,
    Can You help me out in UDF for removing leading and Trailing zeros
    Ex :  0123.234000000
    And it must satisfy below conditions .
    1 ) If value as Null we need 0.0 in target
    2) if the value is 0.0 we need 0.0 in target
    Thanks in Advance

    One more option:
    Input will be "str" of type string.
    Execution type: single value.
    mapping:
    Input -> mapwithdefault(0.0)->UDF->output
    if( !str.equals("0.0"))
    char[] chars = str.toCharArray();
    for (int index=0; index < str.length();index++)
    if (chars[index] != '0')
    str =str.substring(index);
    break;
    int length,index1 ;
    char[] chars1 = str.toCharArray();
    length = str.length();
    index1 = length -1;
    for (int in1=index1-1; in1>0;in1--)
    if (chars1[in1] != '0')
    str=str.substring(0,in1+1);
    break;
    return str;
    else
    return "0.0";
    http://wiki.sdn.sap.com/wiki/display/Java/RemoveLeadingandTrailingZerosfroma+String

  • Removing leading and trailing delimiters from a String

    I need to remove leading and trailing delimiters from a String like if my string is 111,112, then it should get changed to 111,112.Any idea how to do this??

    for my suggestion:String s = "111,112,";
    int begin = 0;
    while (!Character.isLetterOrDigit(s.charAt(begin)))
         begin++;
    int end = s.length() - 1;
    while (!Character.isLetterOrDigit(s.charAt(end)))
         end--;
    String news = s.substring(begin, end + 1);Of course, you'll have to clean it up a bit.

  • REGEXP_REPLACE removing leading and trailing quotes.

    Hello guys,
    I have an issue with my regular expression and I'm hoping that someone can help me with it?
    Imagine the following sample_data:
    {code}
    WITH sample_data AS
    SELECT '''[email protected]''' as e FROM dual UNION ALL
    SELECT '''[email protected]' as e FROM dual UNION ALL
    SELECT '[email protected]''' as e FROM dual UNION ALL
    SELECT '''[email protected]''' as e FROM dual UNION ALL
    SELECT '[email protected]''' as e FROM dual UNION ALL
    SELECT '''[email protected]' as e FROM dual
    SELECT e, REGEXP_REPLACE(e, '(^'')?(.*)(''$)', '\2')
      FROM sample_data;
    {code}
    I would like to remove all leading and trailing quotes from the address email. I did the previous regexp but it does not returns the correct result. I don't know why, but for some reasons, when my email does not ends with a quote, the leading quote is not removed.
    Can anyone help me with this?
    Thanks,

    Cant you just trim it?
    WITH sample_data AS
    SELECT '''[email protected]'''      as e FROM dual UNION ALL
    SELECT '''[email protected]'        as e FROM dual UNION ALL
    SELECT '[email protected]'''        as e FROM dual UNION ALL
    SELECT '''[email protected]''' as e FROM dual UNION ALL
    SELECT '[email protected]'''   as e FROM dual UNION ALL
    SELECT '''[email protected]'   as e FROM dual
    SELECT e, rtrim(ltrim(e, ''''), '''') new_e
      FROM sample_data;

  • Remove leading and trailing puncation

    What's the best way to remove leading/trailing puncation from a word? Trim is good for leading and trailing whitespace but can I do anything for leading and trailing punctuation. I need punctuation that's in the middle of a word.

    one way would be to create an array of characters that include all the common punctuation marks. Then, using an iterative loop, compare each char in the file with each char from the array. If a match is found, then the file char is punctuation.

  • Unix Flat File: Remove header and trailer and put in another file.

    Hi,
    I have Source Flat File placed on Unix Box with header and trailer.
    I want to remove Header and Trailer and put in some other file and Data in another file.
    I tried following command in unix its working.But not getting Header and Trailer in another file.
    sed '1d;$d' input_source.txt > output_data.txt
    also How will i use OS command for it in ODI.
    Guide me.
    Thanks
    Ashwini

    Hi Ashwini,
    You can run OS commands in a package using an ODI Tool: OdiOSCommand.
    It is also possible to execute OS commands in an ODI procedure using the Operating System or Jython technologies.
    There should be some articles about this on metalink (http://metalink.oracle.com).
    Thanks,
    Julien

  • How can I remove the ":" and "-" (from blank responses) from the response data?

    My design view shows: "Warranty Escalation = On" (withour quotes), but responses show "Warranty Escalation = On:-" (for blank responses).
    Is there any way for the responses to NOT AUTOMATICALLY ADD:
      1) a colon between text fied and answer field?
      2) a dash when there is no response (simply leave it blank)?
    Many Thanks,
    -Richard

    Sorry, currently we don't support customization of notification emails.
    Thanks
    Roman

  • Hex to binary removes leading or trailing 0's

    hi,
    i'm trying to get a hex to binary conversion.  i am using a hex string to number conversion with the setting at binary, but it is deleting my leading zeros.
    for example if i put in a 7 hex, i get 111 instead of 0111.  or if i put in a 0 hex, i get 0 intead of 0000.  i understand it is equally the same thing but the interface i am communicating with is expecting all digits.
    thanks,
    Attachments:
    hex2bin.vi ‏7 KB

    Hi lfoitek,
    choose binary display, set the number of bits to show and select "fill with zeros at left"!
    Message Edited by GerdW on 02-08-2008 04:50 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    hex2bin.vi ‏7 KB

  • Leading and trailing 0's in Address Book???

    I get a string of 0's after phone numbers in my address book.  I transferred my addres book from a Treo 650 to my AT&T Centro. It seems that there are random 0's in the data and I can's seem to get rid of them.
    Does anyone else have this issue???
    Tom
    Post relates to: Centro (AT&T)

    I just tried the trial of DbFixIt and it detected NO errors in Contacts and only fouund errors in my calendar.
    Other suggestions???
    Would really like to get rid of these zeros!
    Thanks,
    Tom
    Post relates to: Centro (AT&T)
    Post relates to: Centro (AT&T)

  • How to prohibit leading and traling whitespace in XML Schema

    I want to prohibit the use of leading and trailing whitespace in an element but besides that all other content is allowed.
    For examble <   word? > should give a validation error.
    I do not want to use
    <whiteSpace value="collapse"/>
    Because it doesn't give a validation error.
    Is it possible to make a pattern og in some other way solve my problem?
    Thanks in advance, Martin

    Here is an example schema snippet (not a complete schema!) that does what you want I think, using a regular expresssion pattern, allowing one or more non-white-space characters followed by an optional sequence of any character followed by one or more non-white-space characters:
    Code Snippet
            <xs:element name="foo" maxOccurs="unbounded">
              <xs:simpleType>
                <xs:restriction base="xs:string">
                  <xs:pattern value="\S+(.*\S+)*"/>
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
    Here are some example elements with valid contents:
    Code Snippet
      <foo>a</foo>
      <foo>a b</foo>
      <foo>a b c d e f g</foo>
    And here some elements with invalid contents that validation would catch:
    Code Snippet
      <foo> a</foo>
      <foo>a </foo>

  • Remove leading space(blank) REGUH-RWBTR in script

    hi,
    i am now dealing with cheque priting in word issue.
    the output format should be :
    <b>USD 111,000 AND CENT 45 ONLY.</b>
    the amount field i use is REGUH-RWBTR in script. but the output come with leading of space.
    <b>which is as : USD         111,000    AND CENT 45 ONLY,</b>
    which this is not i want. how am i going to remove the blank space leading and ending for REGUH-RWBTR?
    below is my current code:
    &'***RM'REGUH-RWBTR(.0)&&' AND SEN 'SPELL-DECIMAL(2)& ONLY ***
    please any one can help me. either using this field, or any other way to do display it?

    can i see the exact o/p as how u r seeing it for comparision.
    i hope u r using &rxxxx-rwbtr(C.0)&
    did u check the second option also . ? confirm
    Since the data type is currency format and here we are supressing the decimals so in order to supress the blank space at the end you can go for a variable declaration with type char
    say gv_val(13) type c
    and then move the rxxx-btr to this gv_val as
    gv_val = rxxx-rwbtr.
    now replace in the code display the amount filed as &&gv_val(C.0)&&
    Im not logged onto sap now.
    you have to confirm the result.
    regards,
    vijay.

  • Remove header and footer from blank left-hand pages

    Are there any scripts to automatically remove header and footer on a blank left-hand page for an InDesign CS3 document? I have a book with many chapters and it would be more efficient than removing them by hand.

    It's a one liner from a much longer script that does quite something else -- this is merely a side effect, a quick way to get a page range (i.e., I need the range "251-256" to appear on my first page, excluding an optional blank last one) [*].
    Perhaps I could write a full script, but for that I need a bit more information. Is your document an InDesign Book, with each chapter in a separate document? If so, any empty frame on a last leftmost page can safely be deleted. If your book is in a *single* InDesign document, this line can only be used if a left hand page has *no objects at all* -- not even an empty frame. That's the easy case -- in English "if there are no objects on the page, apply the "[None]" master. If there *is* a frame, however, it cannot be removed right away, even if it seems empty. That's because in that case you probably have inserted a page break somewhere on the previous page, and if the frame is deleted, tht page break will push off the text on the *next* page (the right hand). It also depends on what kind of page break -- as a character or as a paragraph Keep Option; Next Page, Next Frame, Next Odd Page, Next Column. Way too complicated to script right off the bat.
    All in all, applying that empty master maually is much easier :-)
    [*] Sure, I know how to use the Next Page Number trick. However, I also need the range in my XML output, and the Page Number markers do not play nice when written out in ASCII.

  • To remove leading zeroes and take directly from IDOC(Segment field) to file

    Hi SapAll.
    i have got a simple requirement in a idoc to file Interface.
    here in a sender Idoc there will be one segment with one field,the requirement is to remove leading zeroes and take directly the data from this field and map to one of the field in  reciever  file structure.
    i had used the formatnumber (under arithmatic functions)in PI 3.0 but now when iam using it in PI7.1 it was raising some jave exception error.
    it would be preferable if any body can give me the solution without user defined functions.
    regards.
    Varma.

    from your first post:
    i had used the formatnumber (under arithmatic functions)in PI 3.0 but now when iam using it in PI7.1 it was raising some jave exception error.
    use the same formatting that you used in 3.0 .... try with just a # in the FormatNum function.
    Regards,
    Abhishek.

  • Function mudule to remove leading zeros of curreny and decimal type field

    Hi Expers,
    can any body suggest me the function mudule to remove leading zeros of curreny and decimal type  fields.
    plz do reply as early as possible.
    Thanks .....
    sunil.

    Hi,
    Use this FM CNIF_CONVERT_CURRENCY2EXT
    Import parameters               Value
    I_CURRENCY                      USD
    I_AMOUNT                        00000001233
    I_DECIMALS                      2
    Export parameters               Value
    E_AMOUNT                                           1.233,0000
    Regards
    Shiva

  • Add and remove leading zeroes

    Hi all,
           Iam having a requirement where in a enduser enters the vendor number and after pressing enter key it should display the vendor num along with vendor name concatenated in the same field. But the end user is provided the facility that he may not enter the exact vendor number ( I mean if vendor number is for example 0000055,  the enduser may enter simply 55). The system should convert it with leading zeroes internally. And in display it should display removing leading zeroes.
    like     input:  55              output : 55 Vendor_Name
    my approach
    iam using conversion_exit_alpha_input    for adding leading zeroes       before select query ( to fetch the vendor name for vendor number the user supplies)
    before displaying the output after concatenation,
    iam using  conversion_exit_alpha_output.
    after execution,
    it is asking the exact vendor number .  But in the output, it is giving the vendor number along with vendor name by removing leading zeroes ( as expected).
    how to make the system accept the number without leading zeroes. please suggest me.
    tthanking you in advance
    regards
    Bikash

    Hi Bikash,
    Since you have to display the Vendor number concatenated along with the Vendor Name, why do you need to use the Alpha Exit Function Module. As you have the Vendor number without the zeros in the input field, you can store it in a temporary variable and then once the Vendor name is available you can concatenate it along with the number in the same field.
    If you need a code snippet, you can provide the Technical details of the fields of input. We can use the implicit ABAP    type casting feature to get the Vendor Number without any leading zeros.
    Hope this helps.
    Thanks,
    Samantak.

Maybe you are looking for

  • How to open NRW-files in Lightroom 4?I

    just bought Nikon's Coolpix P7800. It says you can shoot in Raw. Now I want to open these files in LR, just like I'm used to with my SLR's. But Nikon uses the NRW-format for Raw and LR says it doesn't recognise the files. Does someone know if there's

  • Safe Mode Beach Ball

    Beach Ball In safe Mode. Help! installed Fresh copy of os mavericks still getting the beach ball Help me out and how can i set SMC on macbook pro.i did by pressing the keys but there was no indication that it has resetted. help me troubleshoot my pro

  • Price Value  getting  aggregated

    Hey  everyone...     Here  is  my  scenario... I'm   having  a  report  of  inventory  value by  material group  and storage  location... Matgrp                     Qty        Value               Total   1   Material       10        3                

  • How to open an .indd file in commands

    does any one know how to open an .indd file in commands from a plugin(without opening from the normal procedure..File -> Open ...) in my plugin I tried,   SDKFileOpenChooser fileChooser; fileChooser.AddAllFiles(); fileChooser.ShowDialog();      It sh

  • Cannot "insert link from km" in WPC

    Hi. We have EP 7.0 SPS21 implemented. I am experiencing issues with WPC, in that I am now not able to "insert link from km" when in edit mode inside a paragraph or Advanced paragraph. I goto the path of the .PDF file in KM & select it, but the link i