<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Determining field length in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572637#M860008</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please tell me some more details about your internal table which has been used to upload the delimited file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose you got all the records in a single field internal table, then you can try the below  logic.&lt;/P&gt;&lt;P&gt;1)Hope your file records will have 40 '#' Symbols.&lt;/P&gt;&lt;P&gt;2)The point is you need to get the string in between 34th &amp;amp; 35th '#' symbols. And do whatever validation you want.&lt;/P&gt;&lt;P&gt;3) you can write a logic to count the '#' symbols by checking the characters one by one.&lt;/P&gt;&lt;P&gt;I am not sure whether I got your question correctly.&lt;/P&gt;&lt;P&gt;Check &amp;amp; reply/reward if it gives any idea. Or provide some more details.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Mar 2008 13:02:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-19T13:02:21Z</dc:date>
    <item>
      <title>Determining field length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572634#M860005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a delimited file (seperated by #). There are about 40 fields in each record of the file, which are separated by # as mentioned above.Please note that it is not necessary that each of these fields be populated, which means that some fields might be left blank.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement of validating the length of the 35th field, as to whether it exceeds a certain length (20 in this case). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone suggest how can i determine the length of the field, especially when we dont know whether the previous fields are filled or empty, which makes it impossible to determine the correct offset for the 35th field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried using the SPLIT command, and SY-SUBRC is set to 4 if any of the fields exceed the specified length. but i dont know WHICH field is exceeding its length. this is what i want to know precisely.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Raghav.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Mar 19, 2008 5:10 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Mar 2008 12:49:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572634#M860005</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-19T12:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Determining field length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572635#M860006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raghavendra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      How did u use the SPLIT command , try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; data :  itab type table of string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SPLIT  V_string at  CL_ABAP_CHAR_UTILITIES=&amp;gt;HORIZONTAL_TAB  into table ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Loop at itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      v_len = strlen( itab-string )&lt;/P&gt;&lt;P&gt;      if v_len GT 20.&lt;/P&gt;&lt;P&gt;          ***message that field exceeded length 20&lt;/P&gt;&lt;P&gt;      else.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;   endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Mar 2008 13:00:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572635#M860006</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-19T13:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Determining field length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572636#M860007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try moving file contents to a internal table (to respective fields).&lt;/P&gt;&lt;P&gt;In this way , u can easily determine the length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ramya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Mar 2008 13:01:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572636#M860007</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-19T13:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Determining field length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572637#M860008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please tell me some more details about your internal table which has been used to upload the delimited file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose you got all the records in a single field internal table, then you can try the below  logic.&lt;/P&gt;&lt;P&gt;1)Hope your file records will have 40 '#' Symbols.&lt;/P&gt;&lt;P&gt;2)The point is you need to get the string in between 34th &amp;amp; 35th '#' symbols. And do whatever validation you want.&lt;/P&gt;&lt;P&gt;3) you can write a logic to count the '#' symbols by checking the characters one by one.&lt;/P&gt;&lt;P&gt;I am not sure whether I got your question correctly.&lt;/P&gt;&lt;P&gt;Check &amp;amp; reply/reward if it gives any idea. Or provide some more details.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Mar 2008 13:02:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572637#M860008</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-19T13:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: Determining field length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572638#M860009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prammenthiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You got it right partially.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using split using a work area. Please find below the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPLIT p_tab-record AT p_sep INTO&lt;/P&gt;&lt;P&gt;      wa_data-order&lt;/P&gt;&lt;P&gt;      wa_data-text&lt;/P&gt;&lt;P&gt;      wa_data-order_num&lt;/P&gt;&lt;P&gt;      wa_data-comp_code&lt;/P&gt;&lt;P&gt;      wa_data-cost_center&lt;/P&gt;&lt;P&gt;      wa_data-req_comp_code&lt;/P&gt;&lt;P&gt;      w_profit&lt;/P&gt;&lt;P&gt;      wa_data-pers_resp&lt;/P&gt;&lt;P&gt;      wa_data-ext_order_num&lt;/P&gt;&lt;P&gt;      wa_data-req_cost_center&lt;/P&gt;&lt;P&gt;      wa_data-date_ends&lt;/P&gt;&lt;P&gt;      wa_data-status(2)&lt;/P&gt;&lt;P&gt;      wa_data-lock_ind&lt;/P&gt;&lt;P&gt;      wa_data-asset_class&lt;/P&gt;&lt;P&gt;      wa_data-cap_date&lt;/P&gt;&lt;P&gt;      wa_data-deprec_cc&lt;/P&gt;&lt;P&gt;      wa_data-department&lt;/P&gt;&lt;P&gt;      wa_data-applican&lt;/P&gt;&lt;P&gt;      wa_data-telephopr&lt;/P&gt;&lt;P&gt;      wa_data-appdate&lt;/P&gt;&lt;P&gt;      wa_data-startwk&lt;/P&gt;&lt;P&gt;      wa_data-category&lt;/P&gt;&lt;P&gt;      wa_data-setreceiv&lt;/P&gt;&lt;P&gt;      wa_data-setperce&lt;/P&gt;&lt;P&gt;      w_equival&lt;/P&gt;&lt;P&gt;      wa_data-amount&lt;/P&gt;&lt;P&gt;      wa_data-settype&lt;/P&gt;&lt;P&gt;      wa_data-fromper&lt;/P&gt;&lt;P&gt;      wa_data-fromfy&lt;/P&gt;&lt;P&gt;      wa_data-toper&lt;/P&gt;&lt;P&gt;      wa_data-tofy&lt;/P&gt;&lt;P&gt;      wa_data-ma_ist&lt;/P&gt;&lt;P&gt;      wa_data-ma_plan&lt;/P&gt;&lt;P&gt;      wa_data-quadrant&lt;/P&gt;&lt;P&gt;      wa_data-ref_ist&lt;/P&gt;&lt;P&gt;      wa_data-ref_plan&lt;/P&gt;&lt;P&gt;      wa_data-region&lt;/P&gt;&lt;P&gt;      wa_data-tn_ist&lt;/P&gt;&lt;P&gt;      wa_data-tn_istp&lt;/P&gt;&lt;P&gt;      wa_data-tn_plan&lt;/P&gt;&lt;P&gt;      wa_data-tn_plang.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will it not be tedious to search each and every character for a '#' and then do the string length calculation???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Raghav.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Mar 2008 13:53:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572638#M860009</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-19T13:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Determining field length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572639#M860010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I find that the "FIND ALL OCCURRENCES" function is handy.  For example, the untested code below would search the string for "#", and populate a table containing the location of the "#".  You could then just read the results table to find th 35th value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;find all occurrences
   of "#"
    in p_v_editor_text
    ignoring case
    results l_t_mr_objects.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Mar 2008 14:00:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572639#M860010</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-19T14:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: Determining field length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572640#M860011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jerry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does 'find all occurrences' work in version 4.6????&lt;/P&gt;&lt;P&gt;Its giving me a syntax error..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please guide???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Mar 2008 14:07:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572640#M860011</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-19T14:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: Determining field length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572641#M860012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using a BW 7.0 (NW2004S) system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following works on my system.  That would be a shame if it didn't on yours.  It is a very nice tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT zjc_temp.

DATA:
  g_c(80)    TYPE c    VALUE 'abc##123###xyz',
  l_t_mr     TYPE match_result_tab,
  l_s_mr     TYPE match_result.

FIND ALL OCCURRENCES OF '#'
  IN g_c
  RESULTS l_t_mr.


LOOP AT l_t_mr INTO l_s_mr.
  WRITE: / l_s_mr-offset,l_s_mr-length.
ENDLOOP.

WRITE sy-subrc.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prints&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
        3           1
        4           1
        8           1
        9           1
       10           1&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Mar 2008 14:26:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572641#M860012</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-19T14:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Determining field length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572642#M860013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jerry...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it doesnt work...!!! it indeed is a shame...!!!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i hope we do not have to Include anything (like TABLE....or a CLASS...) prior to using this feature....do we???? just a thought......&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Mar 2008 14:33:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572642#M860013</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-19T14:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: Determining field length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572643#M860014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know why Chandrasekhar's code won't work for you in the same way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure you give &lt;STRONG&gt;him&lt;/STRONG&gt; points.  It is his code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT zjc_temp.

DATA:
  g_c(80)    TYPE c    VALUE 'abc##123###xyz',
  itab       TYPE TABLE OF string,
  g_s        TYPE string.

SPLIT g_c AT '#' INTO TABLE itab.

LOOP AT itab INTO g_s.
  WRITE:/ sy-tabix,g_s.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Mar 2008 14:46:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572643#M860014</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-19T14:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: Determining field length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572644#M860015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jerry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to find the precise position of the '#'s occuring in a string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the code mentioned (abc##123###xyz), the # occurs at positions 4,5,9,10 &amp;amp; 11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while, the output is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1  abc&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3  123&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;6  xyz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so, please understand that this is not fulfilling my requirements.&lt;/P&gt;&lt;P&gt;anyways, will award chandrashekhar surely.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Raghav.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 09:34:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572644#M860015</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-24T09:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: Determining field length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572645#M860016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try with describe statement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DESCRIBE FIELD dobj &lt;/P&gt;&lt;P&gt;  [TYPE typ [COMPONENTS com]] &lt;/P&gt;&lt;P&gt;  [LENGTH ilen IN {BYTE|CHARACTER} MODE] &lt;/P&gt;&lt;P&gt;  [DECIMALS dec] &lt;/P&gt;&lt;P&gt;  [OUTPUT-LENGTH olen] &lt;/P&gt;&lt;P&gt;  [HELP-ID hlp] &lt;/P&gt;&lt;P&gt;  [EDIT MASK mask]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;IFF&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 09:46:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572645#M860016</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-24T09:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: Determining field length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572646#M860017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, you could always use "brute force" programming to get the positions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT zjc_temp.

DATA:
  g_c(80)    TYPE c    VALUE 'abc##123###xyz',
  g_char     TYPE c,
  g_len      TYPE i,
  g_offset   TYPE i.


g_len = STRLEN( g_c ).

WHILE g_offset &amp;lt; g_len.
  g_char = g_c+g_offset(1).
  g_offset = g_offset + 1.
  IF g_char = '#'.
    WRITE:/ g_offset.
  ENDIF.
ENDWHILE.


         4
         5
         9
        10
        11
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 13:27:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572646#M860017</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-24T13:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: Determining field length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572647#M860018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raghavendra satwik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I have a delimited file (seperated by #). There are about 40 fields in each record of the file, which are separated by # as mentioned above.Please note that it is not necessary that each of these fields be populated, which means that some fields might be left blank.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;say your record LV_RECORD looks like&lt;/P&gt;&lt;P&gt;f1#f2###############################f33#f34#######&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
lv_ofs = 0.
do 34 times.
  if LV_RECORD+lv_ofs CA '#'.
    lv_ofs = SY-FDPOS + 1. 
  else.
* raise error as  not enough field seoarators are present
  endif.
enddo.
* here the field no. 35 starts
lv_len =  lv_ofs + 1.
if  LV_RECORD+lv_len CA '#'.
  lv_len = sy-fdpos.
endif.
subtract  lv_ofs from lv_len.
* Now you have the length of field no. 35
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 14:39:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572647#M860018</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2008-03-24T14:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Determining field length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572648#M860019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for those very good suggestions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, there is another small problem. The '#' that is present in the file is a hexadecimal one. While debugging, the system shows these '#' as '/h/' (i guess it is converting the hexadecimal to character). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the comparision using CA or EQ fails. i tried using FM 'NLS_STRING_CONVERT_TO_SYS' which converts hexadecimal to character, but it doesnot give me a '/h/' which is appearing the input file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions from you experts????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot again for your kind suggestions ppl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Raghav.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 06:44:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572648#M860019</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T06:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Determining field length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572649#M860020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;&lt;SPAN __default_attr="sylfaen" __jive_macro_name="font"&gt;&lt;SPAN __default_attr="15" __jive_macro_name="size"&gt;
Well firstly,you need to find out the value of the hexa-decimal character. 
Second if you are on Non-Unicode enabled system you can define a variable with the same value of type X, On unicode enabled system you might want to use predefined characters. As in Chandra's example he has used the same for TAB Character. 

Useful class for the same is CL_ABAP_CHAR_UTILITIES.

As per what i understand, you need to find the length of the 35th field and considering "#" represents TAB Character, check below example:

&lt;PRE&gt;&lt;CODE&gt;DATA: str TYPE string,
      itab TYPE TABLE OF string,
      wa TYPE string,
      len TYPE i.
      
" Use the Definition as per your system(UNICODE/NON-UNICODE)
* Unicode system definition
DATA: tab TYPE char1 VALUE cl_abap_char_utilities=&amp;gt;horizontal_tab.  " TAB Character

* Non-Unicide System
DATA: tab(1) TYPE x VALUE '09'.  " TAB Character

....
READ DATASET &amp;lt;file&amp;gt; INTO str.
IF sy-subrc NE 0.
   EXIT.
ELSE.
   SPLIT str AT tab INTO TABLE itab.
   READ TABLE itab INTO wa INDEX 35.  " Fetch Contents of 35th Field
   IF sy-subrc EQ 0.
      CLEAR len.
      len = STRLEN( wa ).
      IF len &amp;gt; 20.
         " Error Message
      ELSE.
         " Required Action
      ENDIF.
   ENIDF.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN __default_attr="maroon" __jive_macro_name="color"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 07:00:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572649#M860020</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T07:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Determining field length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572650#M860021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the brilliant suggestion eswar. it has solved my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot again, and also thanks to all other ppl who gave thier valuable suggestions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Raghav.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 07:15:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determining-field-length/m-p/3572650#M860021</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T07:15:03Z</dc:date>
    </item>
  </channel>
</rss>

