<?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: Alphanumeric Field in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alphanumeric-field/m-p/6607322#M1438263</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hemant,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check below code. I copied code from FM 'TELNUMBER_REMOVE_SPECIAL_CHAR' and a modified little to ur requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: p_number TYPE sp_telno .
DATA: l_number_in  LIKE sph_call-no_dialed,
      l_number_out LIKE sph_call-no_dialed,
      allowed_char(10) VALUE '0123456789'.  " Only allowed characters

DATA: BEGIN OF itab OCCURS 0,
      str TYPE string,
      END OF itab,
      wa LIKE itab.
DATA: out TYPE i.  " Interger to collect only numeric values

wa-str = '134123wert543'.    " Ur internal table
APPEND wa TO itab.  clear wa.
wa-str = '7hfg566yfg'.
APPEND wa TO itab.  clear wa.

LOOP AT itab INTO wa.
  p_number = wa-str.

  MOVE p_number TO l_number_in.
  CLEAR l_number_out.
  CONDENSE l_number_in NO-GAPS.
  TRANSLATE l_number_in TO UPPER CASE.
  IF l_number_in CN allowed_char.
    DO.
      IF l_number_in(1) NE space.
        IF l_number_in(1) CO allowed_char.
          CONCATENATE l_number_out l_number_in(1) INTO l_number_out.
        ENDIF.
        SHIFT l_number_in.
      ELSE.
        EXIT.
      ENDIF.
    ENDDO.
    MOVE l_number_out TO out.
  ELSE.
    MOVE l_number_in TO out.
  ENDIF.
  WRITE:/ out.    " Display integer
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Feb 2010 10:23:57 GMT</pubDate>
    <dc:creator>awin_prabhu</dc:creator>
    <dc:date>2010-02-03T10:23:57Z</dc:date>
    <item>
      <title>Alphanumeric Field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alphanumeric-field/m-p/6607317#M1438258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a field alphanumeric in an internal table I want only numeric value. Please let me know what function I can use for that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Hemant Maurya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2010 09:45:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alphanumeric-field/m-p/6607317#M1438258</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-03T09:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Alphanumeric Field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alphanumeric-field/m-p/6607318#M1438259</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;You can use CO (Contains Only) to restrict the field value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg: itab-field1 CO '0123456789'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2010 09:47:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alphanumeric-field/m-p/6607318#M1438259</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-03T09:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: Alphanumeric Field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alphanumeric-field/m-p/6607319#M1438260</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;PRE&gt;&lt;CODE&gt;data: var1(10) type c value '123a2'.
data: var2(27) type c value 'abcdefghijklmnopqrstuvwxyz'.

if var1 ca var2.
write 'var1 contains aplabets'.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sajid&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2010 09:51:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alphanumeric-field/m-p/6607319#M1438260</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-03T09:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Alphanumeric Field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alphanumeric-field/m-p/6607320#M1438261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Raj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your quick response. Will u please let me know full syntax? I have already alphanumeric data on that field I want move only numeric value to another integer field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Hemant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2010 10:00:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alphanumeric-field/m-p/6607320#M1438261</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-03T10:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Alphanumeric Field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alphanumeric-field/m-p/6607321#M1438262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hemant&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try the below piece of code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
constants : l_c_pattern(52) type c value 'a b c d e f g h i j k l m n o p q r s t u v w x y z '.
constants : l_c_pattern1(52) type c value 'A B C D E F G H I J K L M N O P Q R S T U V W X Y Z '.
data : v_alpnum type char10.

v_alpnum = '23sdsa654'.

translate v_alpnum using l_c_pattern.
translate v_alpnum using l_c_pattern1.
condense v_alpnum no-gaps.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now v_alpnum will have only numeric part.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ranganath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2010 10:13:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alphanumeric-field/m-p/6607321#M1438262</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-03T10:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Alphanumeric Field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alphanumeric-field/m-p/6607322#M1438263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hemant,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check below code. I copied code from FM 'TELNUMBER_REMOVE_SPECIAL_CHAR' and a modified little to ur requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: p_number TYPE sp_telno .
DATA: l_number_in  LIKE sph_call-no_dialed,
      l_number_out LIKE sph_call-no_dialed,
      allowed_char(10) VALUE '0123456789'.  " Only allowed characters

DATA: BEGIN OF itab OCCURS 0,
      str TYPE string,
      END OF itab,
      wa LIKE itab.
DATA: out TYPE i.  " Interger to collect only numeric values

wa-str = '134123wert543'.    " Ur internal table
APPEND wa TO itab.  clear wa.
wa-str = '7hfg566yfg'.
APPEND wa TO itab.  clear wa.

LOOP AT itab INTO wa.
  p_number = wa-str.

  MOVE p_number TO l_number_in.
  CLEAR l_number_out.
  CONDENSE l_number_in NO-GAPS.
  TRANSLATE l_number_in TO UPPER CASE.
  IF l_number_in CN allowed_char.
    DO.
      IF l_number_in(1) NE space.
        IF l_number_in(1) CO allowed_char.
          CONCATENATE l_number_out l_number_in(1) INTO l_number_out.
        ENDIF.
        SHIFT l_number_in.
      ELSE.
        EXIT.
      ENDIF.
    ENDDO.
    MOVE l_number_out TO out.
  ELSE.
    MOVE l_number_in TO out.
  ENDIF.
  WRITE:/ out.    " Display integer
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2010 10:23:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alphanumeric-field/m-p/6607322#M1438263</guid>
      <dc:creator>awin_prabhu</dc:creator>
      <dc:date>2010-02-03T10:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Alphanumeric Field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alphanumeric-field/m-p/6607323#M1438264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Loop at itab into wa.&lt;/P&gt;&lt;P&gt;if wa-field ca '1234567890'.&lt;/P&gt;&lt;P&gt;write wa-field&lt;EM&gt;sy-fdpos(*)." or wa-intfield = wa-field&lt;/EM&gt;sy-fdpos(*).&lt;/P&gt;&lt;P&gt;skip 1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above code will only work if the data is like 'aa123'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if its like '123aa'.&lt;/P&gt;&lt;P&gt;Then just replace like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab into wa.&lt;/P&gt;&lt;P&gt;TRANSLATE wa-field to upper case.&lt;/P&gt;&lt;P&gt;if wa-field ca sy-abcde.&lt;/P&gt;&lt;P&gt;write wa-field&lt;EM&gt;0(sy-fdpos)." or wa-intfield = wa-field&lt;/EM&gt;0(sy-fdpos).&lt;/P&gt;&lt;P&gt;skip 1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please mention how the data is in your field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note You cannot move a character field to type i.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2010 12:57:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alphanumeric-field/m-p/6607323#M1438264</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-02-03T12:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Alphanumeric Field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alphanumeric-field/m-p/6607324#M1438265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;Hello Hemant, 
&amp;lt;li&amp;gt;This is very simple. you have to define one variable type N and pass the internal table field value to numeric field automatically it takes only numeric value. 
&amp;lt;li&amp;gt;Try this way.
&lt;PRE&gt;&lt;CODE&gt;
 REPORT ztest_program.
 DATA:alpnum_var(12) TYPE c VALUE 'XYZ123lms456'.
 DATA:onlynum_var(12) TYPE n.
 
 onlynum_var = alpnum_var.
 WRITE onlynum_var.&lt;/CODE&gt;&lt;/PRE&gt;
Thanks
Venkat.O&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Feb 2010 01:53:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alphanumeric-field/m-p/6607324#M1438265</guid>
      <dc:creator>venkat_o</dc:creator>
      <dc:date>2010-02-04T01:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Alphanumeric Field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alphanumeric-field/m-p/6607325#M1438266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hemanth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declare another numeric charater variable in the program. Pass the alphanumeric field to that and it will take care of it automatically. No need of any programming effor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Praveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Feb 2010 03:29:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alphanumeric-field/m-p/6607325#M1438266</guid>
      <dc:creator>praveen_hannu</dc:creator>
      <dc:date>2010-02-04T03:29:46Z</dc:date>
    </item>
  </channel>
</rss>

