<?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: manipulate internal table.. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/manipulate-internal-table/m-p/1691636#M303811</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Reena , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : begin of itab occurs 0,
       PRCTR(18),
       val(6) ,
       end of itab .

DATA : JTAB LIKE ITAB OCCURS 0 WITH HEADER LINE.
 DATA: V_FLAG TYPE C.
       itab-PRCTR = 'AA'.
       ITAB-VAL   = '01'.
       APPEND ITAB.

       itab-prctr = 'AA'.
       ITAB-VAL   = '02'.
       APPEND ITAB.


       itab-PRCTR = 'AA'.
       ITAB-VAL   = '03'.
       APPEND ITAB.

       itab-prctr = 'AA'.
       ITAB-VAL   = '04'.
       APPEND ITAB.

       itab-PRCTR = 'AA'.
       ITAB-VAL   = '05'.
       APPEND ITAB.

       itab-prctr = 'AA'.
       ITAB-VAL   = '06'.
       APPEND ITAB.

       itab-PRCTR = 'BB'.
       ITAB-VAL   = '01'.
       APPEND ITAB.

       itab-prctr = 'BB'.
       ITAB-VAL   = '02'.
       APPEND ITAB.


       itab-PRCTR = 'BB'.
       ITAB-VAL   = '03'.
       APPEND ITAB.

       itab-PRCTR = 'CC'.
       ITAB-VAL   = '02'.
       APPEND ITAB.




      LOOP AT ITAB .

      AT NEW PRCTR.

      V_FLAG = 'X'.

      ENDAT.

      IF V_FLAG = 'X'.
      JTAB-PRCTR = ITAB-PRCTR.
      JTAB-VAL =   ITAB-VAL.
      APPEND JTAB.
      CLEAR  JTAB.
      ENDIF.

      AT END OF PRCTR.

       CLEAR V_FLAG.
       CLEAR JTAB.
       LOOP AT JTAB.
       WRITE:/ JTAB-PRCTR,JTAB-VAL.
       ENDLOOP.
       skip 2.

       WRITE:/ '--------------'.
       REFRESH JTAB.
      ENDAT.

     ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in here as per ur requirement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need to dynamically generate a internal table for the number of profit centers ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but if i Populate the JTAB / Profit center &lt;/P&gt;&lt;P&gt;u can check the line  '----&lt;/P&gt;&lt;HR originaltext="-------------" /&gt;&lt;P&gt;'   being printed at the end of occurance of each profit center .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps ,&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Nov 2006 09:27:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-15T09:27:25Z</dc:date>
    <item>
      <title>manipulate internal table..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/manipulate-internal-table/m-p/1691629#M303804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all..&lt;/P&gt;&lt;P&gt;I am having an internal table with 10 columns that is 10 fields. Now one of them is profit centre which is same for many records. Now i want to get all the records for individual profit centre. I know i can do it by using loop and the writing all records to a different internal table for each profit center. Can anyone else suggest me another method??&lt;/P&gt;&lt;P&gt;thanks in advance,&lt;/P&gt;&lt;P&gt;Reena&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Nov 2006 17:36:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/manipulate-internal-table/m-p/1691629#M303804</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-14T17:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: manipulate internal table..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/manipulate-internal-table/m-p/1691630#M303805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do you want to do with these records?  You just want to move them to another internal table, or you want to write them out?  You can do a LOOP with a WHERE clause to just loop at the records with the certain profit center.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Loop at itab where profc = 'TEST'.

endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Nov 2006 17:41:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/manipulate-internal-table/m-p/1691630#M303805</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-11-14T17:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: manipulate internal table..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/manipulate-internal-table/m-p/1691631#M303806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you could:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort my_table profit_center.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table my_table with key &lt;/P&gt;&lt;P&gt;prt_cnt = "100013"   "example&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;collect my_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Nov 2006 17:49:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/manipulate-internal-table/m-p/1691631#M303806</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-14T17:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: manipulate internal table..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/manipulate-internal-table/m-p/1691632#M303807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i will elaborate my question. for example I have an internal table itab. Now 6 records of them have prctr = AA, 3 of them have prctr = BB and 1 of them have prctr = CC.&lt;/P&gt;&lt;P&gt;Now i want all of these records for a particular PRCTR in a different internal table.  &lt;/P&gt;&lt;P&gt;i guess this will make things bit clear..&lt;/P&gt;&lt;P&gt;thanks for your support,&lt;/P&gt;&lt;P&gt;Reena&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 08:56:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/manipulate-internal-table/m-p/1691632#M303807</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-15T08:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: manipulate internal table..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/manipulate-internal-table/m-p/1691633#M303808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reena...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by prctr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_index = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at prctr.&lt;/P&gt;&lt;P&gt;    at new prctr.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    get new itab1&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      v_index = v_index + 1.&lt;/P&gt;&lt;P&gt;    endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   if v_index = 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;get values into itab1&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   elseif v_index = 2.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;get values into itab2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   elseif v_index = 3.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;get values into itab3&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    at end of prctr.&lt;/P&gt;&lt;P&gt;       if v_index = 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        append itab1&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       elseif v_index = 2.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        append itab2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       elseif v_index = 3.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        append  itab3&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;P&gt;    endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Anu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 09:04:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/manipulate-internal-table/m-p/1691633#M303808</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-15T09:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: manipulate internal table..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/manipulate-internal-table/m-p/1691634#M303809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello ,&lt;/P&gt;&lt;P&gt;try to use like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Perform read_profit_center using prft_cntr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Form read_profit_center using value(p_cntr).&lt;/P&gt;&lt;P&gt;    read table itab with key pfr_cntr = p_cntr.&lt;/P&gt;&lt;P&gt;      if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;       Move the data here&lt;/P&gt;&lt;P&gt;        delete itab index sy-tabix&lt;/P&gt;&lt;P&gt;*call the form again.&lt;/P&gt;&lt;P&gt;   Perform read_profit_center using p_cntr.&lt;/P&gt;&lt;P&gt;  Else.&lt;/P&gt;&lt;P&gt;   continue.&lt;/P&gt;&lt;P&gt;Endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Krishnakumar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Krishnakumar Ramadoss&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 09:09:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/manipulate-internal-table/m-p/1691634#M303809</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-15T09:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: manipulate internal table..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/manipulate-internal-table/m-p/1691635#M303810</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;Check this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;   if itab-prctr eq  'AA'.&lt;/P&gt;&lt;P&gt;      move the fields of itab to itab1.&lt;/P&gt;&lt;P&gt;   elseif itab-prctr eq 'BB'.&lt;/P&gt;&lt;P&gt;      move the fields of itab to itab2.&lt;/P&gt;&lt;P&gt;   elseif itab-prctr eq 'CC'&lt;/P&gt;&lt;P&gt;      move the fields of itab to itab3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 09:15:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/manipulate-internal-table/m-p/1691635#M303810</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-15T09:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: manipulate internal table..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/manipulate-internal-table/m-p/1691636#M303811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Reena , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : begin of itab occurs 0,
       PRCTR(18),
       val(6) ,
       end of itab .

DATA : JTAB LIKE ITAB OCCURS 0 WITH HEADER LINE.
 DATA: V_FLAG TYPE C.
       itab-PRCTR = 'AA'.
       ITAB-VAL   = '01'.
       APPEND ITAB.

       itab-prctr = 'AA'.
       ITAB-VAL   = '02'.
       APPEND ITAB.


       itab-PRCTR = 'AA'.
       ITAB-VAL   = '03'.
       APPEND ITAB.

       itab-prctr = 'AA'.
       ITAB-VAL   = '04'.
       APPEND ITAB.

       itab-PRCTR = 'AA'.
       ITAB-VAL   = '05'.
       APPEND ITAB.

       itab-prctr = 'AA'.
       ITAB-VAL   = '06'.
       APPEND ITAB.

       itab-PRCTR = 'BB'.
       ITAB-VAL   = '01'.
       APPEND ITAB.

       itab-prctr = 'BB'.
       ITAB-VAL   = '02'.
       APPEND ITAB.


       itab-PRCTR = 'BB'.
       ITAB-VAL   = '03'.
       APPEND ITAB.

       itab-PRCTR = 'CC'.
       ITAB-VAL   = '02'.
       APPEND ITAB.




      LOOP AT ITAB .

      AT NEW PRCTR.

      V_FLAG = 'X'.

      ENDAT.

      IF V_FLAG = 'X'.
      JTAB-PRCTR = ITAB-PRCTR.
      JTAB-VAL =   ITAB-VAL.
      APPEND JTAB.
      CLEAR  JTAB.
      ENDIF.

      AT END OF PRCTR.

       CLEAR V_FLAG.
       CLEAR JTAB.
       LOOP AT JTAB.
       WRITE:/ JTAB-PRCTR,JTAB-VAL.
       ENDLOOP.
       skip 2.

       WRITE:/ '--------------'.
       REFRESH JTAB.
      ENDAT.

     ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in here as per ur requirement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need to dynamically generate a internal table for the number of profit centers ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but if i Populate the JTAB / Profit center &lt;/P&gt;&lt;P&gt;u can check the line  '----&lt;/P&gt;&lt;HR originaltext="-------------" /&gt;&lt;P&gt;'   being printed at the end of occurance of each profit center .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps ,&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 09:27:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/manipulate-internal-table/m-p/1691636#M303811</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-15T09:27:25Z</dc:date>
    </item>
  </channel>
</rss>

