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

Dynamic Report Heading - Classical report

Former Member
0 Likes
1,136

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.

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
688

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

4 REPLIES 4
Read only

Former Member
0 Likes
688

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.

Read only

0 Likes
688

Thank you Avinash,

This resolevd my query.

Regards,

Farhana.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
689

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

Read only

Former Member
0 Likes
688

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.