<?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: Question reqarding filling variable with spaces in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827239#M1129534</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;Check this code. If i understood your query.Its leaving spaces for Char type also in my program. Hope you understand. Revert back to me if there is any concern..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: field1 TYPE c VALUE 'a'.&lt;/P&gt;&lt;P&gt;DATA: field2(6) TYPE c VALUE '           '.&lt;/P&gt;&lt;P&gt;DATA: field3 TYPE c VALUE 'b'.&lt;/P&gt;&lt;P&gt;write: field1, field2, field3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Nitesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Dec 2008 09:35:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-12-05T09:35:03Z</dc:date>
    <item>
      <title>Question reqarding filling variable with spaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827238#M1129533</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;when I try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: field(6) TYPE c VALUE '______'. ( ______ - six spaces )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field = '______'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field = `______`.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the variable field is empty (has no spaces inside).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: field2 TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field2 = `______`.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the variable has spaces inside.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can somebody explain me how to assign spaces to a variable of type c?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ladislav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2008 09:27:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827238#M1129533</guid>
      <dc:creator>former_member188498</dc:creator>
      <dc:date>2008-12-05T09:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Question reqarding filling variable with spaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827239#M1129534</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;Check this code. If i understood your query.Its leaving spaces for Char type also in my program. Hope you understand. Revert back to me if there is any concern..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: field1 TYPE c VALUE 'a'.&lt;/P&gt;&lt;P&gt;DATA: field2(6) TYPE c VALUE '           '.&lt;/P&gt;&lt;P&gt;DATA: field3 TYPE c VALUE 'b'.&lt;/P&gt;&lt;P&gt;write: field1, field2, field3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Nitesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2008 09:35:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827239#M1129534</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-05T09:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: Question reqarding filling variable with spaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827240#M1129535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;give directly default valuses.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2008 09:38:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827240#M1129535</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-05T09:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Question reqarding filling variable with spaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827241#M1129536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How do you know &lt;EM&gt;'field(6) TYPE c'&lt;/EM&gt; doesn;t have spaces in it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2008 09:40:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827241#M1129536</guid>
      <dc:creator>Pawan_Kesari</dc:creator>
      <dc:date>2008-12-05T09:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: Question reqarding filling variable with spaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827242#M1129537</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;check this thread&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="6645694"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it may helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks n regards&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2008 09:45:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827242#M1129537</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-05T09:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Question reqarding filling variable with spaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827243#M1129538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the same question&lt;/P&gt;&lt;P&gt;As both&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: field1 TYPE c VALUE 'a'.
DATA: field2(6) TYPE c VALUE ' '.
DATA: field3 TYPE c VALUE 'b'.
write: field1,field2,field3.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: field1 TYPE c VALUE 'a'.
DATA: field2(6) TYPE c.
DATA: field3 TYPE c VALUE 'b'.
write: field1,field2,field3.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;have same output you dont have to give default value as ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: mrugesh phatak on Dec 5, 2008 10:47 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2008 09:45:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827243#M1129538</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-05T09:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Question reqarding filling variable with spaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827244#M1129539</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;If you declare data as below, it will definitly have spaces,1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: field(6) TYPE c VALUE '______'. ( ______ - six spaces )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to test the same try some thing like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: w_test type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate field 'This is a test' into w_test RESPECTING BLANKS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jayant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2008 09:46:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827244#M1129539</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-05T09:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: Question reqarding filling variable with spaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827245#M1129540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;DATA: field(6) TYPE c .&lt;/P&gt;&lt;P&gt;the value of the field will be space until you assign any value to it.&lt;/P&gt;&lt;P&gt;or try&lt;/P&gt;&lt;P&gt;DATA: field(6) TYPE c value space.&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2008 09:46:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827245#M1129540</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-05T09:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: Question reqarding filling variable with spaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827246#M1129541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hiii&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try using Respecting blanks statement like below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data:
material type mara-matnr value '  ',
batchno(6) type c value ' 1',
w_string(24) type c.

concatenate material batchno into w_string respecting blanks.

write : w_string.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;twinkal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2008 09:48:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827246#M1129541</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-05T09:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: Question reqarding filling variable with spaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827247#M1129542</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;thank you all. The responses were helpful, I wish I could give you all full points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found out that I was using after that a CONCATENATE statement but without RESPECTING BLANKS addition (we have ecc 5.0) and that was the cause. Time for a coffee &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ladislav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2008 10:11:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827247#M1129542</guid>
      <dc:creator>former_member188498</dc:creator>
      <dc:date>2008-12-05T10:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: Question reqarding filling variable with spaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827248#M1129543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Charactervariables have always a fixed length, so even when they are initial they contain spaces. If you store 5 Character in a c-Var length 10, it will contain 5 spaces at the end. So how should the compiler decide if these spaces at the end belongs to the content or are just there becase of the fixed length? He cant decide, so he always cuts off spaces at the end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Strings do have a variable length and it is stored with a length counter. Spaces at the end are always taken into account.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assume you habe this content: "XYZ##" (# and _ will indicate spaces. If you put that into a c(10) field you will have "XYZ##_____". Cause there is no length indicator you can not decide if the spaces belongs to the content or belongs to the fill up. A string variable will contain "XYZ##" and its clear that the spaces belongs to the content.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The disadvantage of strings is that they are incompatible with a lot of function modules and because they are deep structures they arent allowed in RFC function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Besides that i'm only using strings instead of c fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2008 10:28:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827248#M1129543</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2008-12-05T10:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Question reqarding filling variable with spaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827249#M1129544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this works only when you want to output to the file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BEGIN OF ls_abody, "25&lt;/P&gt;&lt;P&gt;      matnr TYPE mast-matnr,&lt;/P&gt;&lt;P&gt;      rtype      TYPE c,&lt;/P&gt;&lt;P&gt;      seque(3),&lt;/P&gt;&lt;P&gt;      bmein TYPE stko-bmein,&lt;/P&gt;&lt;P&gt;      dummy(92),&lt;/P&gt;&lt;P&gt;      pb(02) VALUE cl_abap_char_utilities=&amp;gt;cr_lf,&lt;/P&gt;&lt;P&gt;END OF ls_abody.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case say we want 94 spaces. so we make a field dummy of length 92 and then make a pagebreak variable of length two. In my interface I transfer internal tables of different structures and the requirement is that all lines are of equal length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Maksims  Jegorovcevs on Feb 10, 2009 11:37 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 10:35:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-reqarding-filling-variable-with-spaces/m-p/4827249#M1129544</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-10T10:35:50Z</dc:date>
    </item>
  </channel>
</rss>

