Application Development 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: 

Downloading Excel file Grand totals.....

naveen_inuganti2
Active Contributor
0 Kudos
97

hi all...

iam having one requirement... that to get output with grandtotals for one field...

and

if i click the push button in output application tool bar of that report(EXCEL) , i need to get excel format file...into my presentation server...

for this i used gui_download function module...

but as we know iam not getting grandtotals of that field in excell output...

why?

because.... i can just down load the one populated internal table into files.. but not their looping activities...

and any way i got succeded apart of that...

*****************************************************

but..,

now my requirement is to get grand totals of that field in excel sheet also...at bottom of the same field (just like in report)..

so i went for the following syntax , just before down load the itab...

itab-f1 = ' ' .

itab-f2 = ' ' .

itab-f3 = ' ' .

itab-f4 = ' ' .

itab-f5 = tot_f5 .

itab-f6 = ' ' .

append itab.

here tot_f5 is the variable which is filled with the grand toatl value of that field.

so my my problem solved... because... iam getting grand totals in last row and just in down CELL of the same field...

as you know technically this is the another record of the internal table...so al other fields of last row are also there but spaces...

So...here i got another problem...that is with second fieldof itab,which is the date field..so at last line of my output file iam not only getting total value for field5 but also getting two slashes( / / ) for the field2

( because that date field i have to calulate and fulfill with concatenate taement with month adte year seperaters "/")

how can i rectify this....

my problem has to solve at this program level only..

thank you very much for valuble time..

Naveen i

Edited by: Naveen Inuganti on May 20, 2008 11:59 AM

Edited by: Naveen Inuganti on May 20, 2008 12:02 PM

Edited by: Naveen Inuganti on Jun 13, 2008 12:08 PM

Edited by: Naveen Inuganti on Jun 13, 2008 12:31 PM

1 ACCEPTED SOLUTION

vinod_vemuru2
Active Contributor
0 Kudos
37

Hi Naveen,

How u declared that date field in ur output internal table? Declare it with type as CHAR10. It will solve ur problem.

Also instead of ' ' u can use key word SPACE for assigning space whick looks good. Logically both will work in the same way.

Thanks,

Vinod.

3 REPLIES 3

vinod_vemuru2
Active Contributor
0 Kudos
38

Hi Naveen,

How u declared that date field in ur output internal table? Declare it with type as CHAR10. It will solve ur problem.

Also instead of ' ' u can use key word SPACE for assigning space whick looks good. Logically both will work in the same way.

Thanks,

Vinod.

0 Kudos
37

...ya... if i declared that with char 10 iam not getting those seperators.. even for all dates.... in report and excel file...

Thanks,

Naveen.I

0 Kudos
37

Hi Naveen,

Keep the char 10 declaration as it is. Now u must be getting date from some data base tabel. What u have to do is use

WRITE TO statement to write the date to ur final itab. This will write the date with seperators as per user settings.

eg: U r getting date into final itab from dbtab-date.

Now WRITE wa_dbtab-date TO wa_tab-date.

Populate other fields.

APPEND wa_tab TO i_tab.

So the only change required is instead of assignment operator u have to use write to statement.

In the grand total record u can assign space for date fields as usual.

Thanks,

Vinod.