Application Development 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: 

how to avoid discreption in alv grid

Former Member
0 Kudos

Hi Experts,

I am having two radio buttons, if I select 1st radio buttn it should come sales report

otherwise it should come tax report.

Alv grid i am using commentry write its working fine, but top of the alv i am getting report discrition it is coming from attributes.

I would like to change attribute discription based on radio buttons.

thanks in advance.

manisha.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Modify the Field Catalog after the Commentary call.

Sorry.. thought you were asking about column headings.

You can set up a TOP_OF_PAGE event and handle it here


FORM top_of_page.
*
  DATA: ls_line TYPE slis_listheader.
*
  CLEAR g_list_top_of_page[].
  CLEAR ls_line.
  ls_line-typ  = 'H'.
  ls_line-info = 'Lead Selection'.       "<== Change this based on your RB.
  APPEND ls_line TO g_list_top_of_page.
  PERFORM build_sub_headings
      USING g_list_top_of_page.
*
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
       EXPORTING
            it_list_commentary = g_list_top_of_page[].
*
ENDFORM.                    " top_of_page
FORM build_sub_headings
        USING e07_top_of_page TYPE slis_t_listheader.
  DATA: ls_line TYPE slis_listheader.
*
  CLEAR ls_line.
  ls_line-typ  = 'S'.
  ls_line-key = 'Run Info'.
  CONCATENATE  sy-sysid sy-uname sy-mandt
        INTO ls_line-info
        SEPARATED BY space.
  APPEND ls_line TO e07_top_of_page.
*
ENDFORM.                    "build_sub_headings

Edited by: Paul Chapman on Jun 6, 2008 11:03 AM

4 REPLIES 4

Former Member
0 Kudos

Modify the Field Catalog after the Commentary call.

Sorry.. thought you were asking about column headings.

You can set up a TOP_OF_PAGE event and handle it here


FORM top_of_page.
*
  DATA: ls_line TYPE slis_listheader.
*
  CLEAR g_list_top_of_page[].
  CLEAR ls_line.
  ls_line-typ  = 'H'.
  ls_line-info = 'Lead Selection'.       "<== Change this based on your RB.
  APPEND ls_line TO g_list_top_of_page.
  PERFORM build_sub_headings
      USING g_list_top_of_page.
*
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
       EXPORTING
            it_list_commentary = g_list_top_of_page[].
*
ENDFORM.                    " top_of_page
FORM build_sub_headings
        USING e07_top_of_page TYPE slis_t_listheader.
  DATA: ls_line TYPE slis_listheader.
*
  CLEAR ls_line.
  ls_line-typ  = 'S'.
  ls_line-key = 'Run Info'.
  CONCATENATE  sy-sysid sy-uname sy-mandt
        INTO ls_line-info
        SEPARATED BY space.
  APPEND ls_line TO e07_top_of_page.
*
ENDFORM.                    "build_sub_headings

Edited by: Paul Chapman on Jun 6, 2008 11:03 AM

Former Member
0 Kudos

Hi,

use the below logic:

If radiobutton1 eq 'X'.

SET TITLEBAR 'TITLE1'.

else.

SET TITLEBAR 'TITLE2'.

endif.

You can double click on the 'TITLE1' and 'TITLE2' to add your own description.

Thanks.

Former Member
0 Kudos

Assign the required title to SY-TITLE.

or else use SET TITLEBAR 'XXXXX' statement.

Edited by: Ntajib Netaji on Jun 6, 2008 4:58 PM

former_member212653
Active Contributor
0 Kudos

Try this:



if       p_case1  = 'X'.
wa_layout-window_titlebar = 'My Title 1'.
elseif p_case2 = 'X'.
wa_layout-window_titlebar = 'My Title 2'.
endif.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    I_STRUCTURE_NAME                  = 'SBOOK'
    IS_LAYOUT                         = wa_layout
  TABLES
    t_outtab                          = i_sbook
  EXCEPTIONS
    PROGRAM_ERROR                     = 1
    OTHERS                            = 2
          .