<?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 sort criteria using smartforms in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-criteria-using-smartforms/m-p/954357#M65914</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need help to accomplish this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to generate AR statements for various  customers using smartform, I am reading the data for various customers in 'ACCITAB' and reading that into the work area  'WA_ACCITAB' in the smartform&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I have sort them based on following types,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i) special Handling  - There is a field in KNB1 and if it s flagged for a particular customer that should to be printed first always.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ii) 'zcurrenttotal'(variable that calculates the total amount in the body of the form based on the records) and 'totalamountdue'(that comes from the aging)&lt;/P&gt;&lt;P&gt;compare them, and if they do not match that customer stattement should be printed next in the order separately.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;iii) then 'zero balance' statements &lt;/P&gt;&lt;P&gt;iv) then single page and multi page statements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need help here because I do not know where to start and how to take it, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RICH, I KNOW YOU CAME UP WITH SPLITTING UP THE CUSTOMER INTO DIFFERENT TABLES BUT I NEED THE DATA IN 'ACCITAB' AS TO BE TRANSFERRED INTO THE SMARTFORM BUT IT SHOULD IDENTIFY THE 'START' AND 'END' RECORD FOR EACH CUSTOMER BASED ON THE SORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I WOULD APPRECIATE YOUR HELP IN THIS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THANKS&lt;/P&gt;&lt;P&gt;VINU&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Sep 2005 14:29:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-09-01T14:29:37Z</dc:date>
    <item>
      <title>sort criteria using smartforms</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-criteria-using-smartforms/m-p/954357#M65914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need help to accomplish this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to generate AR statements for various  customers using smartform, I am reading the data for various customers in 'ACCITAB' and reading that into the work area  'WA_ACCITAB' in the smartform&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I have sort them based on following types,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i) special Handling  - There is a field in KNB1 and if it s flagged for a particular customer that should to be printed first always.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ii) 'zcurrenttotal'(variable that calculates the total amount in the body of the form based on the records) and 'totalamountdue'(that comes from the aging)&lt;/P&gt;&lt;P&gt;compare them, and if they do not match that customer stattement should be printed next in the order separately.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;iii) then 'zero balance' statements &lt;/P&gt;&lt;P&gt;iv) then single page and multi page statements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need help here because I do not know where to start and how to take it, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RICH, I KNOW YOU CAME UP WITH SPLITTING UP THE CUSTOMER INTO DIFFERENT TABLES BUT I NEED THE DATA IN 'ACCITAB' AS TO BE TRANSFERRED INTO THE SMARTFORM BUT IT SHOULD IDENTIFY THE 'START' AND 'END' RECORD FOR EACH CUSTOMER BASED ON THE SORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I WOULD APPRECIATE YOUR HELP IN THIS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THANKS&lt;/P&gt;&lt;P&gt;VINU&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2005 14:29:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-criteria-using-smartforms/m-p/954357#M65914</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-01T14:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: sort criteria using smartforms</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-criteria-using-smartforms/m-p/954358#M65915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Only send to the smartform, what you need to have printed at that time.  So let's same that ACCITAB has all of the data for all of the customer,  right?   You have another internal table with all of the unique customers, right?  You are loop at that internal table and for each customer, you are printing the statements, right?   So you would another internal table like ACCITAB which will hold only the records for that customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT KUNNR_TAB.


clear accitab2.  refresh accitab2.
Loop at accitab where kunnr = KUNNR_TAB-kunnr.
 move-corresponding accitab to accitab2.
 append accitab2.
endloop.

* Now you can sort ACCITAB2 however you want.

* Call the smartform function module


ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&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>Thu, 01 Sep 2005 14:54:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-criteria-using-smartforms/m-p/954358#M65915</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-09-01T14:54:43Z</dc:date>
    </item>
  </channel>
</rss>

