<?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: Giving spaces dynamically in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/giving-spaces-dynamically/m-p/7214893#M1523109</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 write the staement like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate field variable into variable1 respecting blanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajesh Akarte&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Aug 2010 09:42:25 GMT</pubDate>
    <dc:creator>rajesh_akarte2</dc:creator>
    <dc:date>2010-08-06T09:42:25Z</dc:date>
    <item>
      <title>Giving spaces dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/giving-spaces-dynamically/m-p/7214888#M1523104</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;The requirement is i have a field in internal table of length say 35. i have to concatenate the data in this field  along with other data into a variable of length 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field a(35) type c.&lt;/P&gt;&lt;P&gt;variable txt(100).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the field A contains 10 character value then remaining 25 i have to give spaces while concatenating.&lt;/P&gt;&lt;P&gt;if it contains 20 charachter value, then remaining 15 should be give spaces while concatenating.&lt;/P&gt;&lt;P&gt;so, there can be any combination of values and spaces. I have to handle it dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Aug 2010 08:45:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/giving-spaces-dynamically/m-p/7214888#M1523104</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-06T08:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Giving spaces dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/giving-spaces-dynamically/m-p/7214889#M1523105</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 this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: B(35) type C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A = 'ABC'.&lt;/P&gt;&lt;P&gt;WRITE: A to B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now use B.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Aug 2010 08:55:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/giving-spaces-dynamically/m-p/7214889#M1523105</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-06T08:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Giving spaces dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/giving-spaces-dynamically/m-p/7214890#M1523106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mohammadi siddiqui,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use this : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ztest1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA :&lt;/P&gt;&lt;P&gt;      lv_text1(10) VALUE 'abc',&lt;/P&gt;&lt;P&gt;      lv_text2(20).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WRITE lv_text1 TO lv_text2 RIGHT-JUSTIFIED. &amp;lt;-- right-justified fills the left part with spaces automatically&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also you can calculate length difference and use SHIFT command like this code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ztest1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA :&lt;/P&gt;&lt;P&gt;      lv_text1(10) VALUE 'abc',&lt;/P&gt;&lt;P&gt;      lv_text2(20).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA :&lt;/P&gt;&lt;P&gt;      lv_len1 TYPE i,&lt;/P&gt;&lt;P&gt;      lv_len2 TYPE i,&lt;/P&gt;&lt;P&gt;      lv_diff TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  " &lt;DEL&gt;1&lt;/DEL&gt; move text&lt;/P&gt;&lt;P&gt;  lv_text2 = lv_text1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  " &lt;DEL&gt;2&lt;/DEL&gt; Find difference of length : &lt;/P&gt;&lt;P&gt;  lv_len1 = STRLEN( lv_text1 ).  &lt;/P&gt;&lt;P&gt;  DESCRIBE FIELD lv_text2 LENGTH lv_len2 IN CHARACTER MODE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  lv_diff = lv_len2 - lv_len1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  " &lt;DEL&gt;3&lt;/DEL&gt; Shift value abc in text lv_text2&lt;/P&gt;&lt;P&gt;  SHIFT lv_text2 RIGHT BY lv_diff PLACES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Bulent Balci on Aug 6, 2010 11:15 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Aug 2010 09:14:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/giving-spaces-dynamically/m-p/7214890#M1523106</guid>
      <dc:creator>bbalci</dc:creator>
      <dc:date>2010-08-06T09:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: Giving spaces dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/giving-spaces-dynamically/m-p/7214891#M1523107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please try this one..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
types: begin of t_out,
            a(45) type c,
           end of t_out.
data: gt_out type table of t_out,
         wa_out type t_out,
         lv_var type i,
         lv_var1 type i.

wa_out-a = 'test1'.
append wa_out to gt_out.
clear: wa_out.

wa_out-a = 'test2'.
append wa_out to gt_out.
clear: wa_out.

loop at gt_out into wa_out.
lv_var = strlen( wa_out-a ).
if lv_var &amp;lt; 45.
   lv_var1 = 45 - lv_var.
   wa_out-a+lv_var(lv_var1) = ' '.
endif.
write:/ wa_out-a, 'TEST TO CHECK'.

clear: wa_out, lv_var, lv_var1.
endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;i have hard coded 45 has the length, but you can pass that using a variable.&lt;/P&gt;&lt;P&gt;thanks!&lt;/P&gt;&lt;P&gt;raghu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Raghavendra  nilekani on Aug 6, 2010 2:47 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Aug 2010 09:15:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/giving-spaces-dynamically/m-p/7214891#M1523107</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-06T09:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Giving spaces dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/giving-spaces-dynamically/m-p/7214892#M1523108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;    You can use offsets to achive this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : field(35)   TYPE c,
       v_field(10) TYPE c VALUE 'Hello',
       txt(100)    TYPE c.

field = 'ABCD'.
* As the length of field is 35, so what ever value be field having the added text(v_fied) will be after 35 characters only
txt+34(65) = v_field.

* If you still want to add any other data to txt use concatenate.

CONCATENATE txt c_value INTO txt.

WRITE :/ txt.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output&lt;/P&gt;&lt;P&gt;ABCD                               Hello c_value.&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;Bala Krishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Aug 2010 09:36:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/giving-spaces-dynamically/m-p/7214892#M1523108</guid>
      <dc:creator>former_member585060</dc:creator>
      <dc:date>2010-08-06T09:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: Giving spaces dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/giving-spaces-dynamically/m-p/7214893#M1523109</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 write the staement like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate field variable into variable1 respecting blanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajesh Akarte&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Aug 2010 09:42:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/giving-spaces-dynamically/m-p/7214893#M1523109</guid>
      <dc:creator>rajesh_akarte2</dc:creator>
      <dc:date>2010-08-06T09:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Giving spaces dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/giving-spaces-dynamically/m-p/7214894#M1523110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Aug 2010 05:53:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/giving-spaces-dynamically/m-p/7214894#M1523110</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-10T05:53:11Z</dc:date>
    </item>
  </channel>
</rss>

