‎2010 Aug 04 8:47 AM
Hi,
Good day guys
ive dev the smart form for sales. i need to cal the total sales per month as well as Region wise and branch wise.
i dont the total sales per month. now i need to cal the region wise.
so i used the code as below as
sort itab by region.
loop at itab into wa.
at new region.
sum.
append wa to itab2.
clear:wa.
endat
endloop.
iam bit confuse with at new and on chage of.. plz let me know how to cal the region wise.
regards
chandu
‎2010 Aug 04 9:09 AM
Hi..
Consider an internal table of following type
Month Region Person Department
If you use AT NEW Field3, then it is triggered when ever Field3 changes as well as whenever value in its preceding column change.
It considers the columns till Field3 as key, and any change in one of these values triggers AT NEW.
Now using AT NEW Month, will trigger at new whenever Month changes.
However if you use AT NEW person, then it will be triggered even if Month or Region changes, not just Person.
One more thing I would like to mention.
Once you use at new month which works fine and then you try to use at new region, then you should use another internal table having the following structure.
Region Month Person Department
ON CHANGE of gets triggered when ever the mentioned field changes.However this is obsolete now.
Regards,
Karthik
‎2010 Aug 04 9:09 AM
Hi..
Consider an internal table of following type
Month Region Person Department
If you use AT NEW Field3, then it is triggered when ever Field3 changes as well as whenever value in its preceding column change.
It considers the columns till Field3 as key, and any change in one of these values triggers AT NEW.
Now using AT NEW Month, will trigger at new whenever Month changes.
However if you use AT NEW person, then it will be triggered even if Month or Region changes, not just Person.
One more thing I would like to mention.
Once you use at new month which works fine and then you try to use at new region, then you should use another internal table having the following structure.
Region Month Person Department
ON CHANGE of gets triggered when ever the mentioned field changes.However this is obsolete now.
Regards,
Karthik