<?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: Simple Code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692395#M304062</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The code craetes an internal table with one component named LINE. The component LINE is character type with length 255. This internal table can be used is a program to carry a text in 255 character format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The syntax 'include structure' creates components in internal table. In this case the structure BAPITGB has only one componet called LINE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Nov 2006 03:34:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-24T03:34:47Z</dc:date>
    <item>
      <title>Simple Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692392#M304059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the meaning/use of this code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA BEGIN OF MY_TEXT OCCURS 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INCLUDE STRUCTURE BAPITGB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA END OF MY_TEXT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nmc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Nov 2006 03:26:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692392#M304059</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-24T03:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692393#M304060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This creates an internal table with name MY_TEXT and this internal table has  the structure of BAPITGB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anish Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Nov 2006 03:28:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692393#M304060</guid>
      <dc:creator>former_member150733</dc:creator>
      <dc:date>2006-11-24T03:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692394#M304061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The idea behind this is to reuse the structure created the dictionary while creating the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This could be as simple as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : MY_TEXT TYPE TABLE OF BAPITGB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;Note - Please mark all the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Nov 2006 03:30:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692394#M304061</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-24T03:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692395#M304062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The code craetes an internal table with one component named LINE. The component LINE is character type with length 255. This internal table can be used is a program to carry a text in 255 character format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The syntax 'include structure' creates components in internal table. In this case the structure BAPITGB has only one componet called LINE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Nov 2006 03:34:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692395#M304062</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-24T03:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692396#M304063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the meaning of the occurs 1 in the code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nmc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Nov 2006 03:49:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692396#M304063</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-24T03:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692397#M304064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marc,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   The main purpose of this is you can add more fields in addtion to included structure to your internal table.For example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your internal table "itab"  you want to add all fields structure "A"  &amp;amp; some of the fields from Structure B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Suppose if structure A is having 100 fields and from B  you are adding 3 fields.&lt;/P&gt;&lt;P&gt;In practical you can not declare all 100 fields from A and 3 fields form B in your internal table.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;For that reason Include structure is useful.See the below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA BEGIN OF MY_TEXT OCCURS 1.&lt;/P&gt;&lt;P&gt;     INCLUDE STRUCTURE BAPITGB.&lt;/P&gt;&lt;P&gt;     XYZ   like  mara-matnr,&lt;/P&gt;&lt;P&gt;     klm   like  viqmma-qmnum,&lt;/P&gt;&lt;P&gt;     ghi    like  kna1-kunnr,  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA END OF MY_TEXT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls. reward points if it is helpful......&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Nov 2006 03:49:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692397#M304064</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-24T03:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692398#M304065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OCCURS clause is telling the system the expected number of rows in the internal table.&lt;/P&gt;&lt;P&gt;however, with the latest versions this syntax is not necessary any more and will become obsolete eventually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Nov 2006 03:51:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692398#M304065</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-24T03:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692399#M304066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't seem to know what's wrong with the code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax error:&lt;/P&gt;&lt;P&gt;"MY_RETURN" cannot be converted to a character-type field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT z_test_nmc5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      DATA/VARIABLE DECLARATION                                      *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: my_id         LIKE bapiret2-id,         " Messages, Message Class&lt;/P&gt;&lt;P&gt;      my_number     LIKE bapiret2-number,     " Messages, Message Number&lt;/P&gt;&lt;P&gt;      my_textformat LIKE bapitga-textformat,  " Format of documentation texts when read by BAPIs&lt;/P&gt;&lt;P&gt;      my_message_v1 LIKE bapiret2-message_v1, " Message Variables&lt;/P&gt;&lt;P&gt;      my_message    LIKE bapiret2-message,    " Message Text&lt;/P&gt;&lt;P&gt;      my_return     TYPE bapiret2.            " Return Parameter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA BEGIN OF my_text OCCURS 1.&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE bapitgb.&lt;/P&gt;&lt;P&gt;DATA END OF my_text.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      CONSTANTS DECLARATION                                          *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONSTANTS: c_f1(2)   TYPE c VALUE 'F1',&lt;/P&gt;&lt;P&gt;           c_024     TYPE i VALUE '024',&lt;/P&gt;&lt;P&gt;           c_asc(3)  TYPE c VALUE 'ASC',&lt;/P&gt;&lt;P&gt;           c_0001(4) TYPE c VALUE '0001'.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      START-OF-SELECTION                                             *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Enter values in object&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  my_id         = c_f1.&lt;/P&gt;&lt;P&gt;  my_number     = c_024.&lt;/P&gt;&lt;P&gt;  my_textformat = c_asc.&lt;/P&gt;&lt;P&gt;  my_message_v1 = c_0001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;BAPI Call&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'BAPI_MESSAGE_GETDETAIL'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      id         = my_id&lt;/P&gt;&lt;P&gt;      number     = my_number&lt;/P&gt;&lt;P&gt;      textformat = my_textformat&lt;/P&gt;&lt;P&gt;      message_v1 = my_message_v1&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      message    = my_message&lt;/P&gt;&lt;P&gt;      return     = my_return&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      text       = my_text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Print Results&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  WRITE:/ 'Input' COLOR 5.&lt;/P&gt;&lt;P&gt;  WRITE:/ 'my_id:', my_id.&lt;/P&gt;&lt;P&gt;  WRITE:/ 'my_number:', my_number.&lt;/P&gt;&lt;P&gt;  WRITE:/ 'my_textformat:', my_textformat.&lt;/P&gt;&lt;P&gt;  WRITE:/ 'Output' COLOR 5.&lt;/P&gt;&lt;P&gt;  WRITE:/ 'my_message:', my_message.&lt;/P&gt;&lt;P&gt;  WRITE:/ 'my_return:', my_return. &amp;lt;----&lt;/P&gt;&lt;HR originaltext="---------------------" /&gt;&lt;P&gt; Syntax Error&lt;/P&gt;&lt;P&gt;  WRITE:/ 'Text output' COLOR 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT my_text.&lt;/P&gt;&lt;P&gt;    WRITE:/ my_text.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nmc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Nov 2006 06:04:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692399#M304066</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-24T06:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692400#M304067</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;&amp;lt;b&amp;gt;* This is a way to Build internal table and work area from existing internal table,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;adding additional fields&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;chk this code.&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF t_repdata.
        INCLUDE STRUCTURE tab_ekpo.  "could include EKKO table itself!!
TYPES: bukrs  TYPE ekpo-werks,
       bstyp  TYPE ekpo-bukrs.
TYPES: END OF t_repdata.

DATA: it_repdata TYPE STANDARD TABLE OF t_repdata INITIAL SIZE 0,   "itab
      wa_repdata TYPE t_repdata.                 "work area (header line)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds&lt;/P&gt;&lt;P&gt;Anver&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Nov 2006 06:07:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692400#M304067</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2006-11-24T06:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692401#M304068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem has not been solved. Need help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nmc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Nov 2006 07:54:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692401#M304068</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-24T07:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692402#M304069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hullo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm guessing you're using a UNICODE version of SAP (4.7 or higher).. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your problem is that you're getting a syntax errror when trying to write my_return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your problem is that my_return is not a single variable but a structured variable (or workarea). IIRC as soon as there are non-c type fields in a structure you can't write the whole structure as one big variable (hence the error: "cannot be converted to a character-type field").&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: ...
      ...
      my_return TYPE bapiret2. " Return Parameter&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should declare the my_return vatiable according to the field of bapiret2 you want to use instead of the whole structure. Just like you have done with all the other 'my_...'  variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or, if you meant to use the whole structure, you'll have to write each field separately, insted of the whole structure in one go.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Nov 2006 08:32:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-code/m-p/1692402#M304069</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-24T08:32:33Z</dc:date>
    </item>
  </channel>
</rss>

