<?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 add 0 at left in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/add-0-at-left/m-p/4191855#M1002016</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need to fill a field with left 0s.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: num(10).&lt;/P&gt;&lt;P&gt;data: len type p,&lt;/P&gt;&lt;P&gt;data: n type n.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;num = '12345'.  " and i want '0000012345'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;describe field num into len.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;n = 10 - len.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;shift num right by n places.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do n times.&lt;/P&gt;&lt;P&gt;   replace space with '0' into num&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this will work, my problem is that describe field always give 10, and i need exactly the number of positions filled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Jul 2008 16:39:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-21T16:39:29Z</dc:date>
    <item>
      <title>add 0 at left</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/add-0-at-left/m-p/4191855#M1002016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need to fill a field with left 0s.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: num(10).&lt;/P&gt;&lt;P&gt;data: len type p,&lt;/P&gt;&lt;P&gt;data: n type n.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;num = '12345'.  " and i want '0000012345'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;describe field num into len.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;n = 10 - len.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;shift num right by n places.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do n times.&lt;/P&gt;&lt;P&gt;   replace space with '0' into num&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this will work, my problem is that describe field always give 10, and i need exactly the number of positions filled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2008 16:39:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/add-0-at-left/m-p/4191855#M1002016</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-21T16:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: add 0 at left</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/add-0-at-left/m-p/4191856#M1002017</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 STRLEN for determining the actual length of the string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;length = STRLEN( string ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also use conversion exit for this: FM CONVERSION_EXIT_ALPHA_INPUT will fill the string with leading zeros (irrelevant how much you actually need)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;ec&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2008 16:40:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/add-0-at-left/m-p/4191856#M1002017</guid>
      <dc:creator>JozsefSzikszai</dc:creator>
      <dc:date>2008-07-21T16:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: add 0 at left</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/add-0-at-left/m-p/4191857#M1002018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Define a character field of length 10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move the value of num field to this character field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pass this character field to the function module 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this will give you a 10 character string with the leading zeroes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Sushil Joshi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2008 16:42:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/add-0-at-left/m-p/4191857#M1002018</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-21T16:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: add 0 at left</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/add-0-at-left/m-p/4191858#M1002019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Javier,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Try the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;  w_strln type i,&lt;/P&gt;&lt;P&gt;  w_str1(10) type n,&lt;/P&gt;&lt;P&gt;  w_places type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_strln = strlen(w_str).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_places = 10 - w_strln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do w_places times.&lt;/P&gt;&lt;P&gt;  concatenate '0' w_str into w_str1.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&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;Regards,&lt;/P&gt;&lt;P&gt;Chandra Sekhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2008 16:55:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/add-0-at-left/m-p/4191858#M1002019</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-21T16:55:42Z</dc:date>
    </item>
  </channel>
</rss>

