Want to length of the string

Hi,
I have one parameter on the selection screen, when i enter some string on that, it should give me the length of the string. can you pls send me the code.
Ex: if i enter : enter amount : then it should give the o/p is: 12
Akshitha.

use FM
SWA_STRINGLENGTH_GET  
enter your string in EXPRESSION and use the others if needed use "X" for all three except EXPRESSION
EXPRESSION                      GFFHG      
<b>CONDENSE_NO_GAPS                           
CONDENSE                                   
WITH_LEADING_BLANKS                        </b>
also see STRING_LENGTH
    STRING_LENGTH
Message was edited by:
        Amit Singla

Similar Messages

  • PowerShell: Want to get the length of the string in output

    Hi All,
    I am typing this but it is not working. Does anyone know what I could be doing wrong.
    The command I wrote is:
                         GCI -file  | foreach {$_.name} | sort-object length | format-table name, length
    But it is not working. I am expecting a name of the file and length of the string like 8 characters etc. my file is called mystery so it should have 7 as its output of the name, length.
    Thank-you
    SQL 75

    Get-ChildItem supports both  -File and -Directory.
    Help will help:
    https://technet.microsoft.com/library/hh847897(v=wps.630).aspx
    Read the first couple of parameters to see.
       GCI -file  | sort-object length | format-table name, length | ft -auto
    Seems to be a rasher of bad answers to day.  YOu were just extracting the name property then trying to sort on a property that doesn't exist.
    Do the sort first then select the properties.
    it helps to test answers before posting.  I know because I get bit by posting without thinking to often.  I have to remember to think first.
    ¯\_(ツ)_/¯

  • How to find the total length of the string drawed in a rect?

    Hello Everybody,
    I am drawing a string in on one rect using drawInRect method. This drawInRect method gives us a return value as size of the rect. I need length of the string that is did draw in that rect, but didn't find any api to do this.
    Can anyone tell me , how find the length of the string which we did draw in rect?
    Any help regarding this issue , is highly appreciable.
    Thanks,
    Pandit

    Hi Adreas,
    First of all, very thanks for the response.
    Actually , I am looking for other thing. Using drawInRect method I am drawing contentString in self.rect like below.
    //code
    [contentString drawInRect:self.rect withFont:[UIFont fontWithName:@"Verdana" size:14.0] lineBreakMode:UILineBreakModeWordWrap alignment:UITextAlignmentLeft];
    //End
    My contentString is much larger string, so I am not able to draw it in rect(length: 320.0 height: 460.0) completely. My rect is showing only a part of a contentString. So I need to get that part of string which did draw in the rect, so that I can process my contentString to get the remaining string to draw it a next rect.
    The above code statement is returning me the CGSIZE , it is giving the size of the rect but not giving any information of the string which get draw in that rect.Do you have any idea how to do this?
    Any information on this is highly appreciable.
    Thanks,
    Pandit

  • Length of the string passed to rwcgi60 in Oracle 6i

    Hello,
    I am running the report from the web. The url will be something like
    http://localhost/cgi-bin/rwcgi60.exe?server=repserver+report=.rep+all the input parameters.
    When the length of the string passed from report= execeeds certain limit(indicated by dashes) I am getting the cgi error
    Error: The requested URL was not found, or cannot be served at this time.
    Oracle Reports Server CGI - Unable to communicate with the Reports Server.
    If I remove some of the select criteria then I could execute the report from the web.
    Any body has any soln. for this.
    Thanks in advance,
    Vanishri.

    Vanishri
    The limit is very high and you should not be hitting this problem. There are couple of fixes done in this area. Please apply the latest patch (Patch 10) and try.
    Other solution is you can have a mapped key in cgicmd.dat file and use the key alone in the URL. In the cgicmd.dat file, you have to map say
    key1: REPORT=your_report.rdf USERID=user_name/password@mydb DESFORMAT=html
    SERVER=repserver DESTYPE=cache
    Please refer to the Publishing reports or Reports services manual at http://otn.oracle.com/docs/products/reports/content.html
    Thanks
    The Reports Team

  • How to calculate length of the string in transformation file

    Hello all
    I have tried a number of ways and I am not able to calculate the length of the incoming field in transformation file for my data load. Here is the issue.
    I have an incoming string of length 10 and I need to use it to update multiple dimensions which will need first 2, 4 ,6 , 8 characters respectively.
    Now in transformation file ID=ID(1:2) works perfect. However, the BW InfoObject will have multiple values as shown below:
    ID
    Description
    AB
    Business
    ABCD
    Business Organization
    ABCDEF
    Business Line
    ABCDEFGH
    Product Family
    ABCDEFGHIJ
    Product Line
    ABCDEFGHIJKL
    Brand
    I want to update my dimension for Business Organization. I need to update only the records where the length of the incoming string is 4. If I do ID(1:4), I will get the duplicate records and will see the ID less than 4 characters in rejected records. The latter is not such a big issue but the former one is as I need to fetch the right description as well. The formula should check the length and then only pass the record else a dummy value.
    A formula to achieve this in the transformation file is what I am looking for.
    Regards
    Gajendra

    Thanks Vadim for the quick response!
    I am also trying something similar and really appreciate your input here. However, I am not sure if the conversion is really happening.
    Here is what I have done:
    But the strings <> 4 in length are still passing through.

  • Length of a string in a combobox exceeds the width of the combobox

    How do you fix this:
    The length of a string in a combobox exceeds the width of the combobox and as a result, the comboBox changes its size :-(
    I don't want it to change the size even if the length of the string exceeds the width of the comboBox
    what should i do?

    ok i got it
              Dimension d =combo.getPreferredSize();
    combo.setPreferredSize(new Dimension(50, d.height));
    anyone with better solution?

  • Length of a string without using any built-in functions

    code that returns the length of a string without using any built-in functions.
    thanks
    Sam

    A string is internally represented by a character array.  An array of characters will reside on the stack, not the heap.  Yes, we always learned that String is a reference type, but what goes on in your memory might still surprise you...
    A struct is internally represented by only it's private properties, sequentially on the stack.
    So basically, what I thought is happening by messing with the structlayout: is only tricking our programming a bit into thinking that the top X bytes on the stack represent a chararray, while actually we put them there as a string.
    Wrong. True. And wrong.
    A string is internally represented by, in that order, an array length, a string length, the chars. None of them resides on the stack.
    An array is internally represented by, in that order, an array length and the chars. None of them resides on the stack.
    When you use the FieldOffset attribute to handle the string as a char array, you don't get anything right:
    - the Length returned is the "array length" of the string, which is equal to the string length + 1.
    - the chars returned by the array indexer are shifted by 2 chars (the length of the "string length" field).
    You can use the FieldOffset to make that work, but it needs a little bit more work.
    unsafe static int Test()
    string myString = "This string may contain many string inside this string";
    string testString = "string";
    int countResult = 0;
    fixed (char* myChars = new StringToChar { str = myString }.chr, testChar = new StringToChar { str = testString }.chr)
    // The 2 first chars of the array are actually the string length.
    int myCharsLength = myChars[1] << 16 | myChars[0];
    int testCharLength = testChar[1] << 16 | testChar[0];
    for (int i = 0; i < myCharsLength - testCharLength + 1; i++)
    if (myChars[i + 2] == testChar[2])
    for (int j = 1; j < testCharLength; j++)
    var c = testChar[7];
    if (myChars[i + 2 + j] != testChar[j + 2])
    goto endOfCharAnalyses;
    countResult++;
    endOfCharAnalyses:
    continue;
    return countResult;

  • Sql query related to beaking the string based on string postion

    Hi,
    I have coloumn in this way
    city_state
    texas tx
    sanantanio tx
    newyork ny
    newjersy nj
    newyork
    newjersy
    landon 1000
    I want to get the last characters after the space from the string(eg: texas tx) only tx, that means i want to only break the strings that have space in the 3rd position when counting the string from back. the others records that do not match as above stated should decoded as 'unknown'
    (eg 'landon 1000' decode as unknown or 'newyork' decode to unknown )
    can anyone please help out on this query.
    thanks,
    Ram

    with t as (
               select 'texas tx' city_state from dual union all
               select 'sanantanio tx' from dual union all
               select 'newyork ny' from dual union all
               select 'newjersy nj' from dual union all
               select 'newyork ' from dual union all
               select 'newjersy' from dual union all
               select 'landon 1000' from dual
    select  city_state,
            case
              when regexp_like(city_state,' ..$') then substr(city_state,-2)
              else 'unknown'
            end state
      from  t
    CITY_STATE    STATE
    texas tx      tx
    sanantanio tx tx
    newyork ny    ny
    newjersy nj   nj
    newyork       unknown
    newjersy      unknown
    landon 1000   unknown
    7 rows selected.
    SQL> SY.

  • Regarding the lenght of the string?

    hai friends,
       can any one tell me how to find the length of the string..?
    ex: data x type string
    x = 9989.
    where now length of x is 4.
    so how can i  find what is the length of the string,..?
    regards
    satish.v

    Define another variable type I
    DATA:v_length type i.
    v_length = strlen( X ).
    That will give you the length of the string.
    Reward poin ts if sueful.
    Regards,
    Nageswar

  • How to split the string?

    Hi Experts,
    Can anyone explain me with code how to separate the single character from the given input string?
    For Example: Input String str = 'RAGHU'
    Output should be:
    R
    RA
    RAGH
    RAGHU
    RAGH
    RAG
    RA
    R
    Can anyone help me with code for above required output?
    Thanks in Advance,
    Regards,
    Raghu.

    HI,
    sy-index will give u the iteration number.
    first of all in this program u are counting the length of the string and it was in variable LEN.
    we are always printing the string from 0 index(1st character) to POS number of characters.
    length is 5 so LNG = 5 * 2 = 10 and LNG = 10 - 1 = 9.and first sy-index = 1.so,1 <= 5 so POS = 0 + 1 = 1. it is printing the first char
    second sy-index = 2.so,2 <= 5 so POS = 1 + 1 = 2. it is printing the first two chars
    third sy-index = 3.so,3 <= 5 so POS = 2 + 1 = 3. it is printing the first three chars
    forth sy-index = 4.so,4 <= 5 so POS = 3 + 1 = 4. it is printing the first four chars
    fifth sy-index = 5.so,5 <= 5 so POS = 4 + 1 = 5. it is printing the first five chars
    sixth sy-index = 6.so,6 > 5 so POS = 5 - 1 = 4. it is printing the first four chars
    seventh sy-index = 7.so,7 > 5 so POS = 4 - 1 = 3. it is printing the first three chars
    eighth sy-index = 8.so,8 > 5 so POS = 3 - 1 = 2. it is printing the first two chars
    ninth sy-index = 9.so,9 > 5 so POS = 2 - 1 = 1. it is printing the first char
    rgds,
    bharat.

  • Get the string between li tags, with regular expression

    I have a unordered list, and I want to store all the strings between the li tags (<li>.?</li>)in an array:
    <ul>
    <li>This is String One</li>
    <li>This is String Two</li>
    <li>This is String Three</li>
    </ul>
    This is what have so far:
    <li>(.*?)</li>
    but it is not correct, I only want the string without the li tags.
    Thanks.

    No one?
    Anoyone here experienced with Regular Expression?

  • Unexpected "result of the string concatenation is too long" error

    Hello,
    I am using Oracle Database 11.2.0.
    When querying my database with a common table expression which concatenates VARCHAR2 strings, I receive an ORA-01489 error although I'm doubting that I am concatenating more than 4000 characters.
    To be more precise, I have a table entity which basically stores XML elements including their parent element and their sibling position among its siblings. The CREATE statement for this table is listed below.
    CREATE TABLE Entity (
    ID NUMBER(10,0) NOT NULL PRIMARY KEY,
    Name VARCHAR2(100) NOT NULL,
    Parent NUMBER(10,0) REFERENCES Entity(ID),
    Sibling_Pos NUMBER(2,0) DEFAULT 0
    Now, I would like for all elements to be concatenated with their ancestor elements to a structure like this:
    "/root_element(sibling_pos)/.../ancestor_element(sibling_pos)/parent_element(sibling_pos)/current_element(sibling_pos)"
    (where root_element, ancestor_element, parent_element and current_element are just values from the name column of the entity table)
    In order to achieve this, I use a common table expression which concatenates the name and sibling_pos values as shown below:
    WITH entity_cte (lvl, id, path) AS (
    SELECT 1 AS lvl, id, '/' || name || '(0' || sibling_pos || ')' AS path
    FROM entity
    WHERE parent IS NULL
    UNION ALL (
    SELECT lvl + 1 AS lvl, e.id, entity_cte.path || '/' || e.name || '(' || cast(e.sibling_pos AS VARCHAR2(2)) || ')' AS path
    FROM entity_cte, entity e
    WHERE entity_cte.id = e.parent
    SELECT lvl, id, path
    FROM entity_cte e
    After inserting certain values, I get the ORA-01489 error, that the result of the string concatenation is too long. The maximum is referred to as being 4000 characters for VARCHAR2 in the oracle documentation and in various websites. Of course, it is clear to me by just using the common table expression like that, I could run into such an error. However, due to the structure of my XML documents, I doubted that the resulting strings would be more than 4000 characters long.
    So, I rearranged my query in order to count the characters to be concatenated instead of actually concatenating them. The query is stated below as well, the changes are marked bold:
    WITH entity_cte (lvl, id, path) AS (
    SELECT 1 AS lvl, id, length('/' || name ||  '(0' || sibling_pos || ')') AS path
    FROM entity
    WHERE parent IS NULL
    UNION ALL (
    SELECT lvl + 1 AS lvl, e.id, entity_cte.path + length('/' || e.name || '(' || cast(e.sibling_pos AS VARCHAR2(2)) || ')') AS path
    FROM entity_cte, entity e
    WHERE entity_cte.id = e.parent
    SELECT lvl, id, path
    FROM entity_cte e
    ORDER BY path DESC
    The result of the query gives me a maximum length of 319 characters.
    To be sure, I also checked the maximum level depth (indicated by the column named lvl in the common table expression), meaning the maximum number of elements in my path (the concatenated string). The result is 18. As I use VARCHAR2(100) for the name column and add 5 charcaters in each level, the maximum number of characters expected for 18 levels would be 1890.
    So, now I wonder is the ORA-01489 maybe raised for another reason? Or is there something else I am missing?
    Any help would be appreciated. Further suggestions to track down the error are more than welcome. Thanks in advance.

    Thanks for the hint, BluShadow.
    Still, I don't reach that limit of 1000 characters with my actual data (yet). I understand that if my data changes, I might run into that error with the given query. But I don't understand why this error is raised with the given data I have. The longest string in the column "name" is 32 characters long up to now. When I'm adding 5 characters on each level and I only have max 18 levels that should only result in max 2664 bytes.
    @odie_63
    The database characterset is: AL32UTF8. If I googled correctly, than it just confirms what BluShadow said, that one character is represented by max 4 byte.
    Regarding the sample data, the XML document that I am inserting and which causes the error comprises 1058 nodes. That means I have 1058 entries in my entity table. I think it would be no sense posting all of it here, but is there a way that I can attach a text file containing an insert script to this post?
    Some sample data from the entity table orderd by the length of the string in the name column are shown below.
    "ID"     "NAME"     "TYPE"     "PARENT"     "SIBLING_POS"
    90     "representedCustodianOrganization"     1     89     0
    109     "serviceProviderOrganization"     1     108     0
    58     "standardIndustryClassCode"     1     55     2
    186     "standardIndustryClassCode"     1     173     7
    150     "standardIndustryClassCode"     1     137     7
    106     "dischargeDispositionCode"     1     99     4
    35     "administrativeGenderCode"     1     29     3
    932     "substanceAdministration"     1     931     0
    950     "substanceAdministration"     1     949     0
    1043     "representedOrganization"     1     1041     1
    71     "representedOrganization"     1     61     6
    137     "representedOrganization"     1     128     5
    173     "representedOrganization"     1     163     6
    504     "substanceAdministration"     1     503     0
    223     "representedOrganization"     1     221     1
    252     "representedOrganization"     1     250     1
    272     "representedOrganization"     1     270     1
    477     "substanceAdministration"     1     476     0
    481     "manufacturedLabeledDrug"     1     480     0
    207     "representedOrganization"     1     205     1
    802     "specimenPlayingEntity"     1     801     0
    830     "specimenPlayingEntity"     1     829     0
    844     "specimenPlayingEntity"     1     843     0
    858     "specimenPlayingEntity"     1     857     0
    99     "encompassingEncounter"     1     98     0
    788     "specimenPlayingEntity"     1     787     0
    676     "specimenPlayingEntity"     1     675     0
    704     "specimenPlayingEntity"     1     703     0
    718     "specimenPlayingEntity"     1     717     0
    746     "specimenPlayingEntity"     1     745     0
    Any help or further suggestion are appreciated. Thank you.

  • Trying to get the string from javax.xml.transform.Source

    I have a SOAP client that will submit a string of data to a url and return an xml string back. It works ok besides that last part.
    I found on another site someone took the returned XML and printed it to the system print box. I want to just get the string out to a variable to pass back..
    This chunk works:
    TransformerFactory tff = TransformerFactory.newInstance();
    Transformer tf = tff.newTransformer();
    Source sc = rp.getSOAPPart().getContent();
    StreamResult result = new StreamResult(System.out);
    tf.transform(sc, result);
    System.out.println();Instead of this I just want to catch the XML string in a String variable. Thanks for the help.

    Instead of giving your StreamResult System.out, give it a StringWriter. You can then call toString on the StringWriter, and get what you're after
    StringWriter output = new StringWriter();
    TransformerFactory.newInstance().newTransformer().transform(source, new StreamResult(output));
    String xmlResult = output.toString();

  • Any method to find out length of a string !!

    Hello friends,
                  I used <i><b>describe</b></i> statement to find out the length of a string, but it actually returns the whole length of the string but not actual no. of char's in this.
    any one suggest a solution for this.
    Senthil

    Hi Senthil
    The ABAP function STRLEN returns the length of a string up to the last character that is not a space.
    [COMPUTE] <n> = STRLEN( <c> ).
    STRLEN processes any operand <c> as a character data type, regardless of its real type. There is no type conversion.
    As with mathematical functions, the keyword COMPUTE is optional.
    DATA: INT TYPE I,
    WORD1(20) VALUE '12345'.
          WORD2(20).
          WORD3(20) VALUE ' 4 '.
    INT = STRLEN( WORD1 ). WRITE INT.
    INT = STRLEN( WORD2 ). WRITE / INT.
    INT = STRLEN( WORD3 ). WRITE / INT.
    The results are 5 , 0, and 4 respectively.
    Regs
    vijay

  • Determining length of a string

    Hi,
    I got a string e.g strx = "abcde". Is there any function to determine the length of the string, here e.g. it would be 5?
    I appreciate any help in advance. Thanks.

    Use the length() method of the String object class
    String strx = "abcde";
    int len = strx.length();
    System.out.println(len);
    //Daniel.

Maybe you are looking for

  • Why can't I see who I shared a photo with anymore?

    In the past, if I shared a photo via email I would see the details under info of who I sent the photo to. A great feature to prevent repeats. I can't see it anymore. Where did it go?

  • My app store is not responding

    I downloaded App Store after checking for new updates on my MacBook Pro and it worked, but when i click on the icon, it does not work and the icon is a piece of paper with office supplies, not the actual app store icon. How can i fix this?

  • HT201263 ipad 2 wont start

    my ipad 2 stoped working a few hrs ago i was just simply watching a video and it froze and i let it sit to un freeze and it completyly turned off and yes it did have full charge and after that it wont turn back on if i press the sleep and home botton

  • Router Mode

    Airport Utility (v 6.3.1) / Network / Router Mode defaulted to "Off (Bridge Mode)". After spending all afternoon with the "MYAPPLE" gurus, it turned that the proper setting was "DHCP and NAT". Does the fact that I'm running DNSCrypt have any bearing

  • HDV Capturing

    I see that FCP is set up for capturing HDV 720p 30. I need to be able to capture both 720p 24 and 720p 25. Any answers?