Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

sort criteria using smartforms

Former Member
0 Likes
648

hi folks,

I need help to accomplish this...

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

Now, I have sort them based on following types,

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.

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)

compare them, and if they do not match that customer stattement should be printed next in the order separately.

iii) then 'zero balance' statements

iv) then single page and multi page statements

I need help here because I do not know where to start and how to take it,

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

I WOULD APPRECIATE YOUR HELP IN THIS.

THANKS

VINU

1 REPLY 1
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
366

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.

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.

Regards,

Rich Heilman