LENGHT OF STRING

HI I AM WORKING IN D2K(FORM 6I).ACCORDING TOPROJECT REQUIRMENT I NEED TO FETCH DATA FROM TABLE AND BASED ON THE VALUE FETCHED DIFFERENT VALUE IS TO DISPLAYED.
AS DECODE STATEMENT DOESNOT WORK IN D2K.I AM FETCHING THE VALUE IN VARIABLE AND DEPENDING ON VALUE FETCHED I CAN DISPLAY DIFFRENT VALUE.HOEVER I ALSO NEED TO FIND RGE LENGHT OF VALUE FETCHED.HOW CAN THIS BE DONE AS ALSO LENGHT FUNCTION DOESNOT WORK IN D2K

No caps pls.
LENGHT -> wont work in sql or forms
LENGTH -> will work in sql and forms
Use post query to modify your value

Similar Messages

  • Getting lenght of String array

    Hi,
    How can i find the lenght of a string array, i have used length method to calculate length of single string value,e.g
    String value = "test"
    int length = value.length()
    Now i want to calculate length of a string array.e.g
    String csv_values = "test,by,random"
    String[] str = csv_values.split(",")
    int lenght = str.length()
    As you can see i want to calculate total number of entries in an array after i split it dynamically.
    Currently it is giving me exception, "Unable to parse exception; Undefined method: length for class: [Ljava.lang.String]"
    Thanks

    This is a tricky one.  An Array has a length property, unlike a String which has a length method.
    So...
    int length = str.length
    Anthony Holloway
    Please use the star ratings to help drive great content to the top of searches.

  • Urgent Find out the lenght of string to write

    Hi,
    I have to write a a string on a JPanel, but depening upon the size available on the panel i have to decide number of characters i can write.
    so how can i make a decesion about it considering the font etc
    Ashish

    In your Graphics object, set your font, then set FontMetrics to measure your String with the stringWidth(String) method. stringWidth(String) returns the String's length in pixels.
    public void someMethod(Graphics gfx){
        Font f10i = new Font(preferedFontChoice, Font.ITALIC, 10);
        gfx.setFont(f10i);
        java.awt.FontMetrics fm=gfx.getFontMetrics();
        int headerLen=fm.stringWidth("Test String");
        //do what you gotta do..
    }Doug

  • Getting both sender's name and e-mail adress

    How can I extract information about both the sender's name and e-mail adress? If I, for example, have an email containing the tag "From: John Doe <[email protected]>" and I use the getFrom() method in MimeMessage, I only get the first part (the name). If i try the getSender() method I get null as a result. And if i use getReplyTo() I also get only the name and not the email address. How do I get the email adress too?
    Best Regards,
    tjosan

    Retrieve and assign the From address to an Address[] object, typecast it to InternetAddress and use the getAddress() - (for email address) or getPersonal() - (for Name) methods on it
    Address[] a;
    a = message.getRecipients(Message.RecipientType.FROM);
    for(int i = 0; i < a.lenght; i++)
    String name = ((InternetAddress)a).getPersonal();
    String email = ((InternetAddress)a[i]).getAddress();

  • Supermarket Array program help!

    class Supermarket {
        double[] profit;
        String[] city;
        String[] aboveAverage;
        double average,deviation;
        double list[], lenght;
        Supermarket(String[] thisCity, double[] thisProfit)
       city = thisCity;
       profit = thisProfit;
        @Override
    public String toString(){
            return "City" + '\t' + "Profit" + '\n' + city + '\t' + profit + 'n';
        public double getSum()
            double sum = 0;
            for(int i = 0; i < profit.length; i++)
                sum = sum + profit;
    return sum;
    public double average()
    return getSum()/profit.length;
    public String aboveAverage()
    String s = "";
    double avg = average();
    for(int i = 0; i < profit.length; i++)
    if(profit[i] > avg)
    s = city[i] + "" + profit[i] + '\n';
    return s;
    public double getDeviation()
    double sumdifference = 0;
    double mean = average();
    for(int i = 0; i < profit.length; i++)
    sumdifference = sumdifference + Math.pow((profit[i]- 1), mean);
    return Math.sqrt(sumdifference/profit.length);
    public double findhighValue()
    double highestValue = profit[0];
    for(int i = 1; i < profit.length; i++)
    if(profit[i] > highestValue )
    highestValue = profit[i];
    return highestValue;
    public double findlowestValue()
    double lowestValue = profit[0];
    for(int i = 1; i > profit.length; i++)
    if(profit[i] > lowestValue)
    lowestValue = profit[i];
    return lowestValue;
    public String barGraph()
    String s = "";
    for(int i = 0; i < profit.length; i++)
    s = s + city[i] + "";
    int x = (int)Math.floor(profit[i]);
    for(int j = 1; j <= i; j++)
    s = s + "*";
    s = s + '\n';
    return s;
    public int findPosition(int startfrom)
    int position = startfrom;
    for(int i = startfrom + 1; 1 < profit.length; i++)
    if(profit[i] < profit[position])
    position = i;
    return position;
    import java.text.DecimalFormat;
    import java.text.NumberFormat;
    import java.util.Locale;
    class TestSupermarket
    public static void main(String arg[])
    NumberFormat nf = NumberFormat.getInstance();
    DecimalFormat df = (DecimalFormat)nf;
    df.applyPattern("0.00");
    Locale local = Locale.US;
    NumberFormat cf = NumberFormat.getCurrencyInstance(local);
    double profit[] = {10200000, 14600000, 17000000, 6700000, 3600000, 9100000};
    String city[] = {"Miami", "Sunrise", "Hollywood", "Tallahassee", "Jacksonville", "Orlando"};
    System.out.println("Millions in revenue " + profit + city);
    Supermarket n = new Supermarket(city, profit);
    System.out.println("Average of profits " + cf.format(n.getSum()));
    System.out.println("\nThe average " + cf.format(n.average()));
    System.out.println("\nthe highest value " + cf.format(n.findhighValue()));
    System.out.println("\nthe lowest value " + cf.format(n.findlowestValue()));
    System.out.println("\nbargraph\t " + n.barGraph());
    System.out.println("\ndeviation " + n.getDeviation());
    System.out.println("\nposition " + n.aboveAverage());
    I'm still having some issues. 
    1st - Deviation calculation seems wrong, as it produces infinite.
    2nd -?     A horizontal bar graph showing the performance for each city, to the nearest million dollars.  Not sure how to produce that.
    3rd - ?     List in descending order of profit, the cities and their respective profit.
    I'm still working on this situation, but help is appreciated if you can set me to the right path.  Producing the array bar is the problem I'm mainly having.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    I offered to help him stated at my last post in his topic. Different people, not sure how to prove we're different people other than IP check. He didn't need to produce "origin"city. Just the two arrays of Profit and city. I went ahead and develop a test class to test out the input.

  • Remove  "  from file

    Hallow Im doing a batch input from file csv (comma dilmeted) In the file I have company that ok and company name with before and after the company name word <b>''</b>    how can I get rid of  from that . just<b> ''</b> before and after the company name .
    *--table with data from file(csv)--
      LOOP AT itab1.
        SPLIT itab1 AT ',' INTO:
           itab-osek_morsh
           <b>itab-company_name</b>
           itab-company_code.
        APPEND itab.
      ENDLOOP.

    Hi Antonio ,
    Now what i understand is that some companies may have " at begining , some may have at end , some may have both and some none .
    So your requirement is that if there is a " as the first char or last then we need remove it , for all other cases it is not required.
    If my understanding is correct , here is the code which gives the desired result
    * Selection Screen
    parameters : p_string type string .
    start-of-selection.
    DATA : t_result type  MATCH_RESULT_TAB. " Internal table
    data : v_string type i .
    v_string = strlen( p_string ).   " Get the lenght of string
    * get the offset of all occurances of " in your string
    FIND ALL OCCURRENCES OF '"' IN P_STRING RESULTS T_RESULT.
    v_string = v_string - 1.  " Here the offset start with zero
    * Check if last char is "
    read table t_result with key OFFSET = v_string transporting NO FIELDS .
    if sy-subrc = 0.
    " If yes remove if from string
    p_string = p_string+0(v_string).
    endif.
    *Check if the first char is "
    read table t_result with key OFFSET = '0' transporting NO FIELDS .
    if sy-subrc = 0.
    * if yes replace with space
      replace '"' in p_string with ' '
    endif.
    Check if this serves your purpose , if not please tell what is the concern you have.
    Thanks
    Arun

  • PDF to Binary

    Hi,
    I create a Adobe Interactive Form, I need to display this PDF in SAP portal, then I need to develop a RFC to return this PDF file, I read in other post that the way is to convert de PDF to binary file a return this binary file like a paremeter in the RFC.
    Someone have an example about this?
    Regards
    Eduardo Campos

    This works for me, it copies an excel file into another excel file.
    You can keep the binary information as long as you want and later download the file to another place.
    You can try it to see if it works for you.
    Remember to keep the file lenght.
    types: stringa(4096).
    data: tabla type standard table of stringa.
    DATA: FILE TYPE STRING.
    DATA: LENGHT TYPE I.
    fILE = 'C:\DOCUMENTS AND SETTINGS\myuser\MY DOCUMENTS\BOOK1.XLS'.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = FILE
       FILETYPE                      = 'BIN'
    *   HAS_FIELD_SEPARATOR           = ' '
    *   HEADER_LENGTH                 = 0
    *   READ_BY_LINE                  = 'X'
    *   DAT_MODE                      = ' '
    IMPORTING
       FILELENGTH                    = LENGHT
    *   HEADER                        =
      TABLES
        DATA_TAB                      = tabla.
    BREAK RJESCISL.
    fILE = 'C:\DOCUMENTS AND SETTINGS\myuser\MY DOCUMENTS\BOOK2.XLS'.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
       BIN_FILESIZE                  = LENGHT
        FILENAME                      = file
       FILETYPE                      = 'BIN'
    *   APPEND                        = ' '
    *   WRITE_FIELD_SEPARATOR         = ' '
    *   HEADER                        = '00'
    *   TRUNC_TRAILING_BLANKS         = ' '
    *   WRITE_LF                      = 'X'
    *   COL_SELECT                    = ' '
    *   COL_SELECT_MASK               = ' '
    *   DAT_MODE                      = ' '
    * IMPORTING
    *   FILELENGTH                    =
      TABLES
        DATA_TAB                      = TABLA
    EXCEPTIONS
       FILE_WRITE_ERROR              = 1
       NO_BATCH                      = 2
       GUI_REFUSE_FILETRANSFER       = 3
       INVALID_TYPE                  = 4
       NO_AUTHORITY                  = 5
       UNKNOWN_ERROR                 = 6
       HEADER_NOT_ALLOWED            = 7
       SEPARATOR_NOT_ALLOWED         = 8
       FILESIZE_NOT_ALLOWED          = 9
       HEADER_TOO_LONG               = 10
       DP_ERROR_CREATE               = 11
       DP_ERROR_SEND                 = 12
       DP_ERROR_WRITE                = 13
       UNKNOWN_DP_ERROR              = 14
       ACCESS_DENIED                 = 15
       DP_OUT_OF_MEMORY              = 16
       DISK_FULL                     = 17
       DP_TIMEOUT                    = 18
       FILE_NOT_FOUND                = 19
       DATAPROVIDER_EXCEPTION        = 20
       CONTROL_FLUSH_ERROR           = 21
       OTHERS                        = 22.
    Edit: Sorry, didn't read the question right.
    Well, is almost the same way, just use Open dataset dsn in binary mode. That way you'll get your file in binary mode.
    I was supossing you were usen a local file but now I see you want it in the application server
    Edited by: Ramiro Escamilla on Feb 29, 2008 10:11 PM

  • App-V 5: An error was encountered while trying to stop the monitoring session

    Hello,
    I have a problem with sequencing an application with the App-V 5 sequencer. During the moment that the sequencer is collecting system changes an dialog box appears with the message "An error was encountered while trying to stop the monitoring session.
    Please check the event log for more details.". When I sequence the same application with App-V 4.6 SP2 sequencer I have no problems.
    In the eventviewer (Microsoft-AppV-Sequencer/Admin) you can see the message "An attempt to stop the monitoring session failed (startIndex cannot be large than lenght of string. Parameter name: startIndex). Event Id: 5003
    I have checked the background activities, but I couldn't find anything suspicious.

    Is the only difference between the platform the sequencer is hosted on the version of the sequencer? have you tested on a vanilla deployment of Windows?
    Please remember to click "Mark as Answer" or "Vote as Helpful" on the post that answers your question (or click "Unmark as Answer" if a marked post does not actually
    answer your question). This can be beneficial to other community members reading the thread.
    This forum post is my own opinion and does not necessarily reflect the opinion or view of my employer, Microsoft, its employees, or other MVPs.
    Twitter:
    @stealthpuppy | Blog:
    stealthpuppy.com |
    The Definitive Guide to Delivering Microsoft Office with App-V

  • Regular Expression to spilt words

    Hi all,
    i want to split the last word in string, after found last space the maximum lenght of string is five words.
    i used the follwoing query not working ok .
    SQL> SELECT REGEXP_SUBSTR('system hello sidval',
      2  '[a-z]+\S+') RESULT
      3  FROM DUAL;
    RESULT
    system
    SQL> examples
    1-  if string is
    Daivd  from  uk    
    output is   uk if string is
    David john
    output is
    john the maximum lenght of string is five words
    regards
    Edited by: Ayham on Oct 7, 2012 12:01 PM
    Edited by: Ayham on Oct 7, 2012 12:18 PM

    Ayham wrote:
    Hi all,
    i want to split the last word in string, after found last space the maximum lenght of string is five words.
    i used the follwoing query not working ok .
    Try thisSQL> SELECT REGEXP_SUBSTR('system hello sidval',  '[a-z]+\S*$') RESULT  FROM DUAL; The extra <tt>$</tt> tells the regex to match the end of the line. the <tt>*</tt> instead of the <tt>+</tt> does also match if the line does not ent with a space character.
    bye
    TPD
    Edited by: TPD Opitz-Consulting com on 07.10.2012 21:35

  • Issue with the Maximum lenght string on application server file

    Hi,
    I have one internal table which cotains aroung 200 fields. The total lenght of the all fields is around 2000 charr.
    I am using open data, transfer and close data set to put my file on application server.
    I am looping at my internal table and then transfering the data on server file.
    The problem is that after generating the file on application server i couldnt see all the fields. i can see only around 500 char.
    not all the data.
    Does there is maximum limit on the number of char on application serevr.
    or there is complete record but we cant see,
    kindly help.

    Hi Sachin,
    As Rainer said you cannot see the full length of row in AL11. The visible length is restricted. If you want to re-confirm whether all data are in. Then download the file from application server to your local system and see the contents. It will be to 2000 characters which you passed.
    Hope this helps.

  • String lenght of a multy-byte string

    Hi Friends,
    I am working with multy-byte(Korea) Strings. What I am doing is I am looking for the presence of an english substring in a multybyte string, find out the position of this substring using java indexof ()method.I am facing a problem here. For the purpose of comparing I am doing a toUppercase() of the multybyte string . I have noticed that this toUppercase() changes the string length and the position of the substring identified by the indexof() method becomes wrong. I could not find out a way to apply indexof() method in an "ignore-case" mode. Is there any java methods to resolve this. Please tell me a way out of this .
    This is a bit urgent. Thanks in advance!!!

    Well, I'm not sure what doing toUpperCase does to non-ASCII characters. If you want to know if it's
    English characters, you should probably do something else...
    java.lang.Character
        public static char toUpperCase(char ch) {
            char mapChar = ch;
            int val = A[Y[((X[ch>>5]&0xFF)<<4)|((ch>>1)&0xF)]|(ch&0x1)];
            if ((val & 0x00010000) != 0) {
                if ((val & 0x07FC0000) == 0x07FC0000) {
                    switch(ch) {
                        // map chars with overflow offsets
                        case '\u00B5' : mapChar = '\u039C'; break;
                        case '\u017F' : mapChar = '\u0053'; break;
                        case '\u1FBE' : mapChar = '\u0399'; break;
                        // map char that have both a 1:1 and 1:M map
                        case '\u1F80' : mapChar = '\u1F88'; break;
                        case '\u1F81' : mapChar = '\u1F89'; break;
                        case '\u1F82' : mapChar = '\u1F8A'; break;
                        case '\u1F83' : mapChar = '\u1F8B'; break;
                        case '\u1F84' : mapChar = '\u1F8C'; break;
                        case '\u1F85' : mapChar = '\u1F8D'; break;
                        case '\u1F86' : mapChar = '\u1F8E'; break;
                        case '\u1F87' : mapChar = '\u1F8F'; break;
                        case '\u1F90' : mapChar = '\u1F98'; break;
                        case '\u1F91' : mapChar = '\u1F99'; break;
                        case '\u1F92' : mapChar = '\u1F9A'; break;
                        case '\u1F93' : mapChar = '\u1F9B'; break;
                        case '\u1F94' : mapChar = '\u1F9C'; break;
                        case '\u1F95' : mapChar = '\u1F9D'; break;
                        case '\u1F96' : mapChar = '\u1F9E'; break;
                        case '\u1F97' : mapChar = '\u1F9F'; break;
                        case '\u1FA0' : mapChar = '\u1FA8'; break;
                        case '\u1FA1' : mapChar = '\u1FA9'; break;
                        case '\u1FA2' : mapChar = '\u1FAA'; break;
                        case '\u1FA3' : mapChar = '\u1FAB'; break;
                        case '\u1FA4' : mapChar = '\u1FAC'; break;
                        case '\u1FA5' : mapChar = '\u1FAD'; break;
                        case '\u1FA6' : mapChar = '\u1FAE'; break;
                        case '\u1FA7' : mapChar = '\u1FAF'; break;
                        case '\u1FB3' : mapChar = '\u1FBC'; break;
                        case '\u1FC3' : mapChar = '\u1FCC'; break;
                        case '\u1FF3' : mapChar = '\u1FFC'; break;
                        // ch must have a 1:M case mapping, but we
                        // can't handle it here. Return ch.
                        // since mapChar is already set, no need
                        // to redo it here.
                        //default       : mapChar = ch;
                else {
                    int offset = val  << 5 >> (5+18);
                    mapChar =  (char)(ch - offset);
            return mapChar;
        }

  • String lenght

    Hello everyone    
    In my script by using "get digit string" menu i get customers unique  number but i want that to be at least 5 character long.For example i do not want him to enter "123" he must enter at least 5 digits.when he enters least then 5 digits i want to play a warning prompt and turn back.I will use  "if" menu i think.How can i do that ?
    Thank you...  

    The get digit string step has a maximum length value which you would set to 5, and yes that is documented.
    However, what it lacks is a minimum value to set.  Anything less than the maximum, and without a terminating key (i.e., #), would fall to the Timeout branch.  In the timeout branch you would check the resulting input's length.
    CED = Get Digit String(--Trggering Contact--, p[please_enter_account_number])     Successful              ...     Timeout          if (CED.length() > 0)               True                    Play Prompt(--Triggering Contact--, p[too_few_digits])                    ...               False                    Play Prompt(--Triggering Contact--, p[no_input_detected])                    ...     Failure          ...

  • 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

  • Lenght of ds string

    Folks,
    We are trying to store xml documents in LDAP. What is the sizelimit? We can load a 2mb file but nothing larger.
    thanks,
    keith

    Hi Frank,
    Can u tell me how u have solved this solution which u posted in sdn long back...
    <b>Hallo,
    when i have a rfc-destination i need to assign a queue for destination?
    Because this error occured by invoking a bapi over plain http-adapter (QoS=EOIO):
    Result:
    <SAP:Error>
    <SAP:Category>XIServer</SAP:Category>
    <SAP:Code>INTERNAL.ATTRIBUTE_INITIAL</SAP:Code>
    <SAP:P1>QUEUE_NAME</SAP:P1>
    <SAP:Stack>Attribute QUEUE_NAME is initial</SAP:Stack>
    </SAP:Error>
    </b>
    I am also getting same error ...
    please can u let me know how u have solved this
    Regards,
    Sridhar

  • HOW CAN I SET AN ITEM LENGHT IN CODE !!!

    hi
    i want to set an item lenght by code!!!! and not by using " property palette". i want to use it in the pre-insert/update trigger . i tried to use "set_item_property" but i didnt find any parameter that can solve my problem.
    Please help me it is very important .
    thanks .

    i will try to explin myself i want to let the user to enter only 40 characters despite the fact that the text item can get up to 70 char ( the text item is based on DB column that is varchar2(70)) and i want to limit the user to 40 char because i take the item he updated or insered from the oracle DB and load it to another DB there the same column is in type varchar2(40) and i want to limit the user insted of substructing the string he is inserting.

Maybe you are looking for

  • Disappearing folders created by 10.8 client on 10.5.8 server

    I have a bizarre problem where a client (running 10.8.n) creates folders on a 10.5.8 server which then disappear for that client. All other clients (running 10.5.n to 10.6.n) on network can see these folders and access them yet the creator cannot. Ca

  • FM transmitter won't work with my iPhone

    I bought a Premier FM transmitter from Auto Zone the other day. It has a 30-pin connector with an led panel that lights up when you connect it to an apple device. It's suppose to work with all 30-pin devices but doesn't work with my iPhone 4 (iOS 7.1

  • Persisted Sessions Count in Tomcat5.0

    I am using Tomcat5.0. I want to find the exact number of sessions associated with application running in the server. By using HttpSessionListener i wrote my logic.So that i can count the number of sessions.My Problem is, Suposse if i stop my tomcat s

  • Activity Type Changes in Work Center

    Hi Experts, We now want to change the activity type in a work center, and hope all the routings that have the work center being changed automatically. Currently, the existing routings can not be changed automatically. Is there a way to have all the r

  • [PSN] To staff of SCEE / SCEA and all

    Hi, I know that with running a huge network infrastructure and maintaining it's uptime is hard and difficult, because let's face it: There is no such thing as perfect 100% uptime. (Ignoring the factors of servers getting DDOS'd and similar factors).