<?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: How to use string relational operator. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-string-relational-operator/m-p/1844893#M358593</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chetan.&lt;/P&gt;&lt;P&gt;When you declare the select options declare it this way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options : s_field(3) type n.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The system will automatically take care that you can enter only number of length 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sutapa.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Jan 2007 11:03:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-16T11:03:00Z</dc:date>
    <item>
      <title>How to use string relational operator.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-string-relational-operator/m-p/1844891#M358591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In my program,I have one 'Period' select option,having string length '3', I want only number should be entered in this select option,if user enter other than number any value then it should show an error message.&lt;/P&gt;&lt;P&gt;currently I am using 'CA' operator but problem in this is that out of  '3' if any one contain number then instead of getting error message i am getting short dump.for it is giving error message if all '3' character are alphabet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.: 1. If Period = 388,   working fine.&lt;/P&gt;&lt;P&gt;      2. If period = ABC,   Getting error message.&lt;/P&gt;&lt;P&gt;      3. If period = p18,   getting short dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I want the error message for third case also not a shot dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used 'cO' also but the problem in his is that it not except the only one character like only '1' or '2' it want all the three field should be filled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can  anyone help me out in his problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chetan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2007 10:42:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-string-relational-operator/m-p/1844891#M358591</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-16T10:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to use string relational operator.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-string-relational-operator/m-p/1844892#M358592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe you can use Function module 'NUMERIC_CHECK'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;br&lt;/P&gt;&lt;P&gt;Werner&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2007 11:02:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-string-relational-operator/m-p/1844892#M358592</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-16T11:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to use string relational operator.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-string-relational-operator/m-p/1844893#M358593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chetan.&lt;/P&gt;&lt;P&gt;When you declare the select options declare it this way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options : s_field(3) type n.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The system will automatically take care that you can enter only number of length 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sutapa.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2007 11:03:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-string-relational-operator/m-p/1844893#M358593</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-16T11:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to use string relational operator.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-string-relational-operator/m-p/1844894#M358594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;why you do not use type n variable in your selection screen then it will accept only numeric values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;other way,&lt;/P&gt;&lt;P&gt;data : vdata,&lt;/P&gt;&lt;P&gt;         pos type i.&lt;/P&gt;&lt;P&gt;do 3 times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vdata = string+pos(1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if vdata ca '&amp;lt;nos&amp;gt;'.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;error msg&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;pos = pos + 1.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or use fm&lt;/P&gt;&lt;P&gt;NUMERIC_CHECK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2007 11:07:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-string-relational-operator/m-p/1844894#M358594</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-16T11:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to use string relational operator.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-string-relational-operator/m-p/1844895#M358595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi chetan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of using 'Contains Any (CA)' operator, use the SEARCH operator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To search a character field for a particular pattern, use the SEARCH statement as follows:&lt;/P&gt;&lt;P&gt;SEARCH &amp;lt;c&amp;gt; FOR &amp;lt;str&amp;gt; &amp;lt;options&amp;gt;.&lt;/P&gt;&lt;P&gt;The statement searches the field &amp;lt;c&amp;gt; for &amp;lt;str&amp;gt; starting at position &amp;lt;n1&amp;gt;. If successful, the return code value of SY-SUBRC is set to 0 and SY-FDPOS is set to the offset of the string in the field &amp;lt;c&amp;gt;. Otherwise, SY-SUBRC is set to 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use the following for &amp;lt;options&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;pattern&amp;gt; Searches for &amp;lt;pattern&amp;gt; (any sequence of characters). Trailing blanks are ignored.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PLZ REWARD POINTS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2007 11:08:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-string-relational-operator/m-p/1844895#M358595</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-16T11:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to use string relational operator.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-string-relational-operator/m-p/1844896#M358596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi chetan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;follow this.. it will automatically check your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you want that move to character field... you can..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;data: v_num type NUM03,&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;      v_char_low type CHAR03,&lt;/P&gt;&lt;P&gt;       v_char_high type CHAR03&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;select-options s_number for v_num&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_char_low = s_number-low.&lt;/P&gt;&lt;P&gt;v_char_high = s_number-high.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Close this thread.. when u r problem is solved&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if Helpful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Naresh Reddy K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2007 11:18:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-string-relational-operator/m-p/1844896#M358596</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-16T11:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to use string relational operator.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-string-relational-operator/m-p/1844897#M358597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check the code with your entries .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT zforum12 message-id vij.

parameters : val(3)  type c.
data : final(3) type c,
       cnt type i,
       v type c,
       n type i.

at selection-screen.

cnt = strlen( val ).
do cnt times.
move val+n(1) to v.
if v ca '0123456789'.
move v to final+n(1).
else.
message e999 with 'Not a valid input'.
endif.
n = n + 1.
if n = cnt .
exit.
endif.
enddo.

condense final no-gaps.
start-of-selection.
write:/ final .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2007 11:20:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-string-relational-operator/m-p/1844897#M358597</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-16T11:20:49Z</dc:date>
    </item>
  </channel>
</rss>

