<?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: Regarding Internal table logic in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-internal-table-logic/m-p/1768817#M332157</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you paste the total code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Dec 2006 14:12:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-19T14:12:31Z</dc:date>
    <item>
      <title>Regarding Internal table logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-internal-table-logic/m-p/1768816#M332156</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;I have my internal table as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF I_DATA OCCURS 0,&lt;/P&gt;&lt;P&gt;        prgname TYPE SYST-REPID,&lt;/P&gt;&lt;P&gt;        matnr   TYPE mara-matnr,&lt;/P&gt;&lt;P&gt;        berid   TYPE mdma-berid,&lt;/P&gt;&lt;P&gt;      END OF I_DATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data that fills into can be as follows:&lt;/P&gt;&lt;P&gt;Ex: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROGRAM1,1000,MRP1&lt;/P&gt;&lt;P&gt;PROGRAM1,1000,MRP1&lt;/P&gt;&lt;P&gt;PROGRAM1,2000,MRP1&lt;/P&gt;&lt;P&gt;PROGRAM2,1000,MRP1&lt;/P&gt;&lt;P&gt;PROGRAM2,1000,MRP1&lt;/P&gt;&lt;P&gt;PROGRAM2,2000,MRP1&lt;/P&gt;&lt;P&gt;PROGRAM3,1000,MRP1&lt;/P&gt;&lt;P&gt;PROGRAM3,1000,MRP1&lt;/P&gt;&lt;P&gt;PROGRAM3,2000,MRP1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It can any order in above way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then i will sort the above data as follows:&lt;/P&gt;&lt;P&gt;SORT I_DATA BY prgname matnr berid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now here my issue is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: t_objtxt     LIKE solisti1   OCCURS 0  WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to push the above internal table data into T_OBJTXT internal table as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should first Display program Name as Program Name: Program3, Then column heading MATNR, BERID below it and data of that program[1st] below them till all the 1st program's data finished. Whenever MATNR value changes in this program list i need to print an ***** like line. TO indicate all the materials printed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When 2nd program comes again i have to write Program Name: Program2, Then column heading MATNR, BERID below it and data of that program[1st] below them till all the 1st program's data finished. Whenever MATNR value changes in this program list i need to print an ***** like line. TO indicate all the materials printed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When 3nd program comes again i have to write Program Name: Program3, Then column heading MATNR, BERID below it and data of that program[1st] below them till all the 1st program's data finished. Whenever MATNR value changes in this program list i need to print an ***** like line. TO indicate all the materials printed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Etc. Same process we need to follow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The final out put should be as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*****************************************&lt;/P&gt;&lt;P&gt;PROGRAM NAME : PROGRAM1&lt;/P&gt;&lt;P&gt;*****************************************&lt;/P&gt;&lt;P&gt;MATNR, BERID&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------" /&gt;&lt;P&gt;1000,MRP!&lt;/P&gt;&lt;P&gt;1000,MRP1&lt;/P&gt;&lt;P&gt;*****************************************&lt;/P&gt;&lt;P&gt;2000,MRP1&lt;/P&gt;&lt;P&gt;*****************************************&lt;/P&gt;&lt;P&gt;PROGRAM NAME : PROGRAM2&lt;/P&gt;&lt;P&gt;*****************************************&lt;/P&gt;&lt;P&gt;MATNR, BERID&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------" /&gt;&lt;P&gt;1000,MRP!&lt;/P&gt;&lt;P&gt;1000,MRP1&lt;/P&gt;&lt;P&gt;*****************************************&lt;/P&gt;&lt;P&gt;2000,MRP1&lt;/P&gt;&lt;P&gt;*****************************************&lt;/P&gt;&lt;P&gt;PROGRAM NAME : PROGRAM3&lt;/P&gt;&lt;P&gt;*****************************************&lt;/P&gt;&lt;P&gt;MATNR, BERID&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------" /&gt;&lt;P&gt;1000,MRP!&lt;/P&gt;&lt;P&gt;1000,MRP1&lt;/P&gt;&lt;P&gt;*****************************************&lt;/P&gt;&lt;P&gt;2000,MRP1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like wise o/p need to be send to I_OBJTXT and to email.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;The logic i have written is as follows:&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  LOOP AT I__DATA.

    AT NEW PRGNAME.

      MOVE '*****************************************' TO t_objtxt-line.
      APPEND t_objtxt.
      CLEAR t_objtxt.
      CONCATENATE t_objtxt-line 'PROGRAM NAME : '
                  I_DATA-PRGNAME
                  INTO t_objtxt-line.
      APPEND t_objtxt.
      CLEAR t_objtxt.
      MOVE '*****************************************' TO t_objtxt-line.
      APPEND t_objtxt.
      CLEAR t_objtxt.

      CONCATENATE TEXT-024 " Material
                  TEXT-025              " MRP
                  INTO t_objtxt-line
                  SEPARATED BY C_COMMA.
      APPEND t_objtxt.
      CLEAR t_objtxt.

      MOVE '-----------------------------------------' TO t_objtxt-line.
      CONCATENATE t_objtxt-line '------------------' INTO t_objtxt-line.
      APPEND t_objtxt.
      CLEAR t_objtxt.

    ENDAT.

*    MOVE '' TO t_objtxt-line.
*    APPEND t_objtxt.
*    CLEAR t_objtxt.

    CONCATENATE I_DATA-MATNR
                I_DATA-BERID
                INTO t_objtxt-line
                SEPARATED BY C_COMMA.
    APPEND t_objtxt.
    CLEAR t_objtxt.

    AT END OF MATNR.

      MOVE '' TO t_objtxt-line.
      APPEND t_objtxt.
      CLEAR t_objtxt.

      MOVE '*****************************************' TO t_objtxt-line.
      CONCATENATE t_objtxt-line '******************' INTO t_objtxt-line.
      CONCATENATE t_objtxt-line '******************' INTO t_objtxt-line.
      APPEND t_objtxt.
      CLEAR t_objtxt.

    ENDAT.

  ENDLOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above logic is not working correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody give me correct logic for the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Deep.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Dec 2006 14:00:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-internal-table-logic/m-p/1768816#M332156</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-19T14:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Internal table logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-internal-table-logic/m-p/1768817#M332157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you paste the total code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Dec 2006 14:12:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-internal-table-logic/m-p/1768817#M332157</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-19T14:12:31Z</dc:date>
    </item>
  </channel>
</rss>

