05-24-2011 8:26 AM
Hi,
I have written an ALV report. it is working fine. in Reports my out put is coming like this.
Account group G/L Account No
Name
-
Liability 100000
100010
100020
100030
Assets 200000
200010
200020
but my problem is when I am exporting into Excel sheet my Account group is repeating for every G/L account number.
But I want out like this in my Excel Sheet also.So can any one tell me solution for it.
Thanks
Nayan kumar sahu
Moderator message: please choose more descriptive subject lines for your posts.
Edited by: Thomas Zloch on May 24, 2011 9:53 AM
05-24-2011 9:02 AM
Hi,
if your passing account grp field in sort itab while calling the ALV_GRID_Display you get the output like this but in case of exporting into Excel sheet it wont come.
if you want to come the same format means you have manually pass the account group once the account group is changed.before doing the code dont pass the filed name in sort itab while calling the ALV_Grid display.
Please do the below coding.
sort itab by "Account group and G/L Account No.
read table itab index 1.
pass the acc group to some other variable like (lv_accgrp).
loop ITAB .
if lv_accgrp NE accgrp.
pass the account group to final itab.
and pass the accgrp to lv_accgrp.
endif.
pass the all field in final itab except accgrp.
endloop.
Hope it will help full.
Regards,
Dhina..
05-24-2011 8:38 AM
Hi.,
You used sort up in your ALV., Account group will still be there(in Internal table) but it will just hide that., So whenever you export to excel it will export the contents in internal table.
If you want in excel also like the above output., you have to do it manually.,
sort the internal table.,
loop internal table to wa.
at new account group
append it to final internal table.
end at.
endloop.
now pass final internal table to ALV.
now if u export to excel only the above output will come in excel also.
hope this will help u.,
reply if u need some more clarifications.,
Thanks & Regards
Kiran
05-24-2011 9:02 AM
Hi,
if your passing account grp field in sort itab while calling the ALV_GRID_Display you get the output like this but in case of exporting into Excel sheet it wont come.
if you want to come the same format means you have manually pass the account group once the account group is changed.before doing the code dont pass the filed name in sort itab while calling the ALV_Grid display.
Please do the below coding.
sort itab by "Account group and G/L Account No.
read table itab index 1.
pass the acc group to some other variable like (lv_accgrp).
loop ITAB .
if lv_accgrp NE accgrp.
pass the account group to final itab.
and pass the accgrp to lv_accgrp.
endif.
pass the all field in final itab except accgrp.
endloop.
Hope it will help full.
Regards,
Dhina..
05-25-2011 7:26 AM
Hi,
I did the same thing but my client want out put should come like as reports.
I know we can't control while transporting to excel sheet. If any one have any
idea please help me out form here.
Thanks
Nayan kumar sahu
05-25-2011 1:09 PM
Hi,
I think this one we cant do that. we have to do the similar way like above i told.
if your passing account grp field in sort itab while calling the ALV_GRID_Display you get the output like this
but in case of exporting into Excel sheet the account grp is repeating each row.
if you want to come the same format means you have manually pass the space while repeating the acc grp in the final itab.
once the account group is changed that time u pass the changes acc grp in the final itab.
before doing the code dont pass the filed name in sort itab while calling the ALV_Grid display. do the above coding wht i given.
Regards,
Dhina..
06-01-2011 11:53 AM
Hi,
I resolved the issue. I convinced my client.
Thanks all for your support.
Thanks
Nayan kumar sahu
Edited by: nayan kumar sahu on Jun 3, 2011 11:08 AM
Edited by: nayan kumar sahu on Jun 10, 2011 2:36 PM
Edited by: nayan kumar sahu on Jun 10, 2011 2:36 PM