How to check the length of a field symbol value

hi all,
i have a problem with string function, i have assined  table fields to  a field symbol in a loop i want check the length of the assigned fields symbol value  in every loop . i have written like ,,,,,len = strlen( <fs>). then i am getting the length of the field label what i ahve assigned to fiels symbol not the field value lenght ,
please advise me on this,
thanks,
sre

I think you're on the right track.  This should work:
data: len type i.
data: begin of itab OCCURS 1,
        a type string value '1',
        b type string value '12',
        c type string value '123',
      end of itab.
FIELD-SYMBOLS: <fs> type ANY.
do 3 times.
  assign component sy-index of STRUCTURE itab to <fs>.
  len = strlen( <fs> ).
enddo.

Similar Messages

  • How to restrict the length of input field

    Hi,
    How to restrict the length of input field. That is we should not be able to enter more thatn 10 charecters.
    Regards,
    H.V.Swathi

    Hi swathi,
    For this you have to create a simple data type. No need of writing a code.
    Go to Dictionaries -> Local Dictionary -> Data Type - > Simple Type - > Right click and "Create Simple Type".
    Here you should create a Simple type with String as built-in Type. Here you will also see the Length Constraints option.
    Set the value of maximum length and minimum length. In your case set the value of maximum length to 10. At runtime this will not allow the user to enter more than 10 characters.
    Now create an attribute and bind it to this newly created simple type. Bind the value of the input field with this particular attribute.
    Regards
    Manohar

  • How to get the length of a field.

    Hi all,
    I m working on dynamic internal table.There is a need to get the length of a field, filled dynamically.How can we get it.
    Thanks in advance.
    Regards,
    Swati garg

    Swati,
    DATA: text(8) TYPE c,
          len TYPE i.
    DESCRIBE FIELD text LENGTH len IN CHARACTER MODE.
    Field LEN contains the value 8.
    ================================
    For ouput length :
      DATA: float TYPE f,
          out TYPE i,
          len TYPE i.
    DESCRIBE FIELD float LENGTH len OUTPUT-LENGTH out.
    This example results in the field LEN containing the value 8, while the field OUT contains the value 22.
    Don't forget to reward if useful.....

  • How to get the length of a field value, not the length of DB's CHAR(20)

    Hello.
    I'm trying to handle a String from my DataBase and get its length:
    String myName;
    int i;
    PreparedStatement sql = Conn.prepareStatement("SELECT NAME FROM MY_TABLE");
    ResultSet results = sql.executeQuery();
    results.next();
    myName = results.getString("NAME");
    i = myName.length();
    out.println("The value is " + myName + " and the length is " + String.valueOf(i) );
    I get:
    " The value is Tom and the lengh is 20 "
    20 is the length of the field (it's a CHAR (20) ), but I would like to get the length
    of 'Tom'.
    On other hand, I would like to detect if this value is 'Tom' or not, but trying with:
    if (myName.equals("Tom")) {...}
    or
    if (myName == "Tom") {...}
    There is no response.
    Any experience?

    myName = results.getString("NAME");
    if(myName!=null) myName = myName.trim(); //Take out trailing spaces
    i = myName.length();Sudha

  • How to check the sql:query is return null value

    I have use :
    <sql:query var="sql1" dataSource="${db}">
    select col_name from table_name
    where a=<c:out value="${row.test1}"/>
    and b='<c:out value="${row.test2}"/>'
    </sql:query>
    So, how can I check this statement return null value which is no record within this table?

    The Result should never be null but can be empty. You can check if the Result is empty using an if tag and checking the rowCount property:
        <sql:query var="books"
          sql="select * from PUBLIC.books where id = ?" >
          <sql:param value="${bookId}" />
        </sql:query>
         <c:if test="${books.rowCount > 0}">
         </c:if>http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSTL7.html#wp84217
    Look for query Tag Result Interface

  • How to copy the structure of a Field Symbol?

    Hi,
              I have a requirement where in a dynamic Internal table is supposed to be created. I have created that dynamic table using the class method cl_alv_table_create=>create_dynamic_table. Here I have a structure in the field symbol. My requirement is how do I create a internal table with the structure that is there in the field symbol?...
    and i'm unable to refer to the field that is dynamically created in the field symbol.
    Like,
    <gfs_tab>-pernr = itab-pernr.
    in the above stmt the field pernr is created in the field symbol dynamically.
    Thanks,
    Deepak.

    Hi Matt,
                my objective is to create an internal table with structure that i have obtained in <gfs_tab> .
    other than the pernr, there are many fields dynamically generated.
    say if I have generated the following structure in <gfs_tab> :
    pernr            ename1            day1             day2                 day3
    then I want to create an internal table with the above structure so that my internal table will have fields:
    1) pernr
    2) ename1
    3) day1
    4) day2
    5) day3
    for each execution of the report there will be different structure generated in <gfs_tab> depending upon the inputs that I give.
    Thanks,
    Deepak.

  • How to change the lenth of existing field in sap standard table

    Hi all,
    can anybody help,my requirement is, how to change the length of existing field in sap standard table....
    thanks in advance..

    Which field are you thinking of in particular?  Are you wanting to increase or decrease the length?
    Some fields are used so extensively that a change to their length will mean adjusting many tables, some of them potentially very large, and hence taking a long time to adjust.
    Some standard SAP programs expect certain fields to be of specific lengths and won't work if the length is changed.
    Some screens could cease to work.
    If you decrease length, then you could lose data.
    matt

  • How to check the verity version in our PeopleSoft Installation?

    How to check the verity version in our PeopleSoft Installation? I am not sure if the verity is installed or not and also if installed what is the version?

    yes. it says the version is 5.0.1
    Is there any difference in installation or configuration when the app and web server are in same machine and when the app and web server are installed in different servers?
    ============================================
    D:\fs840\webserv\peoplesoft>mkvdk
    mkvdk - Verity, Inc. Version 5.0.1 (_nti40, Jul 23 2004)
    Usage: mkvdk [<option>...] <filespec>...
    Where <option> can be a VDK switch, or any of:
    -about Show the collection's about resources
    -autodel Delete bulk insert file when no longer needed
    -backup <dir> Specify collection backup location
    -bulk Submit bulk insert file(s)
    -charmap <name> Specify the character map to VDK
    -collection <path> Specify the collection (required)
    -create Create the collection
    -credentials <user> Specify user[:passwd][:domain][:mailbox]
    -datapath <path> Specify VDK datapath
    -datefmt <fmt> Specify date format to VDK
    -debug Enable debugging output
    -delete Delete documents
    -description <desc> Set the collection's description
    -diskcache <num> Set VDK's disk cache size (kbytes)
    -extract Extract field values from text
    -help Print this usage information
    -insert Insert documents (default)
    -locale <locale> Specify the locale to VDK
    -logfile <file> Save output in a log file
    -loglevel <num> Set the VDK output level for the log
    -mailboxes This option is depracated. Use the credentials option inste
    ad
    -maxfiles <num> Set VDK's maximum number of open files
    -maxmemory <num> Set VDK's maximum memory usage (kbytes)
    -mode <mode> Set the indexing mode
    -modify Modify fields using field/value pairs from a bulkfile
    -nohousekeep Disable housekeeping
    -noindex Disable indexing
    -nolock Turns off locking (dangerous)
    -nooptimize Disable optimizations
    -nosave Don't save collection work list
    -noservice Prevents servicing of submitted work
    -nosubmit Don't submit work to VDK
    -numdocs <num> Number of documents to insert from bulk insert file(s)
    -numpages <num> Synonym for diskcache for backward compatibility
    -offset <num> Specify offset into bulk insert file(s)
    -online Flag for online Bulk Modify
    -optimize <spec> Optimize the collection
    -outlevel <num> Set the VDK output level
    -persist Service the collection forever
    -purge Remove all documents from collection
    -purgeback Purge in the background
    -purgewait <secs> Specify delay before purge
    -quiet Suppress all non-error messages
    -repair Repair the collection
    -servlev <spec> Advanced option for overriding service level
    -sleeptime <secs> Interval between service calls for persist
    -style <dir> Specify style directory for create
    -submit Synonym for noservice for backward compatibility
    -synch Perform work synchronously
    -topicset <path> Specify VDK topic set
    -update Update documents
    -vdkhome <path> Specify VDK home
    -verbose Output more information
    -words Build word assist list
    -wordindex Build word assist index
    The <spec> for -optimize is a hyphenated string of:
    maxmerge Perform maximal merging of partitions
    squeeze Recover space from deleted documents
    vdbopt Build optimized VDB's
    spanword Create word list spanning all partitions
    ngramindex Create ngram index into spanning word list
    maxclean Really clean (not for read-write)
    readonly Make the collection read-only
    tuneup Fully optimize for read-write use
    publish Fully optimize for read-only use
    The <spec> for -servlev is a hyphenated string of:
    search Enable search and retrieval
    insert Enable adding and updating documents
    optimize Enable opportunistic collection optimization
    assist Enable building of word list
    housekeep Enable housekeeping of unneeded files
    delete Enable document deletion
    backup Enable backup
    purge Enable background purging
    repair Enable collection repair
    dataprep Same as search-index-optimize-assist-housekeep
    index Same as insert-delete
    Error: must specify collection
    mkvdk done
    D:\fs840\webserv\peoplesoft>

  • How to Increase the Length of Condition table in OV20

    While creating a condition table in T.code OV20 if fields length is more that 50 bytes table is not getting generated.it gives error as Too Many Fields Selected(More than 50 Bytes).
    Actually i need to create a tabel with Basic Material(WRKST) which has length of 48 bytes.
    Is there a solution on how to increase the length so that error is avoided.
    There is no such error occuring while crating condition table in V/03

    Hi,
         You can try to use the type string:
    form like zscr_data_hdr-form,
    werks like zscr_data_hdr-werks,
    matnr like zscr_data_hdr-matnr,
    verid like zscr_data_hdr-verid,
    lot like zscr_data_hdr-lot,
    lot_qty like zscr_data_hdr-lot_qty,
    udate like zscr_data_hdr-udate,
    utime like zscr_data_hdr-utime,
    zuser like zscr_data_hdr-zuser,
    processed like zscr_data_hdr-processed,
    defect like zscr_defect_data-defect,
    vornr like zscr_route_data-vornr,
    fieldxx type string,
    dayst like zscr_data_hdr-dayst,
    end of t_data.
    So you can save you informations of every fld<n> concatenating their values into fieldxx.
    Regards

  • How to increase the length of description

    Dear Guru's
    we want to increase the length of Decription field in thBOM Item line 1   item line 2.can we increase the length.presently its having 40 characters  capacity.
    Thanks & Rgds
    Pankaj Agarwal

    1.I dont think this is possible as this is a standard SAP requriement.
    2.check the data eleaement -which has the 40 as character lenth.
    so it is not recomended to change it.
    Solution
    3.You can use the ItemLongTEXT - which doesnt have any restriction in the lenght.
    so dont change the standard setting use the itmelONGTEXT this should solve ur issue
    Reg
    Dsk
    Edited by: SatheeshkumarD on May 8, 2008 11:01 AM

  • How to increase the length of internal table dynamically

    How to increase the length of internal table dynamically depending on the number of fields fetched into the internal table ?
    The requirement code :
    types: begin of t_data,
             form          like zscr_data_hdr-form,
             werks         like zscr_data_hdr-werks,
             matnr         like zscr_data_hdr-matnr,
             verid         like zscr_data_hdr-verid,
             lot           like zscr_data_hdr-lot,
             lot_qty       like zscr_data_hdr-lot_qty,
             udate         like zscr_data_hdr-udate,
             utime         like zscr_data_hdr-utime,
             zuser         like zscr_data_hdr-zuser,
             processed     like zscr_data_hdr-processed,
             defect        like zscr_defect_data-defect,
             vornr         like zscr_route_data-vornr,
             fld1          like zscr_defect_data-defect_val,
             fld2          like zscr_defect_data-defect_val,
             fld3          like zscr_defect_data-defect_val,
             fld4          like zscr_defect_data-defect_val,
             fld5          like zscr_defect_data-defect_val,
             fld6          like zscr_defect_data-defect_val,
             fld7          like zscr_defect_data-defect_val,
             fld8          like zscr_defect_data-defect_val,
             fld9          like zscr_defect_data-defect_val,
             fld10         like zscr_defect_data-defect_val,
             fld11         like zscr_defect_data-defect_val,
             fld12         like zscr_defect_data-defect_val,
             fld13         like zscr_defect_data-defect_val,
             fld14         like zscr_defect_data-defect_val,
             fld15         like zscr_defect_data-defect_val,
             fld16         like zscr_defect_data-defect_val,
             fld17         like zscr_defect_data-defect_val,
             fld18         like zscr_defect_data-defect_val,
             fld19         like zscr_defect_data-defect_val,
             fld20         like zscr_defect_data-defect_val,
             fld21         like zscr_defect_data-defect_val,
             fld22         like zscr_defect_data-defect_val,
             fld23         like zscr_defect_data-defect_val,
             fld24         like zscr_defect_data-defect_val,
             fld25         like zscr_defect_data-defect_val,
             fld26         like zscr_defect_data-defect_val,
             fld27         like zscr_defect_data-defect_val,
             fld28         like zscr_defect_data-defect_val,
             fld29         like zscr_defect_data-defect_val,
             fld30         like zscr_defect_data-defect_val,
             fld31         like zscr_defect_data-defect_val,
             fld32         like zscr_defect_data-defect_val,
             fld33         like zscr_defect_data-defect_val,
             fld34         like zscr_defect_data-defect_val,
             fld35         like zscr_defect_data-defect_val,
             fld36         like zscr_defect_data-defect_val,
             fld37         like zscr_defect_data-defect_val,
             fld38         like zscr_defect_data-defect_val,
             fld39         like zscr_defect_data-defect_val,
             fld40         like zscr_defect_data-defect_val,
             fld41         like zscr_defect_data-defect_val,
             fld42         like zscr_defect_data-defect_val,
             fld43         like zscr_defect_data-defect_val,
             fld44         like zscr_defect_data-defect_val,
             fld45         like zscr_defect_data-defect_val,
             fld46         like zscr_defect_data-defect_val,
             fld47         like zscr_defect_data-defect_val,
             fld48         like zscr_defect_data-defect_val,
             fld49         like zscr_defect_data-defect_val,
             fld50         like zscr_defect_data-defect_val,
             fld51         like zscr_defect_data-defect_val,
             fld52         like zscr_defect_data-defect_val,
             fld53         like zscr_defect_data-defect_val,
             fld54         like zscr_defect_data-defect_val,
             fld55         like zscr_defect_data-defect_val,
             fld56         like zscr_defect_data-defect_val,
             fld57         like zscr_defect_data-defect_val,
             fld58         like zscr_defect_data-defect_val,
             fld59         like zscr_defect_data-defect_val,
             fld60         like zscr_defect_data-defect_val,
             fld61         like zscr_defect_data-defect_val,
             fld62         like zscr_defect_data-defect_val,
             fld63         like zscr_defect_data-defect_val,
             fld64         like zscr_defect_data-defect_val,
             fld65         like zscr_defect_data-defect_val,
             fld66         like zscr_defect_data-defect_val,
             fld67         like zscr_defect_data-defect_val,
             fld68         like zscr_defect_data-defect_val,
             fld69         like zscr_defect_data-defect_val,
             fld70         like zscr_defect_data-defect_val,
             fld71         like zscr_defect_data-defect_val,
             fld72         like zscr_defect_data-defect_val,
             fld73         like zscr_defect_data-defect_val,
             fld74         like zscr_defect_data-defect_val,
             fld75         like zscr_defect_data-defect_val,
             fld76         like zscr_defect_data-defect_val,
             fld77         like zscr_defect_data-defect_val,
             fld78         like zscr_defect_data-defect_val,
             fld79         like zscr_defect_data-defect_val,
             fld80         like zscr_defect_data-defect_val,
             fld81         like zscr_defect_data-defect_val,
             fld82         like zscr_defect_data-defect_val,
             fld83         like zscr_defect_data-defect_val,
             fld84         like zscr_defect_data-defect_val,
             fld85         like zscr_defect_data-defect_val,
             fld86         like zscr_defect_data-defect_val,
             fld87         like zscr_defect_data-defect_val,
             fld88         like zscr_defect_data-defect_val,
             fld89         like zscr_defect_data-defect_val,
             fld90         like zscr_defect_data-defect_val,
             fld91         like zscr_defect_data-defect_val,
             fld92         like zscr_defect_data-defect_val,
             fld93         like zscr_defect_data-defect_val,
             fld94         like zscr_defect_data-defect_val,
             fld95         like zscr_defect_data-defect_val,
             fld96         like zscr_defect_data-defect_val,
             fld97         like zscr_defect_data-defect_val,
             fld98         like zscr_defect_data-defect_val,
             fld99         like zscr_defect_data-defect_val,
             fld100         like zscr_defect_data-defect_val,
             fld101         like zscr_defect_data-defect_val,
             fld102         like zscr_defect_data-defect_val,
             fld103         like zscr_defect_data-defect_val,
             fld104         like zscr_defect_data-defect_val,
             fld105         like zscr_defect_data-defect_val,
             fld106         like zscr_defect_data-defect_val,
             fld107         like zscr_defect_data-defect_val,
             fld108         like zscr_defect_data-defect_val,
             fld109         like zscr_defect_data-defect_val,
             fld110         like zscr_defect_data-defect_val,
             fld111         like zscr_defect_data-defect_val,
             fld112         like zscr_defect_data-defect_val,
             fld113         like zscr_defect_data-defect_val,
             fld114         like zscr_defect_data-defect_val,
             fld115         like zscr_defect_data-defect_val,
             fld116         like zscr_defect_data-defect_val,
             fld117         like zscr_defect_data-defect_val,
             fld118         like zscr_defect_data-defect_val,
             fld119         like zscr_defect_data-defect_val,
             fld120         like zscr_defect_data-defect_val,
             fld121         like zscr_defect_data-defect_val,
             fld122         like zscr_defect_data-defect_val,
             fld123         like zscr_defect_data-defect_val,
             fld124         like zscr_defect_data-defect_val,
             fld125         like zscr_defect_data-defect_val,
             fld126         like zscr_defect_data-defect_val,
             fld127         like zscr_defect_data-defect_val,
             fld128         like zscr_defect_data-defect_val,
             fld129         like zscr_defect_data-defect_val,
             fld130         like zscr_defect_data-defect_val,
             fld131         like zscr_defect_data-defect_val,
             fld132         like zscr_defect_data-defect_val,
             fld133         like zscr_defect_data-defect_val,
             fld134         like zscr_defect_data-defect_val,
             fld135         like zscr_defect_data-defect_val,
             dayst         like zscr_data_hdr-dayst,
           end of t_data.
    In this fld1 to fld135 are defined in internal table.
    But if the number of fields are more than 135 then the program is going to short dump.
    Some times fld1 to fid170 or more fields will be there in my internal table.
    Please suggest me how to make my requirement dynamic and display this data fetched into this internal table onto a .XLS file in the presentation server ?

    Hi
    You can try to use the type string:
    form like zscr_data_hdr-form,
    werks like zscr_data_hdr-werks,
    matnr like zscr_data_hdr-matnr,
    verid like zscr_data_hdr-verid,
    lot like zscr_data_hdr-lot,
    lot_qty like zscr_data_hdr-lot_qty,
    udate like zscr_data_hdr-udate,
    utime like zscr_data_hdr-utime,
    zuser like zscr_data_hdr-zuser,
    processed like zscr_data_hdr-processed,
    defect like zscr_defect_data-defect,
    vornr like zscr_route_data-vornr,
    fieldxx type string,
    dayst like zscr_data_hdr-dayst,
    end of t_data.
    So you can save you informations of every fld<n> concatenating their values into fieldxx.
    Max

  • How to restrict the length of the input?

    Hi all, could any one tell me how to restrict the length of the input string? My SOA Suite is 10.1.3.1
    I tried the following; getting an error.
    <element name="RestrictLengthProcessRequest">
    <simpleType name="SSN">
    <restriction base="string">
    <length value="10"/>
    </restriction>
    </simpleType>
    where RestrictLengthProcessRequest is the message name of the corresponding .wsdl and SSN is the input whose length is to be restricted.
    The error is : 'Attribute name not defined on element simpleType'
    Thanks in advance.
    Edited by: user11275112 on Aug 27, 2009 11:44 PM

    Hi swathi,
    For this you have to create a simple data type. No need of writing a code.
    Go to Dictionaries -> Local Dictionary -> Data Type - > Simple Type - > Right click and "Create Simple Type".
    Here you should create a Simple type with String as built-in Type. Here you will also see the Length Constraints option.
    Set the value of maximum length and minimum length. In your case set the value of maximum length to 10. At runtime this will not allow the user to enter more than 10 characters.
    Now create an attribute and bind it to this newly created simple type. Bind the value of the input field with this particular attribute.
    Regards
    Manohar

  • How To Increase the Size of Memo Fields 4000 Char in WebCenter 11g?

    How To Increase the Size of Memo Fields greater than 4000 Char in WebCenter Content (UCM) 11g?
    I was able to increase the size of Memo field from 2000 Char to 4000 by setting parameter value MEMOFIELDSIZE=4000 . But the requirement is to increase the size more than 4000 around 7000 char but Database(Oracle 11G) is not supporting more than 4000 char.
    Is there any other way to increase the size of Memo field?
    Thanks in Advance!!
    Regards
    Ram

    Hello All,
    Thanks for your responses.
    Let me explain the scenario again in detail:
    1. we have three meta-data fileds xProductCategory,xProductFamily and xProducts
    2. These fields are related with DCL feature and corresponding values are being stored in corresponding custom Views
    3. xProducFamily is dependent of xProductCategory and xProduct is dependent on xProductFamily
    4. currently, there are around 250 Product values and average name of Product can be of 25 Char, so if we are selecting all product values for some Contents then Product Values are being stored in DocMeta table as comma separated values with one space, so total characters are being very high than 4K Char.
    5. Currently view that is storing the Product values, stores "Name" column instead of ID(like 1,2,3....)
    6. And our Content Server is integrated with Oracle WebSenter Portal, where logic has written to retrieve the contents based on "Product Name" instead of "Product ID" and already we are in UAT phase.Currently we are not in situation to revert the changes from Product Name to Product ID.
    7. Also if we are storing the values on the basis of Product ID, then again the issue may arise in Future, if the number of Products increased.
    Hoping the issue explanation is clear now and waiting for some possible solution for increasing the length of memo field.
    Thanks in Advance !!
    Regards
    Ram

  • How to check the value in Table CDPOS

    Mostly I can't see the following fields value in the table CDPOS,
      (1) CDPOS-VALUE_NEW
      (2) CDPOS-VALUE_OLD
    In fact, it should have values, so how to check the values, is there any special method needed?
    Thanks and best regards.

    Ferry Lianto,
    Thank you very much for your expertise.
    It's helpful to get some contents via FM:CHANGEDOCUMENT_READ_POSITIONS, the problem is, to some kind of DELETION operation, the log in table CDPOS is very simple, I still don't know which contents were deleted even though I found records in table CDPOS.
    Is there any other suggestions?
    Thanks and best regards.

  • How to check the current open period

    Hello ABAP Gurus,
    Could you help on how to check the current open period...
    Sample would be
    current date = may 1, 2009  but period for may is not yet open
    so open would be april period
    Thanks in advance....
    Edited by: nanz ruiz on May 27, 2009 3:34 AM

    Hi,
       Check the fieldas FRYE2,FRPE2,TOYE2,TOPE2 of table T001B for a given varient.
    Regards
    Vishnu Gupta

Maybe you are looking for