‎2008 Dec 07 5:51 PM
Hi,
Could you please let me know how do I change the heading of a classical report based on the user selection on selection screen. I want to display the selection text that the user has selected in the selection screen as the heading for the report.
Timely help is highly appreciatable.
Thanks in advance.
Regards,
Farhana.
‎2008 Dec 07 11:16 PM
You will have to insert some WRITE instruction in the TOP-OF-PAGE. You may read the current selection via FM [RS_VARIANT_ADMIN_DATA|https://www.sdn.sap.com/irj/scn/advancedsearch?query=rs_variant_admin_data&cat=sdn_all] and print it using FM [PRINT_SELECTION|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=print_selection&adv=false&sortby=cm_rnd_rankvalue]. (Look at this sample in Code Gallery [how to print selection screen data in report |https://wiki.sdn.sap.com/wiki/display/Snippets/howtoprintselectionscreendatain+report])
Regards
‎2008 Dec 07 6:02 PM
HI,
You can write the code in the TOP-OF-PAGE event. Depending on the user selection on the selection screen display the report heading in the Classical Report..
Example...
Top-Of-page.
If p_rad1 EQ 'X'.
Write : 'Heading1'
ELSEIF p_rad2 EQ 'X'.
Write: 'Heading2'.
ENDIF.
If you want the change the report title..set the system field sy-title with required heading
If p_rad1 EQ 'X'.
sy-title = 'Heading1'
ELSEIF p_rad2 EQ 'X'.
sy-title =: 'Heading2'.
ENDIF.
‎2008 Dec 08 6:04 AM
‎2008 Dec 07 11:16 PM
You will have to insert some WRITE instruction in the TOP-OF-PAGE. You may read the current selection via FM [RS_VARIANT_ADMIN_DATA|https://www.sdn.sap.com/irj/scn/advancedsearch?query=rs_variant_admin_data&cat=sdn_all] and print it using FM [PRINT_SELECTION|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=print_selection&adv=false&sortby=cm_rnd_rankvalue]. (Look at this sample in Code Gallery [how to print selection screen data in report |https://wiki.sdn.sap.com/wiki/display/Snippets/howtoprintselectionscreendatain+report])
Regards
‎2008 Dec 08 6:09 AM
Hi Farhana,
You have a sample code at this link,
[Alv Heading|http://www.sap-img.com/abap/sample-alv-heading-in-alv.htm]
Regards,
Amit.