<?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: Sorting In Table Maintenence Generator in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-table-maintenence-generator/m-p/7696150#M1577508</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Florian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If once you have created the table maintenance generator follow the below steps for the needful:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 1: Choose the menu path &lt;STRONG&gt;Environment -&amp;gt; Modification -&amp;gt; Maintenance Screens&lt;/STRONG&gt;, you will get a popup with screen number and description. Double click on screen number, with that you can see the flow logic of the screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 2: Now define one PBO module (MODULE sort_before_save) under &lt;STRONG&gt;PROCEE BEFORE OUTPUT&lt;/STRONG&gt; statement as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROCESS BEFORE OUTPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;EM&gt;MODULE sort_before_display.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; MODULE LISTE_INITIALISIEREN.&lt;/P&gt;&lt;P&gt; LOOP AT EXTRACT WITH CONTROL&lt;/P&gt;&lt;P&gt;  TCTRL_ZZTEST CURSOR NEXTLINE.&lt;/P&gt;&lt;P&gt;   MODULE LISTE_SHOW_LISTE.&lt;/P&gt;&lt;P&gt; ENDLOOP.   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 3: Now create the module &lt;STRONG&gt;SORT_BEFORE_SAVE&lt;/STRONG&gt;. With in the module define one internal table with the reference of the table name. For example the table name is: ZZTEST then you have to define one internal table as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: ta_zztest TYPE STANDARD TABLE OF ZZTEST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then copy the data from the table TOTAL TO TA_ZZTEST as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TA_ZZTEST[ ] = TOTAL[ ].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now sort the table TA_ZZTEST[ ] as for your requirement. For example table ZZTEST have 3 fields like Field1, field2, and field3, and if you want sort the data based on third field then you can sort the table data as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT ta_zztest[ ] by field3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now copy the data from TA_ZZTEST[ ] to TOTAL[ ] as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TOTAL[ ] = TA_ZZTEST[ ].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At last copy the data from TOTAL[ ] to EXTRACT[ ] as below:&lt;/P&gt;&lt;P&gt;EXTRACT[ ] = TOTAL[ ].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_______________________________________________________________________________________________&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;module sort_before_display output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: ta_test TYPE TABLE OF zztest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ta_test[ ] = total[ ].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SORT ta_test[ ] by field3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  total[ ] = ta_test[ ].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  extract[ ] = total[ ].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endmodule.                 " sort_before_display  OUTPUT&lt;/P&gt;&lt;P&gt;_______________________________________________________________________________________________&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Save and activate. Goto transaction code SM30 and see the table entries, you can find all the entries in sorting order based on the table field FIELD3. &lt;/P&gt;&lt;P&gt;I hope this will solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Mallik_M on Feb 3, 2011 10:44 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Feb 2011 21:42:27 GMT</pubDate>
    <dc:creator>Mallikarjuna</dc:creator>
    <dc:date>2011-02-03T21:42:27Z</dc:date>
    <item>
      <title>Sorting In Table Maintenence Generator</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-table-maintenence-generator/m-p/7696147#M1577505</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 need to sort table before it display it, &lt;/P&gt;&lt;P&gt;I used the following code, But In ECC 6.0 I got dumb.&lt;/P&gt;&lt;P&gt;Assigning extract[] = gt_ztest[]   ( OBJECTS_TABLES_NOT_COMPATIBLE ) it says... Is it possible help me,...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line: -&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Step 1:&lt;/P&gt;&lt;P&gt;Insert a module line after the module "LISTE_INITIALISIEREN" .&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;PROCESS BEFORE OUTPUT.&lt;/P&gt;&lt;P&gt;MODULE LISTE_INITIALISIEREN.&lt;/P&gt;&lt;P&gt;MODULE sort .&lt;/P&gt;&lt;P&gt;LOOP AT EXTRACT ...&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;Step 2:&lt;/P&gt;&lt;P&gt;In your new module (in my example "sort"), do the sorting as follows. I will sort my table by the field "f3" .Thank God because ABAP gives assignment regardless of structures of both sides. Here what I mean: &lt;/P&gt;&lt;P&gt;e.g. &lt;/P&gt;&lt;P&gt;MODULE sort OUTPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA gt_ztest LIKE ztest OCCURS 1 WITH HEADER LINE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Getting the content of extract in an internal table &lt;/P&gt;&lt;P&gt;*-having the structure of my table.&lt;/P&gt;&lt;P&gt;gt_ztest] = extract[ .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Sorting it&lt;/P&gt;&lt;P&gt;SORT gt_ztest BY f3 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Restoring extract from my sorted table&lt;/P&gt;&lt;P&gt;extract[] = gt_ztest[] .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMODULE. " sort OUTPUT&lt;/P&gt;&lt;P&gt;Line: -&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Feb 2011 06:22:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-table-maintenence-generator/m-p/7696147#M1577505</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-03T06:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting In Table Maintenence Generator</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-table-maintenence-generator/m-p/7696148#M1577506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Florian,&lt;/P&gt;&lt;P&gt; You got that dump because of incorrect data type of table which you have declared "LIKE ztest".If you want to sort the final table why dont you sort extract directly? I think you can do it.&lt;/P&gt;&lt;P&gt;Equal assigment operator you can use only when both the tables have same structure and fields in it.Please check the fields in both the tables gt_ztest and extract.That should be same to use "=" Operator to copy data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Saurabh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Feb 2011 10:32:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-table-maintenence-generator/m-p/7696148#M1577506</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-03T10:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting In Table Maintenence Generator</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-table-maintenence-generator/m-p/7696149#M1577507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Saurabh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ya thats ok. But in Table maintenence Generator then how to use the sort. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on the follwing thread only i used this code.&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="110552"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But  in my ECC 6.0 Server it not working.  &lt;/P&gt;&lt;P&gt;How to implement Sort condition before display the data in table maintenence generator this is my problem now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Feb 2011 11:30:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-table-maintenence-generator/m-p/7696149#M1577507</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-03T11:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting In Table Maintenence Generator</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-table-maintenence-generator/m-p/7696150#M1577508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Florian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If once you have created the table maintenance generator follow the below steps for the needful:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 1: Choose the menu path &lt;STRONG&gt;Environment -&amp;gt; Modification -&amp;gt; Maintenance Screens&lt;/STRONG&gt;, you will get a popup with screen number and description. Double click on screen number, with that you can see the flow logic of the screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 2: Now define one PBO module (MODULE sort_before_save) under &lt;STRONG&gt;PROCEE BEFORE OUTPUT&lt;/STRONG&gt; statement as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROCESS BEFORE OUTPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;EM&gt;MODULE sort_before_display.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; MODULE LISTE_INITIALISIEREN.&lt;/P&gt;&lt;P&gt; LOOP AT EXTRACT WITH CONTROL&lt;/P&gt;&lt;P&gt;  TCTRL_ZZTEST CURSOR NEXTLINE.&lt;/P&gt;&lt;P&gt;   MODULE LISTE_SHOW_LISTE.&lt;/P&gt;&lt;P&gt; ENDLOOP.   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 3: Now create the module &lt;STRONG&gt;SORT_BEFORE_SAVE&lt;/STRONG&gt;. With in the module define one internal table with the reference of the table name. For example the table name is: ZZTEST then you have to define one internal table as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: ta_zztest TYPE STANDARD TABLE OF ZZTEST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then copy the data from the table TOTAL TO TA_ZZTEST as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TA_ZZTEST[ ] = TOTAL[ ].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now sort the table TA_ZZTEST[ ] as for your requirement. For example table ZZTEST have 3 fields like Field1, field2, and field3, and if you want sort the data based on third field then you can sort the table data as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT ta_zztest[ ] by field3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now copy the data from TA_ZZTEST[ ] to TOTAL[ ] as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TOTAL[ ] = TA_ZZTEST[ ].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At last copy the data from TOTAL[ ] to EXTRACT[ ] as below:&lt;/P&gt;&lt;P&gt;EXTRACT[ ] = TOTAL[ ].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_______________________________________________________________________________________________&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;module sort_before_display output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: ta_test TYPE TABLE OF zztest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ta_test[ ] = total[ ].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SORT ta_test[ ] by field3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  total[ ] = ta_test[ ].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  extract[ ] = total[ ].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endmodule.                 " sort_before_display  OUTPUT&lt;/P&gt;&lt;P&gt;_______________________________________________________________________________________________&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Save and activate. Goto transaction code SM30 and see the table entries, you can find all the entries in sorting order based on the table field FIELD3. &lt;/P&gt;&lt;P&gt;I hope this will solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Mallik_M on Feb 3, 2011 10:44 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Feb 2011 21:42:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-table-maintenence-generator/m-p/7696150#M1577508</guid>
      <dc:creator>Mallikarjuna</dc:creator>
      <dc:date>2011-02-03T21:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting In Table Maintenence Generator</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-table-maintenence-generator/m-p/7696151#M1577509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mallik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per your Suggestion I inserted the following code, for ZSPFLI which is replica of SPFLI table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  DATA: TA_TEST TYPE TABLE OF ZSPFLI.

  TA_TEST[ ] = TOTAL[ ].                     

  SORT TA_TEST[ ] BY DISTANCE.

  TOTAL[ ] = TA_TEST[ ].

  EXTRACT[ ] = TOTAL[ ].
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; TA_TEST[ ] = TOTAL[ ].                      &lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;-----&amp;gt; Dump ( OBJECTS_TABLES_NOT_COMPATIBLE )&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For minimum fields and char fields its working i think. But in my table DATS, NUMC, QUAN types may come.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suggest me if you have any idea.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Feb 2011 12:27:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-table-maintenence-generator/m-p/7696151#M1577509</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-07T12:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting In Table Maintenence Generator</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-table-maintenence-generator/m-p/7696152#M1577510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Florian!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to know if you have found any solution for this problem. I have the same error message and I cannot find any solution around. Can you help me?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Betty&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2011 12:48:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-table-maintenence-generator/m-p/7696152#M1577510</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-13T12:48:17Z</dc:date>
    </item>
  </channel>
</rss>

