‎2009 Jun 17 12:07 PM
Hi friends,
I am working with a Stasndard FI Report RFKOPR00,Right now In this report,data is not getting diplayed profitcenter wise.hence user wants me add profit center in selection-screen and sort the output, it is a simple classical report,by priftcenter by proving a Sort button in application tool bar.
Could you please let me know, How I can provide this option,and the proccedure.
Kindly, provide me sample code if available.
Follwoing is the code that Prints output data.
loop at it_item into wa_item.
format color col_normal.
write:/ sy-vline.
write : 2 wa_item-lifnr,
12 wa_item-name1,
30 wa_item-prctr,
41 wa_item-bukrs,
50 wa_item-belnr,
60 wa_item-buzei,
70 wa_item-netdt,
80 wa_item-zfbdt,
90 wa_item-budat,
100 wa_item-bldat,
110 wa_item-bschl,
115 wa_item-zlsch,
120 wa_item-WAERS,
150 wa_item-wrshb.
WRITE : 170 SY-VLINE.
format color off.
endloop.
Regards,
Xavier.P.
‎2009 Jun 17 12:16 PM
Hi,
There is an enhancement point in the subroutine : FORM raster_ausgabe_alv_grid
Just sort the output table before the ALV list display in the standard program,
SORT <tablename> by <profitcenter>
For addition of new field on selection screen its not possible as there is no enhancement point to add your custom code..
Hope you need to copy the report into a Z report and make changes
Regards
Shiva
‎2009 Jun 17 12:14 PM
‎2009 Jun 17 12:15 PM
Hi ,
On selection screen add
select-options: s_prctr for tablename-prctr . <--- add table name e.g mara-matnr
Then before displaying report sort using following syntax -
SORT it_item by prctr.... ( you can add the required fields here).
You may need to use control statement like AT END .... ENDAT
‎2009 Jun 17 12:19 PM
Hi Narayan,
Is it Possible to provide Two buttons( Sort ascending, and srot descending) in application toolbar so that when the user clicks these two buttons output will be sorted Just like in ALV Grid display?
Regards,
Xavier.P
‎2009 Jun 17 12:26 PM
yes you can add 2 buttons and code accordingly
SORT itab by field descending.
SORT itab by field ascending.
Regards
Mansi.
‎2009 Jun 17 12:16 PM
Hi,
There is an enhancement point in the subroutine : FORM raster_ausgabe_alv_grid
Just sort the output table before the ALV list display in the standard program,
SORT <tablename> by <profitcenter>
For addition of new field on selection screen its not possible as there is no enhancement point to add your custom code..
Hope you need to copy the report into a Z report and make changes
Regards
Shiva
‎2009 Jun 17 12:25 PM
Hi Shiva,
as you said, I am copying the standard report to Z and making changes, but can we provide two buttons( Sort Ascend and descend ) in Application toolbar of the classical report?
Regards,
Xavier.P