<?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: Itab manipulation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674306#M1448489</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used Marcin's code as a reference &amp;amp; modified it :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA ITAB1 TYPE TT_ITAB WITH HEADER LINE.

SORT ITAB BY MATNR LAND MONTH.

ITAB1[] = ITAB[].

DELETE ADJACENT DUPLICATES FROM ITAB1 COMPARING MATNR LAND.

LOOP AT GT_MONTHCALC.
  LOOP AT ITAB1.
    MOVE-CORRESPONDING ITAB1 TO ITAB_FILL.
    ITAB_FILL-MONTH = GT_MONTHCALC-MONTH.
    CLEAR ITAB_FILL-QUA.
    APPEND ITAB_FILL.
  ENDLOOP.
ENDLOOP.

SORT ITAB_FILL BY MATNR LAND MONTH.

LOOP AT ITAB_FILL.
  READ TABLE ITAB WITH KEY
  MATNR = ITAB_FILL-MATNR
  LAND  = ITAB_FILL-LAND
  MONTH = ITAB_FILL-MONTH BINARY SEARCH.
  IF SY-SUBRC EQ 0.
    ITAB_FILL-QUA = ITAB-QUA.
    MODIFY ITAB_FILL.
  ENDIF.
ENDLOOP.

LOOP AT ITAB_FILL.
  WRITE: / ITAB_FILL-MATNR, ITAB_FILL-LAND,
           ITAB_FILL-MONTH, ITAB_FILL-QUA.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output looks something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;100        A 01.10             5,00&lt;/P&gt;&lt;P&gt;100        A 02.10             4,00&lt;/P&gt;&lt;P&gt;100        A 03.10             5,00&lt;/P&gt;&lt;P&gt;100        A 10.09             0,00&lt;/P&gt;&lt;P&gt;100        A 11.09             0,00&lt;/P&gt;&lt;P&gt;100        A 12.09             0,00&lt;/P&gt;&lt;P&gt;100        B 01.10             0,00&lt;/P&gt;&lt;P&gt;100        B 02.10             0,00&lt;/P&gt;&lt;P&gt;100        B 03.10             0,00&lt;/P&gt;&lt;P&gt;100        B 10.09             0,00&lt;/P&gt;&lt;P&gt;100        B 11.09             0,00&lt;/P&gt;&lt;P&gt;100        B 12.09             5,00&lt;/P&gt;&lt;P&gt;100        C 01.10             0,00&lt;/P&gt;&lt;P&gt;100        C 02.10             0,00&lt;/P&gt;&lt;P&gt;100        C 03.10             0,00&lt;/P&gt;&lt;P&gt;100        C 10.09             0,00&lt;/P&gt;&lt;P&gt;100        C 11.09             4,00&lt;/P&gt;&lt;P&gt;100        C 12.09             0,00&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Mar 2010 16:18:16 GMT</pubDate>
    <dc:creator>SuhaSaha</dc:creator>
    <dc:date>2010-03-17T16:18:16Z</dc:date>
    <item>
      <title>Itab manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674299#M1448482</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;&lt;/P&gt;&lt;P&gt;I have an itab filled with the following values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This itab contains quantities of a particular material(100) sold to different lands in a period of time&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user enters a period from Oct2009 - Mar2010. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorted my itab1 by matr land month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;MatNr Land  month  quantity

100    A    01.10     5
100    A    02.10     4
100    A    03.10     5
100    A    09.10     5
100    B    12.09     5
100    C    11.09     4&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the user entered range of Oct2009 - Mar2010&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These months are calculated and  stored in a structure below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES : BEGIN OF gty_monthcalc,
          month TYPE  c length 30,
        END OF gty_monthcalc.

DATA gt_monthcalc TYPE TABLE OF gty_monthcalc.
DATA gs_monthcalc LIKE LINE OF gt_monthcalc.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;In my example the range was between 
03.11.2009 - 05.03.2010.

So the gt_monthcalc contains the following  months.

11.09
12.09
01.10
02.10
03.10&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So Now I have to go through the itab1 and write the quantities for each land in the order(Nov to march) into a string and use the "write" statement to write the string out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the problem Iam facing here is the months which are there in gt_monthcalc itab and which are not there in the itab1 for each land I have to add a new line to the itab and write it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;For example:-
100    A    11.10     0
100    A    12.10     0&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for other lands as well which doesnt contain the months in gt_monthcalc itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the optimal way to do it....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Mar 2010 14:00:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674299#M1448482</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-17T14:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: Itab manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674300#M1448483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this one&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

TYPES:BEGIN OF t_itab,
      matnr TYPE matnr,
      land  TYPE c,
      month(5) TYPE c,
      qua TYPE p DECIMALS 2,
     END OF t_itab.

TYPES: tt_itab TYPE TABLE OF t_itab WITH KEY matnr land month.

DATA: itab TYPE tt_itab WITH HEADER LINE.
DATA: itab_fill TYPE tt_itab WITH HEADER LINE.

itab-matnr = '100'.
itab-land = 'A'.
itab-month = '01.10'.
itab-qua = 5.
APPEND itab.

itab-matnr = '100'.
itab-land = 'A'.
itab-month = '02.10'.
itab-qua = 4.
APPEND itab.

itab-matnr = '100'.
itab-land = 'A'.
itab-month = '03.10'.
itab-qua = 5.
APPEND itab.

itab-matnr = '100'.
itab-land = 'A'.
itab-month = '09.10'.
itab-qua = 5.
APPEND itab.

itab-matnr = '100'.
itab-land = 'B'.
itab-month = '12.09'.
itab-qua = 5.
APPEND itab.

itab-matnr = '100'.
itab-land = 'C'.
itab-month = '11.09'.
itab-qua = 4.
APPEND itab.

DATA: BEGIN OF gt_monthcalc OCCURS 0,
          month TYPE  c LENGTH 30,
        END OF gt_monthcalc.


gt_monthcalc-month = '11.09'.
APPEND gt_monthcalc.
gt_monthcalc-month = '12.09'.
APPEND gt_monthcalc.
gt_monthcalc-month = '01.10'.
APPEND gt_monthcalc.
gt_monthcalc-month = '02.10'.
APPEND gt_monthcalc.
gt_monthcalc-month = '03.10'.
APPEND gt_monthcalc.


SORT itab BY matnr land month.

LOOP AT itab.
  AT END OF land.
    LOOP AT gt_monthcalc.
      READ TABLE itab WITH KEY matnr = itab-matnr
                               land  = itab-land
                               month = gt_monthcalc-month
                               TRANSPORTING NO FIELDS.
      IF sy-subrc &amp;lt;&amp;gt; 0.
        itab_fill-matnr = itab-matnr.
        itab_fill-land = itab-land.
        itab_fill-month = gt_monthcalc-month.
        itab_fill-qua = 0.
        APPEND itab_fill.
      ENDIF.
    ENDLOOP.
  ENDAT.
ENDLOOP.

APPEND LINES OF itab_fill TO itab.
SORT itab BY matnr land month.

LOOP AT itab.
  WRITE: / itab-matnr, itab-land, itab-month, itab-qua.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Mar 2010 14:47:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674300#M1448483</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-03-17T14:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Itab manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674301#M1448484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Roughly &amp;amp; ugly (of course don't use heade lines...):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA :itab2 TYPE table of ty_itab1,
 itab3 TYPE TABLE of ty_itab1.

SORT itab1 BY matnr land period.
itab2[] = itab1[].
DELETE ADJACENT DUPLICATES FROM itab2 COMPARING matnr land.
LOOP AT itab1.
  LOOP at gt_month.
    READ TABLE itab1 TRANSPORTING NO-FIELDS
       WITH KEY matnr = itab1-matnr
                       land = itab1-land
                         period = gt_month-period BINARY search.
    IF sy-subrc = 0.
     "hurray already in
      CONTINUE.
     ELSE.
      " no sales...
     itab3-land = itab1-land.
     itab3-matnr = itab1-matnr.
     itab3-period = gt_months-period.
     itab3-sales = 0.
     APPEND itab3.
  ENDIF.
 ENDLOOP.
ENDLOOP.
IF sy-subrc = 0.
APPEND LINES OF itab3 TO itab1.
FREE: itab2, itab3.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you have all (&amp;amp; still too much) data in itab1.&lt;/P&gt;&lt;P&gt;the rest shoul be clear...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: two great minds think alike &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Mar 2010 14:47:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674301#M1448484</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-17T14:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: Itab manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674302#M1448485</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;Easiest way is to collect all possible material and Land info in another itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then start to loop in that table.  ( Use this table as a key )  gt_mat_land&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at  gt_mat_land.&lt;/P&gt;&lt;P&gt;   loop at gt_monthcalc. &lt;/P&gt;&lt;P&gt;      clear my_itab1.&lt;/P&gt;&lt;P&gt;      read table my itab1 with key matnr = gt_mat_land-matnr&lt;/P&gt;&lt;P&gt;                                                    land = gt_mat_land-land&lt;/P&gt;&lt;P&gt;                                                    month = gt_monthcalc-month.&lt;/P&gt;&lt;P&gt;     if sy-subrc  = 0.&lt;/P&gt;&lt;P&gt;        move-corresponding my_itab1 to itab_final.&lt;/P&gt;&lt;P&gt;     else.&lt;/P&gt;&lt;P&gt;        move gt_mat_land-matnr to itab_final-matnr.&lt;/P&gt;&lt;P&gt;        move gt_mat_land-land to itab_final-land.&lt;/P&gt;&lt;P&gt;        move gt_monthcalc-month to itab_final-month.&lt;/P&gt;&lt;P&gt;     endif.     &lt;/P&gt;&lt;P&gt;       collect itab_final.&lt;/P&gt;&lt;P&gt;   endloop.&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;itab_final will have all the vlues with 0 amounts for all mats lands and months. Then you can write or use in ALV.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Mar 2010 15:11:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674302#M1448485</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-17T15:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: Itab manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674303#M1448486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Marcin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just ran the code.&lt;/P&gt;&lt;P&gt;The output is not right &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Land "A" already has these quantities filled in&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;100    A    01.10     5
100    A    02.10     4
100    A    03.10     5
100    A    09.10     5&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The quantity for month which are not there in gt_monthcalc itab for Land "A" is oct,nov and december.so there should be 3 for lines added to itab for land A&lt;/P&gt;&lt;P&gt;like along with the existing ones.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;100    A    10.09     0
100    A    11.09     0
100    A    12.09     0&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This must be true for other land as well. The months which are not there in the itab should be added with 0 quantity...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Mar 2010 15:21:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674303#M1448486</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-17T15:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: Itab manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674304#M1448487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Apparently there is missing one entry for OCT in gt_monthcalc.&lt;/P&gt;&lt;P&gt;Simply append this month &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
gt_monthcalc-month = '10.09'.
APPEND gt_monthcalc.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and you will get all months for each land from 10.09 - 03.10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Mar 2010 15:48:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674304#M1448487</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-03-17T15:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Itab manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674305#M1448488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Axel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output from the code which u gave is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;100                A 01.10             5,00
100                A 02.10             4,00
100                A 03.10             5,00
100                A 09.10             5,00
100                A 11.09             0,00
100                A 11.09             0,00
100                A 11.09             0,00
100                A 11.09             0,00
100                A 12.09             0,00
100                A 12.09             0,00
100                A 12.09             0,00
100                A 12.09             0,00
100                B 01.10             0,00
100                B 02.10             0,00
100                B 03.10             0,00
100                B 11.09             0,00
100                B 12.09             5,00
100                C 01.10             0,00
100                C 02.10             0,00
100                C 03.10             0,00
100                C 11.09             4,00
100                C 12.09             0,00&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2 questions.&lt;/P&gt;&lt;P&gt; for the months which are not there  atleast for "A" it is repeated thrice with 0 quantities.&lt;/P&gt;&lt;P&gt;should I have to delete it with "delete adjacent entries" or what is the reason for that...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Guys,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What should I do to sort the land by month so that it always goes from lower range to higher(From Nov- March)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: pazzuzu on Mar 17, 2010 4:57 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Mar 2010 15:56:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674305#M1448488</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-17T15:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: Itab manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674306#M1448489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used Marcin's code as a reference &amp;amp; modified it :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA ITAB1 TYPE TT_ITAB WITH HEADER LINE.

SORT ITAB BY MATNR LAND MONTH.

ITAB1[] = ITAB[].

DELETE ADJACENT DUPLICATES FROM ITAB1 COMPARING MATNR LAND.

LOOP AT GT_MONTHCALC.
  LOOP AT ITAB1.
    MOVE-CORRESPONDING ITAB1 TO ITAB_FILL.
    ITAB_FILL-MONTH = GT_MONTHCALC-MONTH.
    CLEAR ITAB_FILL-QUA.
    APPEND ITAB_FILL.
  ENDLOOP.
ENDLOOP.

SORT ITAB_FILL BY MATNR LAND MONTH.

LOOP AT ITAB_FILL.
  READ TABLE ITAB WITH KEY
  MATNR = ITAB_FILL-MATNR
  LAND  = ITAB_FILL-LAND
  MONTH = ITAB_FILL-MONTH BINARY SEARCH.
  IF SY-SUBRC EQ 0.
    ITAB_FILL-QUA = ITAB-QUA.
    MODIFY ITAB_FILL.
  ENDIF.
ENDLOOP.

LOOP AT ITAB_FILL.
  WRITE: / ITAB_FILL-MATNR, ITAB_FILL-LAND,
           ITAB_FILL-MONTH, ITAB_FILL-QUA.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output looks something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;100        A 01.10             5,00&lt;/P&gt;&lt;P&gt;100        A 02.10             4,00&lt;/P&gt;&lt;P&gt;100        A 03.10             5,00&lt;/P&gt;&lt;P&gt;100        A 10.09             0,00&lt;/P&gt;&lt;P&gt;100        A 11.09             0,00&lt;/P&gt;&lt;P&gt;100        A 12.09             0,00&lt;/P&gt;&lt;P&gt;100        B 01.10             0,00&lt;/P&gt;&lt;P&gt;100        B 02.10             0,00&lt;/P&gt;&lt;P&gt;100        B 03.10             0,00&lt;/P&gt;&lt;P&gt;100        B 10.09             0,00&lt;/P&gt;&lt;P&gt;100        B 11.09             0,00&lt;/P&gt;&lt;P&gt;100        B 12.09             5,00&lt;/P&gt;&lt;P&gt;100        C 01.10             0,00&lt;/P&gt;&lt;P&gt;100        C 02.10             0,00&lt;/P&gt;&lt;P&gt;100        C 03.10             0,00&lt;/P&gt;&lt;P&gt;100        C 10.09             0,00&lt;/P&gt;&lt;P&gt;100        C 11.09             4,00&lt;/P&gt;&lt;P&gt;100        C 12.09             0,00&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Mar 2010 16:18:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674306#M1448489</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-03-17T16:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: Itab manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674307#M1448490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much Guys....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works perfect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 last question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What should be done to sort the itab accoring to matnr,Land and month so that &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the month is displayed from lowerrange to upper range (That is from Nov2009 -Mar 2010).Should I have to change the type of month to date from string.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Mar 2010 16:48:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674307#M1448490</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-17T16:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Itab manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674308#M1448491</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;You no need to change the type.&lt;/P&gt;&lt;P&gt;Check this,&lt;/P&gt;&lt;P&gt;SORT itab by matnr land ascending month descending.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Mar 2010 19:08:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674308#M1448491</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-03-17T19:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Itab manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674309#M1448492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What should be done to sort the itab accoring to matnr,Land and month so that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the month is displayed from lowerrange to upper range (That is from Nov2009 -Mar 2010).Should I have to change the type of month to date from string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sort it like this&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT itab BY matnr land month+3(2) month(2).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 07:47:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674309#M1448492</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-03-18T07:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: Itab manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674310#M1448493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;wlll try it out guys...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: pazzuzu on Mar 18, 2010 10:01 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 08:52:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674310#M1448493</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-18T08:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: Itab manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674311#M1448494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Strange I've got this one&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
100                A 10.09             0,00
100                A 11.09             0,00
100                A 12.09             0,00
100                A 01.10             5,00
100                A 02.10             4,00
100                A 03.10             5,00
100                A 09.10             5,00
100                B 10.09             0,00
100                B 11.09             0,00
100                B 12.09             5,00
100                B 01.10             0,00
100                B 02.10             0,00
100                B 03.10             0,00
100                C 10.09             0,00
100                C 11.09             4,00
100                C 12.09             0,00
100                C 01.10             0,00
100                C 02.10             0,00
100                C 03.10             0,00
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Are you using this sort just before output? For correct table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 09:00:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674311#M1448494</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-03-18T09:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Itab manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674312#M1448495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Marcin sorry, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Was sorting the wrong table.&lt;/P&gt;&lt;P&gt;It works perfectly. Thanks a lot pal.You made my day....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 09:03:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674312#M1448495</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-18T09:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Itab manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674313#M1448496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot guys......&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 09:03:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-manipulation/m-p/6674313#M1448496</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-18T09:03:39Z</dc:date>
    </item>
  </channel>
</rss>

