<?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: Padding character fields with zeros in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254452#M1631489</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Indeed it is and i did test but i had the same number of chars in the field as the size of the var itself and that just trew me off....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i can accomplish my goal with the following as well. It takes less lines this way too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var = 'hello             '.&lt;/P&gt;&lt;P&gt;tmp = '0000000000'.&lt;/P&gt;&lt;P&gt;len = STRLEN ( var ).&lt;/P&gt;&lt;P&gt;describe FIELD var LENGTH olen IN CHARACTER MODE.&lt;/P&gt;&lt;P&gt;if len &amp;lt;&amp;gt; olen.&lt;/P&gt;&lt;P&gt;   OVERLAY var+len WITH tmp.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Oct 2011 15:08:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-10-05T15:08:09Z</dc:date>
    <item>
      <title>Padding character fields with zeros</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254438#M1631475</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;I need to add zeros to the end of character fields TYPE C. I know i can use the conversion routines but that only works for numeric fields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 11:59:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254438#M1631475</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-05T11:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Padding character fields with zeros</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254439#M1631476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use OVERLAY &lt;/P&gt;&lt;P&gt;For instance, If your variable has 10 positions and you want to add zeros or whatever character at the end of it, you can use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: VAR TYPE C LENGTH 10.
VAR = 'TEXT'.
OVERLAY VAR WITH '0000000000'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 12:08:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254439#M1631476</guid>
      <dc:creator>former_member209703</dc:creator>
      <dc:date>2011-10-05T12:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Padding character fields with zeros</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254440#M1631477</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;Thank you for the prompt reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know of the OVERLAY solution but that only works if you have a continuos string in your field 'ie: no spaces between chars'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i have a field with "Thank you" in it and use the overlay trick then i end up with "Thank0you" which is not desirable. I only want to add zeros at the end of the field not replace all spaces with zeros.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to achieve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 12:17:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254440#M1631477</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-05T12:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Padding character fields with zeros</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254441#M1631478</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 concatenate 0000 as string to your variable at end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;br,&lt;/P&gt;&lt;P&gt;Rahul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 12:20:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254441#M1631478</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-05T12:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Padding character fields with zeros</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254442#M1631479</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;then OVERLAY will still work... just add an offset:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  DATA: var TYPE c LENGTH 10,
        len TYPE i.

  var = 'THANK YOU'.
  len = STRLEN( var ).
  OVERLAY var+len WITH '0000000000'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kr,&lt;/P&gt;&lt;P&gt;m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 12:24:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254442#M1631479</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-05T12:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: Padding character fields with zeros</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254443#M1631480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can think of two ways.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using a WHILE loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while strlen(  ) &amp;lt; 10.&lt;/P&gt;&lt;P&gt;  concatenate var '0' into var.&lt;/P&gt;&lt;P&gt;endwhile.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or get the length and write one field over the other.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;lf_len type i,&lt;/P&gt;&lt;P&gt;var_temp like var.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lf_len = strlen( var ).&lt;/P&gt;&lt;P&gt;var_temp = '0000000000'.&lt;/P&gt;&lt;P&gt;var_temp+0(lf_len) = var.&lt;/P&gt;&lt;P&gt;var = var_temp.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 12:24:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254443#M1631480</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-05T12:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: Padding character fields with zeros</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254444#M1631481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try Concatenate..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA var1(10) type c.
var1 = 'Thank You'.
CONCATENATE var1 '0000' into var1.
WRITE: var1.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 12:25:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254444#M1631481</guid>
      <dc:creator>surajarafath</dc:creator>
      <dc:date>2011-10-05T12:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: Padding character fields with zeros</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254445#M1631482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for all the replies. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STRLEN will give me the lenght of the field but i need the offset of the last chararcter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your post gave me an idea though. I'm doing the following and it's working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;value = 'Thank You          '.&lt;/P&gt;&lt;P&gt;tmp    = '00000000000000'.&lt;/P&gt;&lt;P&gt;FIND REGEX `\w[ [:space:] ][ [:space:] ]` IN value MATCH OFFSET moff.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;   OVERLAY value+moff WITH tmp. &lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The find looks for the last alphanumeric char and 2 spaces after it meaning the last alphanumeric char in the string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to all, i will reward as fairly as possible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 13:18:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254445#M1631482</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-05T13:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: Padding character fields with zeros</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254446#M1631483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; The find looks for the last alphanumeric char and 2 spaces after it meaning the last alphanumeric char in the string.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What happens if there is only 1 space at the end?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 13:21:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254446#M1631483</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-05T13:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: Padding character fields with zeros</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254447#M1631484</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;Try below code it may help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: VAR TYPE C LENGTH 10 ,&lt;/P&gt;&lt;P&gt;      v_len type i ,&lt;/P&gt;&lt;P&gt;      v_len1 type i.&lt;/P&gt;&lt;P&gt;VAR = 'TE XT'.&lt;/P&gt;&lt;P&gt;v_len = strlen( var ) .&lt;/P&gt;&lt;P&gt; v_len1 = 10 - v_len .&lt;/P&gt;&lt;P&gt; do v_len1 TIMES.&lt;/P&gt;&lt;P&gt;   CONCATENATE var '0' INTO var .&lt;/P&gt;&lt;P&gt; enddo.&lt;/P&gt;&lt;P&gt;WRITE : var.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Chetan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 13:24:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254447#M1631484</guid>
      <dc:creator>former_member192432</dc:creator>
      <dc:date>2011-10-05T13:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: Padding character fields with zeros</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254448#M1631485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;      Here is the solution&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data ch(10).&lt;/P&gt;&lt;P&gt;data len type i.&lt;/P&gt;&lt;P&gt;data diff type i.&lt;/P&gt;&lt;P&gt;ch = 'text'.&lt;/P&gt;&lt;P&gt;len = strlen( ch ).&lt;/P&gt;&lt;P&gt;diff = 10 - len.&lt;/P&gt;&lt;P&gt;do diff times.&lt;/P&gt;&lt;P&gt;  concatenate ch '0' into ch.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;write:/ ch.         output :  &lt;STRONG&gt;text000000&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 13:36:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254448#M1631485</guid>
      <dc:creator>former_member712377</dc:creator>
      <dc:date>2011-10-05T13:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Padding character fields with zeros</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254449#M1631486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Very true, i have not considered it it and it is indeed very possible for it to happen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure yet what regex would apply to only the end of field and not take the middle spaces in between... If you know how then please let me know.&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;Edited by: MonkD on Oct 5, 2011 4:00 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 14:00:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254449#M1631486</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-05T14:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Padding character fields with zeros</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254450#M1631487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had to add another FIND statement to take into account the scenario that was pointed out by Maen "Thank for that!!!".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;value = 'Thank You '.&lt;/P&gt;&lt;P&gt;tmp = '00000000000000'.&lt;/P&gt;&lt;P&gt;FIND REGEX `\w[ :space:] [ :space:]` IN value MATCH OFFSET moff.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;   OVERLAY value+moff WITH tmp. &lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;   FIND REGEX `\w[ :space:]\Z` IN value MATCH OFFSET moff.&lt;/P&gt;&lt;P&gt;   IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;       OVERLAY value+moff WITH tmp.&lt;/P&gt;&lt;P&gt;   ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second find will catch the scenario where there is one blank space before the end of the string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: MonkD on Oct 5, 2011 4:37 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 14:37:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254450#M1631487</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-05T14:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Padding character fields with zeros</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254451#M1631488</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;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STRLEN will give me the lenght of the field but i need the offset of the last chararcter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually the length of the field value &lt;EM&gt;is&lt;/EM&gt; the offset of last character &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just try the overlay as i proposed and check by yourself...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kr,&lt;/P&gt;&lt;P&gt;m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 14:41:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254451#M1631488</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-05T14:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: Padding character fields with zeros</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254452#M1631489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Indeed it is and i did test but i had the same number of chars in the field as the size of the var itself and that just trew me off....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i can accomplish my goal with the following as well. It takes less lines this way too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var = 'hello             '.&lt;/P&gt;&lt;P&gt;tmp = '0000000000'.&lt;/P&gt;&lt;P&gt;len = STRLEN ( var ).&lt;/P&gt;&lt;P&gt;describe FIELD var LENGTH olen IN CHARACTER MODE.&lt;/P&gt;&lt;P&gt;if len &amp;lt;&amp;gt; olen.&lt;/P&gt;&lt;P&gt;   OVERLAY var+len WITH tmp.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 15:08:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/padding-character-fields-with-zeros/m-p/8254452#M1631489</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-05T15:08:09Z</dc:date>
    </item>
  </channel>
</rss>

