<?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: structure declaration in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/structure-declaration/m-p/1410193#M197653</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It will create a structe with the needed fields..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF i_sub &amp;lt;b&amp;gt;occurs 0&amp;lt;/b&amp;gt; ,&lt;/P&gt;&lt;P&gt;mandt TYPE afvgd-mandt,&lt;/P&gt;&lt;P&gt;aufpl TYPE afvgd-aufpl,&lt;/P&gt;&lt;P&gt;END OF i_sub.&lt;/P&gt;&lt;P&gt;Add occurs 0. Now your Internal table is ready.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Jun 2006 07:06:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-27T07:06:12Z</dc:date>
    <item>
      <title>structure declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/structure-declaration/m-p/1410190#M197650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi this is pradeep, and expecting help from u.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the below declared is structure to output data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of st_report,&lt;/P&gt;&lt;P&gt;  plant like zpgm_parts-werks,&lt;/P&gt;&lt;P&gt;  pgmat like zpgm_parts-pgm_matnr, " pgm material&lt;/P&gt;&lt;P&gt;  finmat like zpgm_parts-fin_matnr,"finished  material&lt;/P&gt;&lt;P&gt;  mvt543 like mseg-bwart,          "543/544 movement type&lt;/P&gt;&lt;P&gt;  name1 like lfa1-name1,           " vendor&lt;/P&gt;&lt;P&gt;  ebeln like mseg-ebeln,           "po#&lt;/P&gt;&lt;P&gt;  ebelp like mseg-ebelp,           "po item #&lt;/P&gt;&lt;P&gt;  mbl543 like mseg-mblnr,          "mat doc# of 543/544&lt;/P&gt;&lt;P&gt;  dat543 like mkpf-budat,          " date of 543/544&lt;/P&gt;&lt;P&gt;  mvt101 like mseg-bwart,          "101/102 movement type&lt;/P&gt;&lt;P&gt;  mbl101 like mseg-mblnr,          "mat doc# of 101/102&lt;/P&gt;&lt;P&gt;  dat101 like mkpf-budat,          "date of 101/102&lt;/P&gt;&lt;P&gt;  mvt541 like mseg-bwart,          "541/542 movement type&lt;/P&gt;&lt;P&gt;  mbl541 like mseg-mblnr,          "mat doc# of 541/542&lt;/P&gt;&lt;P&gt;  dat541 like mkpf-budat,          "date of 541/542&lt;/P&gt;&lt;P&gt;  xabln like mkpf-xabln,&lt;/P&gt;&lt;P&gt;  zeile like mseg-zeile,&lt;/P&gt;&lt;P&gt;  end of st_report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in what way it is different from declaring int table.and when structure declaration can be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one more question&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;these r the constants in my report and r being refered to the field mseg-bwart, why it was done so&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;constants: c_101 like mseg-bwart value '101',&lt;/P&gt;&lt;P&gt;           c_102 like mseg-bwart value '102',&lt;/P&gt;&lt;P&gt;           c_544 like mseg-bwart value '544',&lt;/P&gt;&lt;P&gt;           c_543 like mseg-bwart value '543',&lt;/P&gt;&lt;P&gt;           c_541 like mseg-bwart value '541',&lt;/P&gt;&lt;P&gt;           c_542 like mseg-bwart value '542',&lt;/P&gt;&lt;P&gt;           c_122 like mseg-bwart value '122'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanku&lt;/P&gt;&lt;P&gt;pradeep.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jun 2006 06:53:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/structure-declaration/m-p/1410190#M197650</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-27T06:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: structure declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/structure-declaration/m-p/1410191#M197651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi pradeep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. in what way it is different from declaring int table.and when structure declaration can be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only difference is OCCURS 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. It would be an internal table if the&lt;/P&gt;&lt;P&gt;   declaration was like this.&lt;/P&gt;&lt;P&gt;data : begin of st_report &amp;lt;b&amp;gt;OCCURS 0,&amp;lt;/b&amp;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;3. &lt;/P&gt;&lt;P&gt;these r the constants in my report and r being refered to the field mseg-bwart, why it was done so&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BWART = Movement Type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. This field can take various values,&lt;/P&gt;&lt;P&gt;   depending upon the business transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. In your report, there might be &lt;/P&gt;&lt;P&gt;   many movement types (BWART)&lt;/P&gt;&lt;P&gt;   required in SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6. So instead of hardcoding in SQL itself,&lt;/P&gt;&lt;P&gt;   we can hardcode in the CONSTANT declaration,&lt;/P&gt;&lt;P&gt;  and use this constant in other parts of the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7. In this way, if the value of BWART needs to be changed,&lt;/P&gt;&lt;P&gt;  we need to change only the declaration of the CONSTANT,&lt;/P&gt;&lt;P&gt;  (and not other parts of the abap code, where it might be used)&lt;/P&gt;&lt;P&gt;&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;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jun 2006 06:57:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/structure-declaration/m-p/1410191#M197651</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-27T06:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: structure declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/structure-declaration/m-p/1410192#M197652</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;If you have to declare a table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of st_report OCCURS N,&lt;/P&gt;&lt;P&gt;plant like zpgm_parts-werks,&lt;/P&gt;&lt;P&gt;pgmat like zpgm_parts-pgm_matnr, " pgm material&lt;/P&gt;&lt;P&gt;finmat like zpgm_parts-fin_matnr,"finished material&lt;/P&gt;&lt;P&gt;mvt543 like mseg-bwart, "543/544 movement type&lt;/P&gt;&lt;P&gt;name1 like lfa1-name1, " vendor&lt;/P&gt;&lt;P&gt;ebeln like mseg-ebeln, "po#&lt;/P&gt;&lt;P&gt;ebelp like mseg-ebelp, "po item #&lt;/P&gt;&lt;P&gt;mbl543 like mseg-mblnr, "mat doc# of 543/544&lt;/P&gt;&lt;P&gt;dat543 like mkpf-budat, " date of 543/544&lt;/P&gt;&lt;P&gt;mvt101 like mseg-bwart, "101/102 movement type&lt;/P&gt;&lt;P&gt;mbl101 like mseg-mblnr, "mat doc# of 101/102&lt;/P&gt;&lt;P&gt;dat101 like mkpf-budat, "date of 101/102&lt;/P&gt;&lt;P&gt;mvt541 like mseg-bwart, "541/542 movement type&lt;/P&gt;&lt;P&gt;mbl541 like mseg-mblnr, "mat doc# of 541/542&lt;/P&gt;&lt;P&gt;dat541 like mkpf-budat, "date of 541/542&lt;/P&gt;&lt;P&gt;xabln like mkpf-xabln,&lt;/P&gt;&lt;P&gt;zeile like mseg-zeile,&lt;/P&gt;&lt;P&gt;end of st_report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the declarations are similar excpet for option OCCUR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OCCUR N initializes the space of memory to can contain almost N records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Infact you should remember the structure is flat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It uses a structure when it needs a structureted variable, for example if it needs read a table without header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's the right way to declare a constant, because in this way the variable can't be changed at runtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jun 2006 07:04:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/structure-declaration/m-p/1410192#M197652</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-27T07:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: structure declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/structure-declaration/m-p/1410193#M197653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It will create a structe with the needed fields..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF i_sub &amp;lt;b&amp;gt;occurs 0&amp;lt;/b&amp;gt; ,&lt;/P&gt;&lt;P&gt;mandt TYPE afvgd-mandt,&lt;/P&gt;&lt;P&gt;aufpl TYPE afvgd-aufpl,&lt;/P&gt;&lt;P&gt;END OF i_sub.&lt;/P&gt;&lt;P&gt;Add occurs 0. Now your Internal table is ready.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jun 2006 07:06:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/structure-declaration/m-p/1410193#M197653</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-27T07:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: structure declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/structure-declaration/m-p/1410194#M197654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pradeep,&lt;/P&gt;&lt;P&gt;   A structure declaration will always be with types, like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Types: begin of ty_tab,&lt;/P&gt;&lt;P&gt;       vbeln like vbak-vbeln,&lt;/P&gt;&lt;P&gt;       vgbel like vbak-vgbel,&lt;/P&gt;&lt;P&gt;       ebeln like ekko-ebeln,&lt;/P&gt;&lt;P&gt;       end of ty_tab.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to create an internal table with respect to this structure then you declare like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Data: i_tab type standard table of ty_tab.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This declaration will create an internal table without an header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Constants:&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;   When you assign a value of type constant, this particular value cannot be changed in the program. Its like a fixed value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Constants: c_a value 'A'.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The value of c_a will be 'A' throughout the program. In the program they are checking the value to be equal to the constant they have declared. They are checking if the value is same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this soves ur issue. Reward if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tushar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Tushar  Marshall Dass&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jun 2006 07:07:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/structure-declaration/m-p/1410194#M197654</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-27T07:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: structure declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/structure-declaration/m-p/1410195#M197655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pradheep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;in what way it is different from declaring int table.and when structure declaration can be used.&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you include &amp;lt;b&amp;gt; OCCURS 0 &amp;lt;/b&amp;gt; then structure will become itab.Structure is used for many of the itabs.&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 : Begin of address,&lt;/P&gt;&lt;P&gt;       name type string,&lt;/P&gt;&lt;P&gt;       loc type string,&lt;/P&gt;&lt;P&gt;       END of Address.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;DATA : Staff_address TYPE Address occurs 0.&lt;/P&gt;&lt;P&gt;DATA : Student_address TYPE Address occurs 0.&lt;/P&gt;&lt;P&gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;  the constants in my report and r being refered to the field mseg-bwart, why it was done so&lt;/P&gt;&lt;P&gt;&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unlike variables Constant can't be changed while execution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Jothi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pl close the thread if your problem is solved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jun 2006 07:12:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/structure-declaration/m-p/1410195#M197655</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-27T07:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: structure declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/structure-declaration/m-p/1410196#M197656</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 addition OCCURS 0 will change the structure as internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is now the declaration you gave will act as a structure, that is it is similar to a line. But not a table. But if you want this to act as a table. Declare as I said above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of sp_report occurs 0,&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;    end of sp_report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you want to declare an internal table, always do it like this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of ty_rep&lt;/P&gt;&lt;P&gt;       ...&lt;/P&gt;&lt;P&gt;       ...&lt;/P&gt;&lt;P&gt;       end of ty_rep.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: &amp;lt;struct&amp;gt; type ty_rep, "structure&lt;/P&gt;&lt;P&gt;      &amp;lt;internal_table&amp;gt; like standard table of &amp;lt;struct&amp;gt;. &lt;/P&gt;&lt;P&gt;                                       "internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regs,&lt;/P&gt;&lt;P&gt;Venkat Ramanan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jun 2006 11:03:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/structure-declaration/m-p/1410196#M197656</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-27T11:03:56Z</dc:date>
    </item>
  </channel>
</rss>

