<?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: String Length upto specific chars in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-length-upto-specific-chars/m-p/7320130#M1536763</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ivan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks it worked....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ganesh Reddy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Oct 2010 13:49:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-10-01T13:49:47Z</dc:date>
    <item>
      <title>String Length upto specific chars</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-length-upto-specific-chars/m-p/7320126#M1536759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to pull the value of string from ZST to ZLP in the given example ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ZSTB2L10ZLP&lt;STRONG&gt;ZLS&lt;/STRONG&gt;ZGC*   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e        B2L10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advise me your logic.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ganesh Reddy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Sep 2010 19:51:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-length-upto-specific-chars/m-p/7320126#M1536759</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-30T19:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: String Length upto specific chars</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-length-upto-specific-chars/m-p/7320127#M1536760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data: lv_string  type string.&lt;/P&gt;&lt;P&gt;data: lv_res type char10.&lt;/P&gt;&lt;P&gt;data: lv_var1 type char10,&lt;/P&gt;&lt;P&gt;data: lv_var2 type char10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_string = ZSTB2L10ZLP*ZLS*ZGC* &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;split lv_string at 'ZST' into lv_var1 lv_var2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;split lv_var2 at 'ZLP' into lv_res lv_var1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write: lv_res.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- Why don't you try some ting like above..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Naveen Inuganti.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Sep 2010 19:57:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-length-upto-specific-chars/m-p/7320127#M1536760</guid>
      <dc:creator>naveen_inuganti2</dc:creator>
      <dc:date>2010-09-30T19:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: String Length upto specific chars</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-length-upto-specific-chars/m-p/7320128#M1536761</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;supposing it starts always with 'ZST'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: lv_string TYPE String VALUE 'ZSTB2L10ZLP*ZLS*ZGC*'.

DATA: mlen TYPE i.

FIND REGEX '.*(?=ZLP)' IN lv_string MATCH LENGTH mlen.

SUBTRACT 3 FROM mlen.

WRITE lv_string+3(mlen).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is more general, it gets the substring everywhere&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: lv_string TYPE String VALUE 'AZSTB2L10ZLP*ZLS*ZGC*'.

DATA: moff TYPE i,
      mlen TYPE i.

FIND REGEX '(?=ZST).*(?=ZLP)' IN lv_string MATCH OFFSET moff MATCH LENGTH mlen.

ADD 3 TO moff.
SUBTRACT 3 FROM mlen.

WRITE lv_string+moff(mlen).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ivan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Sep 2010 21:23:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-length-upto-specific-chars/m-p/7320128#M1536761</guid>
      <dc:creator>_IvanFemia_</dc:creator>
      <dc:date>2010-09-30T21:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: String Length upto specific chars</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-length-upto-specific-chars/m-p/7320129#M1536762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naveen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your quick reply,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of your are taking value into the variable can we read directly from the table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table : ZPERFORM&lt;/P&gt;&lt;P&gt;Fielld  : AUT_KEY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AUT_KEY contains all values i.e &lt;STRONG&gt;ZSTB2L10ZLP&lt;/STRONG&gt;ZLS&lt;STRONG&gt;ZGC&lt;/STRONG&gt;*.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please could you give me the logic &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ganesh Reddy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Oct 2010 11:47:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-length-upto-specific-chars/m-p/7320129#M1536762</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-01T11:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: String Length upto specific chars</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-length-upto-specific-chars/m-p/7320130#M1536763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ivan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks it worked....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ganesh Reddy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Oct 2010 13:49:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-length-upto-specific-chars/m-p/7320130#M1536763</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-01T13:49:47Z</dc:date>
    </item>
  </channel>
</rss>

