<?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: Split URL in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-url/m-p/2696824#M624264</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which release of SAP are you using, can you use the FIND statement?&lt;/P&gt;&lt;P&gt;You can specify first occurence and matching offsets with this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chester&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Aug 2007 11:28:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-16T11:28:09Z</dc:date>
    <item>
      <title>Split URL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-url/m-p/2696823#M624263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a requirement where in i have to split a URL &lt;/P&gt;&lt;P&gt;for ex: i have to split the below url into different variables&lt;/P&gt;&lt;P&gt;/thread/523646 &lt;B&gt;[original link is broken]&lt;/B&gt;&lt;/P&gt;&lt;P&gt;but i have to split based on conditions:&lt;/P&gt;&lt;P&gt;1. split the url from the first '//' to '/'&lt;/P&gt;&lt;P&gt;2. split from '/irj/' to '?' &lt;/P&gt;&lt;P&gt;3. split at 'threadID=' till the end&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result should be like&lt;/P&gt;&lt;P&gt;//www.sdn.sap.com/&lt;/P&gt;&lt;P&gt;sdn/thread&lt;/P&gt;&lt;P&gt;523646&amp;amp;tstart=0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 10:54:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-url/m-p/2696823#M624263</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-16T10:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Split URL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-url/m-p/2696824#M624264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which release of SAP are you using, can you use the FIND statement?&lt;/P&gt;&lt;P&gt;You can specify first occurence and matching offsets with this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chester&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 11:28:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-url/m-p/2696824#M624264</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-16T11:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Split URL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-url/m-p/2696825#M624265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steve,&lt;/P&gt;&lt;P&gt;I am implementing it in BI7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 11:49:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-url/m-p/2696825#M624265</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-16T11:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: Split URL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-url/m-p/2696826#M624266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this.. i have done it upto the first 2 strings reqd... use the same logic for the last one&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: lv_url type string value '/thread/523646 &amp;lt;b&amp;gt;[original link is broken]&amp;lt;/b&amp;gt;'.
data: lv_url2 type string.
data: lv_slash2(2).
data: lv_slashirj(5).
data: lv_quest.
data: len type i.
data: count type i value 0.
data: pos1 type i.
data: pos2 type i.
data: pos3 type i.
data: lv_times type i.
data: to1 type i.
data: to2 type i.

len = strlen( lv_url ).

do len times.
  lv_slash2 = lv_url+count.
  "write:/ lv_slash2.
  if lv_slash2 = '//'.
    pos1 = count.
  endif.
  count = count + 1.
enddo.

count = pos1 + 2. " start from that position
lv_times = len - count.
do lv_times times.
  lv_slashirj = lv_url+count.
  if lv_slashirj = '/irj/'.
    pos2 = count.
    exit.
  endif.
  count = count + 1.
enddo.

count = pos2 + 5.
lv_times = len - count.
do lv_times times.
  lv_quest = lv_url+count.
  if lv_quest = '?'.
    pos3 = count.
    exit.
  endif.

*  write:/ lv_quest.

  count = count + 1.
enddo.


to1 = pos2 - pos1 + 1.
write:/ lv_url+pos1(to1).

to2 = pos3 - pos2 - 5.
pos2 = pos2 + 5.
write:/ lv_url+pos2(to2).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 12:23:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-url/m-p/2696826#M624266</guid>
      <dc:creator>former_member189059</dc:creator>
      <dc:date>2007-08-16T12:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: Split URL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-url/m-p/2696827#M624267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you do have the FIND command, so you could try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: lv_url type string value '/thread/523646 &lt;B&gt;[original link is broken]&lt;/B&gt;'.&lt;/P&gt;&lt;P&gt;data: lv_url2 type string.&lt;/P&gt;&lt;P&gt;data: len type i.&lt;/P&gt;&lt;P&gt;data: pos1 type i.&lt;/P&gt;&lt;P&gt;data: pos2 type i.&lt;/P&gt;&lt;P&gt;data: pos3 type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;find first occurrence of '//' in lv_url match offset pos1.&lt;/P&gt;&lt;P&gt;find first occurrence of '/irj/' in lv_url match offset pos2.&lt;/P&gt;&lt;P&gt;len = pos2 - pos1 + 1.&lt;/P&gt;&lt;P&gt;lv_url2 = lv_url+pos1(len).&lt;/P&gt;&lt;P&gt;write:/ lv_url2.&lt;/P&gt;&lt;P&gt;find first occurrence of '?' in lv_url match offset pos3.&lt;/P&gt;&lt;P&gt;len = pos3 - pos2.&lt;/P&gt;&lt;P&gt;add 5 to pos2.subtract 5 from len.&lt;/P&gt;&lt;P&gt;lv_url2 = lv_url+pos2(len).&lt;/P&gt;&lt;P&gt;write: / lv_url2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chester&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;N.B. If you cannot guarantee "first occurrence" specify offset using pos fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 13:17:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-url/m-p/2696827#M624267</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-16T13:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: Split URL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-url/m-p/2696828#M624268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;**Check the Example below, it serves your purpose&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZTRIP_TEST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;url(255),&lt;/P&gt;&lt;P&gt;s1(255),&lt;/P&gt;&lt;P&gt;s2(255),&lt;/P&gt;&lt;P&gt;s3(255),&lt;/P&gt;&lt;P&gt;s4(255),&lt;/P&gt;&lt;P&gt;s5(255).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;url = '/thread/523646 &lt;B&gt;[original link is broken]&lt;/B&gt;'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;split url at '?threadID=' into S1 S2.&lt;/P&gt;&lt;P&gt;split s1 at 'irj/' into s3 s4.&lt;/P&gt;&lt;P&gt;split s3 at ':' into s1 s5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write:/ s5,/ s4,/ s2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**Reward points if useful, get back in case of query&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 14:13:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-url/m-p/2696828#M624268</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-16T14:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: Split URL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-url/m-p/2696829#M624269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Respect is due to Tripat Pal Singh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 14:22:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-url/m-p/2696829#M624269</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-16T14:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Split URL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-url/m-p/2696830#M624270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks Kris...Chester and Tripat Praaji....ill try implementing using these examples....and will get back to this thread....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 17:38:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-url/m-p/2696830#M624270</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-16T17:38:06Z</dc:date>
    </item>
  </channel>
</rss>

