<?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: reading a string. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-a-string/m-p/1595259#M267407</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;data str(100).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;str = 'YUGFHKGHKHDKHHHGJK8HJBFXJKKFKJFJKFHJH'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;search str for '8'. write sy-fdpos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Oct 2006 10:27:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-10-05T10:27:50Z</dc:date>
    <item>
      <title>reading a string.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-a-string/m-p/1595257#M267405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts.&lt;/P&gt;&lt;P&gt;how can i read a string at a specified character.&lt;/P&gt;&lt;P&gt;For ex: i have  astring like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;str = 'YUGFHKGHKHDKHHHGJK8HJBFXJKKFKJFJKFHJH'.&lt;/P&gt;&lt;P&gt;so i have to read n.of charecters from starting of the string to charecter 8.&lt;/P&gt;&lt;P&gt;Not with search option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2006 10:23:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-a-string/m-p/1595257#M267405</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-05T10:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: reading a string.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-a-string/m-p/1595258#M267406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry:&lt;/P&gt;&lt;P&gt;do tis way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;split str at '8' into V_one v_two.&lt;/P&gt;&lt;P&gt;v_two would have the string you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;ravi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Ravi Kanth Talagana&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2006 10:24:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-a-string/m-p/1595258#M267406</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-05T10:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: reading a string.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-a-string/m-p/1595259#M267407</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;data str(100).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;str = 'YUGFHKGHKHDKHHHGJK8HJBFXJKKFKJFJKFHJH'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;search str for '8'. write sy-fdpos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2006 10:27:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-a-string/m-p/1595259#M267407</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-05T10:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: reading a string.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-a-string/m-p/1595260#M267408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Fidn the String lenght first,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: Len type i.&lt;/P&gt;&lt;P&gt;String: STR.&lt;/P&gt;&lt;P&gt;      str = 'YUGFHKGHKHDKHHHGJK8HJBFXJKKFKJFJKFHJH'.&lt;/P&gt;&lt;P&gt;Len = STRLEN(STR).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the LEN will have the total lenght, now using the offset you can read as you want ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you understand&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2006 10:28:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-a-string/m-p/1595260#M267408</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-05T10:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: reading a string.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-a-string/m-p/1595261#M267409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SPLIT str AT '8' into str1 str2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;str1 has the string from start to 8&lt;/P&gt;&lt;P&gt;and str2 from 8 to end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can have more 8 in the strings than you need to include more variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If str CS '8'.&lt;/P&gt;&lt;P&gt;   lpos = sy-fdpos - 1.&lt;/P&gt;&lt;P&gt;   write str(lpos) to str1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Anurag Bankley&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2006 10:29:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-a-string/m-p/1595261#M267409</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-05T10:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: reading a string.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-a-string/m-p/1595262#M267410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; You can use the offset technique to get certain part of a string&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;str = 'YUGFHKGHKHDKHHHGJK8HJBFXJKKFKJFJKFHJH'.

v_temp = str+0(8).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where 0 is the starting position and 8 is the length of the string&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so now v_temp will contain YUGFHKGH&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2006 10:34:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-a-string/m-p/1595262#M267410</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-05T10:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: reading a string.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-a-string/m-p/1595263#M267411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you all.&lt;/P&gt;&lt;P&gt;I know all these but in my program it is not workig..Don't know why...&lt;/P&gt;&lt;P&gt;either split or search.Pls see the below sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA  : i_files like spflist occurs 0 with header line,&lt;/P&gt;&lt;P&gt;DATA: w_files LIKE LINE OF  i_files.&lt;/P&gt;&lt;P&gt;data: str1(200) type c,&lt;/P&gt;&lt;P&gt;      str2(200) type c.&lt;/P&gt;&lt;P&gt; LOOP AT i_files INTO w_files.&lt;/P&gt;&lt;P&gt;    str = w_files-line.&lt;/P&gt;&lt;P&gt;    lin1 = STRLEN( str ).&lt;/P&gt;&lt;P&gt;    lin1 = lin1 - 1.(this is because there is one more '#' at the end of string)&lt;/P&gt;&lt;P&gt;    str = str+0(lin1).&lt;/P&gt;&lt;P&gt;    lin2 = STRLEN( str ).&lt;/P&gt;&lt;P&gt;    search str for '#'.&lt;/P&gt;&lt;P&gt;    split str at '#' into str1 atr2.     &lt;/P&gt;&lt;P&gt;    w_files-line = str.&lt;/P&gt;&lt;P&gt;    MODIFY i_files FROM w_files.&lt;/P&gt;&lt;P&gt;    CLEAR lin1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose here str contains:&lt;/P&gt;&lt;P&gt;str = '00000003379#212RegVNegNoticeHLA.aspx.xml'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i am getting sy-subrc = 4 after search.&lt;/P&gt;&lt;P&gt;and after split there are no values in str2..and str1 contains full string..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any body tell me what may be the problem..?&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2006 12:33:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-a-string/m-p/1595263#M267411</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-05T12:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: reading a string.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-a-string/m-p/1595264#M267412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;Hi Ravi,

 Your code works perfectly in my system,

 chk yhis

REPORT YCHATEST.

DATA : I_FILES LIKE SPFLIST OCCURS 0 WITH HEADER LINE.
DATA: W_FILES LIKE LINE OF I_FILES.
DATA: STR1(200) TYPE C,
STR2(200) TYPE C,
STR(200),
LIN1 TYPE I,
LIN2 TYPE I.

I_FILES-LINE = '00000003379#212RegVNegNoticeHLA.aspx.xml#'.
APPEND I_FILES.
CLEAR I_FILES.

LOOP AT I_FILES INTO W_FILES.
  STR = W_FILES-LINE.
  LIN1 = STRLEN( STR ).
  LIN1 = LIN1 - 1.
  STR = STR+0(LIN1).
  LIN2 = STRLEN( STR ).
  SEARCH STR FOR '#'.
  SPLIT STR AT '#' INTO STR1 STR2.
  W_FILES-LINE = STR2.
  MODIFY I_FILES FROM W_FILES.
  CLEAR LIN1.
*  WRITE : / W_FILES-LINE.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2006 12:43:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-a-string/m-p/1595264#M267412</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-05T12:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: reading a string.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-a-string/m-p/1595265#M267413</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;  Though in debugging, some characters resemble '#', in real they might not be. For these cases, searching or splitting with '#' will not work. Kindly check the source of the data to recognize the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2006 12:48:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-a-string/m-p/1595265#M267413</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-05T12:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: reading a string.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-a-string/m-p/1595266#M267414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since the search results in subrc = 4. It means that it is not # but some other character. Can you check it with &lt;/P&gt;&lt;P&gt;CL_ABAP_CHAR_UTILITIES=&amp;gt;CR_LF&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2006 13:17:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-a-string/m-p/1595266#M267414</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-05T13:17:28Z</dc:date>
    </item>
  </channel>
</rss>

