<?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: How to initialize the structure fields with the same value in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-initialize-the-structure-fields-with-the-same-value/m-p/6849428#M1474192</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
field-symbols: &amp;lt;fs&amp;gt; type any.

do.
  assign component sy-index of structure S to &amp;lt;fs&amp;gt;.
  if sy-subrc NE 0.
    exit.
  endif.

  &amp;lt;fs&amp;gt; = '/'.
enddo.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 May 2010 19:23:20 GMT</pubDate>
    <dc:creator>karol_seman</dc:creator>
    <dc:date>2010-05-05T19:23:20Z</dc:date>
    <item>
      <title>How to initialize the structure fields with the same value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-initialize-the-structure-fields-with-the-same-value/m-p/6849426#M1474190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Expert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose the structure S has more than 50 fields.  I want to initial every field with the same value '/'.  If I initialize the fields one by one by the statement: S-field = '/',  I have to write more than 50 statements. It's time-consuming and the program is also urgly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I initial the structure fields with value '/' by one or two statements?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thnanks for help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards, Johnny.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 May 2010 19:13:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-initialize-the-structure-fields-with-the-same-value/m-p/6849426#M1474190</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-05T19:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize the structure fields with the same value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-initialize-the-structure-fields-with-the-same-value/m-p/6849427#M1474191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Yongbo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just use field symbols to achieve this. Try something as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: gs_makt TYPE makt.
FIELD-SYMBOLS: &amp;lt;gfs_field&amp;gt;.
CONSTANTS: gc_nodata TYPE c VALUE '/'.

CLEAR sy-subrc.
WHILE sy-subrc EQ 0.
  ASSIGN COMPONENT sy-index OF STRUCTURE gs_makt TO &amp;lt;gfs_field&amp;gt;.
  WRITE gc_nodata TO &amp;lt;gfs_field&amp;gt; LEFT-JUSTIFIED.
ENDWHILE.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 May 2010 19:21:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-initialize-the-structure-fields-with-the-same-value/m-p/6849427#M1474191</guid>
      <dc:creator>asik_shameem</dc:creator>
      <dc:date>2010-05-05T19:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize the structure fields with the same value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-initialize-the-structure-fields-with-the-same-value/m-p/6849428#M1474192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
field-symbols: &amp;lt;fs&amp;gt; type any.

do.
  assign component sy-index of structure S to &amp;lt;fs&amp;gt;.
  if sy-subrc NE 0.
    exit.
  endif.

  &amp;lt;fs&amp;gt; = '/'.
enddo.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 May 2010 19:23:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-initialize-the-structure-fields-with-the-same-value/m-p/6849428#M1474192</guid>
      <dc:creator>karol_seman</dc:creator>
      <dc:date>2010-05-05T19:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize the structure fields with the same value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-initialize-the-structure-fields-with-the-same-value/m-p/6849429#M1474193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
field-symbols&amp;lt;fs&amp;gt;.
clear sy-subrc.
  WHILE sy-subrc EQ 0.
    ASSIGN COMPONENT sy-index OF STRUCTURE ST1 TO &amp;lt;fs&amp;gt;.
    WRITE '/' TO &amp;lt;fs&amp;gt; LEFT-JUSTIFIED.
  ENDWHILE.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 May 2010 19:25:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-initialize-the-structure-fields-with-the-same-value/m-p/6849429#M1474193</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-05-05T19:25:33Z</dc:date>
    </item>
  </channel>
</rss>

