2011 Mar 07 5:23 AM
I have written following code to get cumulative amount on a date but i have to hit database for each record.
Can't I use some function similar to SUM for doing the same thing on internal table??It would increase my performance.
code is:
SELECT SUM( DEB_CRE_LC ) FROM /BIC/AZFIAR_O500
INTO LV_BALMONTH WHERE DEBITOR = LV_DEBITOR AND
CALMONTH GE LV_STARTMONTH AND CALMONTH LE LV_LASTCALMON.
I want to put ZFIAR data to internal table and read and do SUM thing..is it possible?? withotut usiong loop.
regards,
rakesh
I have written following code to get cumulative amount on a date but i have to hit database for each record.
Can't I use some function similar to SUM for doing the same thing on internal table??It would increase my performance.
code is:
SELECT SUM( DEB_CRE_LC ) FROM /BIC/AZFIAR_O500
INTO LV_BALMONTH WHERE DEBITOR = LV_DEBITOR AND
CALMONTH GE LV_STARTMONTH AND CALMONTH LE LV_LASTCALMON.
I want to put ZFIAR data to internal table and read and do SUM thing..is it possible?? withotut usiong loop.
regards,
rakesh
2011 Mar 07 10:56 AM
You can use SUM statement at the time of selecting data to an internal table...
Do not know if any keyword is there to do similar activity...
Thanks
2011 Mar 07 11:07 AM
You have loop on your internal table, then use COLLECT or SUM ststement
2011 Mar 07 11:30 AM
Hi Rajesh,
types : begin of ty_tab,
date type dats,
DEB_CRE_LC type ..... " delare type & is the filed need to summerized
end of ty_tab,
data: itab type standard table of ty_tab.
SELECT date
SUM( DEB_CRE_LC ) as DEB_CRE_LC FROM /BIC/AZFIAR_O500
INTO corresponding fields of itab
where CALMONTH GE LV_STARTMONTH AND CALMONTH LE LV_LASTCALMON
group by date. " date is the field available in your ODS/transparent table
simulate the above code in your program...
Hope this will work..
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |