<?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 about type definitions in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-type-definitions/m-p/825301#M43074</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Two ways.  Assume table dbtab has a field called f1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPES:
  BEGIN OF MYTYPE,
    dbtab          TYPE dbtab,
    myf1,
    myf2,
  END OF MYTYPE.

DATA:
  myvar TYPE MYTYPE.
...

WRITE: myvar-dbtab-f1, myvar-myf1.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPES:
  BEGIN OF MYTYPE.
    INCLUDE STRUCTURE dbtab.
TYPES:
    myf1,
    myf2,
  END OF MYTYPE.

DATA:
  myvar TYPE MYTYPE.
...

WRITE: myvar-f1, myvar-f2.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Personally I dislike the syntax of the second since it requires a break in the chaining (that is a second TYPES statement).  It is possible that nowadays INCLUDE STRUCTURE xxx should be INCLUDE TYPE xxx - haven't tried for a while but you should get the idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is also clearer (IMO) with the first approach what the data represents, plus you don't have to worry about field-names conflicting - that is, it wouldn't matter if dbtab also had a field called myf1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Apr 2004 07:42:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2004-04-29T07:42:49Z</dc:date>
    <item>
      <title>Question about type definitions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-type-definitions/m-p/825300#M43073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a syntax question about the command TYPES&lt;/P&gt;&lt;P&gt;I want to define a Type that consists of the complete structure of a database table + two other fields.&lt;/P&gt;&lt;P&gt;What syntax do i have to use for this&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Apr 2004 07:29:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-type-definitions/m-p/825300#M43073</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-04-29T07:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Question about type definitions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-type-definitions/m-p/825301#M43074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Two ways.  Assume table dbtab has a field called f1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPES:
  BEGIN OF MYTYPE,
    dbtab          TYPE dbtab,
    myf1,
    myf2,
  END OF MYTYPE.

DATA:
  myvar TYPE MYTYPE.
...

WRITE: myvar-dbtab-f1, myvar-myf1.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPES:
  BEGIN OF MYTYPE.
    INCLUDE STRUCTURE dbtab.
TYPES:
    myf1,
    myf2,
  END OF MYTYPE.

DATA:
  myvar TYPE MYTYPE.
...

WRITE: myvar-f1, myvar-f2.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Personally I dislike the syntax of the second since it requires a break in the chaining (that is a second TYPES statement).  It is possible that nowadays INCLUDE STRUCTURE xxx should be INCLUDE TYPE xxx - haven't tried for a while but you should get the idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is also clearer (IMO) with the first approach what the data represents, plus you don't have to worry about field-names conflicting - that is, it wouldn't matter if dbtab also had a field called myf1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Apr 2004 07:42:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-type-definitions/m-p/825301#M43074</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-04-29T07:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Question about type definitions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-type-definitions/m-p/825302#M43075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use INCLUDE STRUCTURE and then individually place the other two fields between BEGIN and END in the TYPE definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF....&lt;/P&gt;&lt;P&gt;INCLUDE STRUCTURE DBNAME.&lt;/P&gt;&lt;P&gt;TYPES: f1 type ..&lt;/P&gt;&lt;P&gt;       f2 type ..&lt;/P&gt;&lt;P&gt;       END OF ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Apr 2004 07:42:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-type-definitions/m-p/825302#M43075</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-04-29T07:42:53Z</dc:date>
    </item>
  </channel>
</rss>

