Application Development and Automation 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: 
Read only

Sorting in Classical report

Former Member
0 Likes
1,070

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
861

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

6 REPLIES 6
Read only

Former Member
0 Likes
861

Hi,

Check this link

https://www.sdn.sap.com/irj/scn/forums

regards

pavan

Read only

Former Member
0 Likes
861

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

Read only

0 Likes
861

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

Read only

0 Likes
861

yes you can add 2 buttons and code accordingly

SORT itab by field descending.

SORT itab by field ascending.

Regards

Mansi.

Read only

Former Member
0 Likes
862

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

Read only

0 Likes
861

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