<?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 operation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation/m-p/4986583#M1161722</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Check string_value CO '1234567890'  " to be read as the string_value contains only characters from the string 1234567890 . i.e. it only contains numbers
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Jan 2009 07:53:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-13T07:53:32Z</dc:date>
    <item>
      <title>String operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation/m-p/4986582#M1161721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a string variable which should ideally contain an integer value which i am asigning to an integer variable. Now accidentaly if a character value is present in the string variable the program gives a dump while trying to assign that character variable to the integer variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So here before i assign the string variable(which should ideally contain an integer value) to the integer variable i need to perform a check, to check whether the string variable contains an integer value or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i do this? What can be the best possible logic to detect this???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Anindya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2009 07:49:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation/m-p/4986582#M1161721</guid>
      <dc:creator>Anindya</dc:creator>
      <dc:date>2009-01-13T07:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: String operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation/m-p/4986583#M1161722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Check string_value CO '1234567890'  " to be read as the string_value contains only characters from the string 1234567890 . i.e. it only contains numbers
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2009 07:53:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation/m-p/4986583#M1161722</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-13T07:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: String operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation/m-p/4986584#M1161723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use if variable CA 'ABCDEFG'.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;IF Variable contains value as Text.&lt;/P&gt;&lt;P&gt;the if condition will succeed and goes inside it, then we can say the variable containing character instead of integer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2009 07:54:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation/m-p/4986584#M1161723</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-13T07:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: String operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation/m-p/4986585#M1161724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try with string CO '0123456789'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or do exception handling.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data OREF type ref to CX_ROOT.&lt;/P&gt;&lt;P&gt;data TEXT type STRING.&lt;/P&gt;&lt;P&gt;try.&lt;/P&gt;&lt;P&gt;  int = string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CATCH CX_SY_CONVERSION_NO_NUMBER INTO OREF.&lt;/P&gt;&lt;P&gt;    TEXT = OREF-&amp;gt;GET_TEXT( ).&lt;/P&gt;&lt;P&gt;  CLEANUP.&lt;/P&gt;&lt;P&gt;   CLEAR int.&lt;/P&gt;&lt;P&gt; endtry.&lt;/P&gt;&lt;P&gt; if not TEXT is initial.&lt;/P&gt;&lt;P&gt;    MESSAGE e001(00) WITH text.           "error&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2009 07:59:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation/m-p/4986585#M1161724</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-13T07:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: String operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation/m-p/4986586#M1161725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this snippet. Hope will be helpful for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA a TYPE string VALUE '234'.
DATA b TYPE i.
IF a CO '0123456789'.
  b = a.
  WRITE b.
ELSE.
  MESSAGE 'Character is present in string' TYPE 'I'.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2009 08:11:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation/m-p/4986586#M1161725</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-13T08:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: String operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation/m-p/4986587#M1161726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the below FM. It helps u...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NUMERIC_CHECK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2009 08:18:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation/m-p/4986587#M1161726</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-13T08:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: String operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation/m-p/4986588#M1161727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anindya,&lt;/P&gt;&lt;P&gt;Check this code, which removes all characters other than numbers in a string &lt;/P&gt;&lt;P&gt;and assigns it to an integer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: w_txt TYPE string,
      w_hold TYPE string.

DATA w_num TYPE i.

w_txt = '12g8#1?5'.

DO.
  IF w_txt CO '0123456789'.
    EXIT.
  ELSE.
    w_hold = w_txt+sy-fdpos(1).
    REPLACE w_hold WITH space INTO w_txt.
    CONDENSE w_txt NO-GAPS.
  ENDIF.
ENDDO.

w_num = w_txt. "Required number&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;i/p: 12g8#1?5
o/p: 12815&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&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;Manoj Kumar P&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Manoj Kumar on Jan 13, 2009 9:42 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2009 08:37:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation/m-p/4986588#M1161727</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-13T08:37:04Z</dc:date>
    </item>
  </channel>
</rss>

