cancel
Showing results for 
Search instead for 
Did you mean: 

Handling Alv Grid

Former Member
0 Kudos

Hi All,

I'm using ALV grid for my report output. I'm building the fieldcatalog where i'm passing hotspot for a field. Which has output either yes/no.

Now i need the hand button to be displayed only for records with Yes,so that it can be drilled down.

For No hand symbol should nt come. Is there any way to control hotspot at record level.

Please help.

Thanks,

Bharathi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,<BR>

<BR>

The following code is a template for your requirement:<BR>

<BR>

types: begin of t_data,<BR>

flg(3) type c,<BR>

sty type lvc_t_styl,<BR>

end of t_data,<BR>

t_tdata type table of t_data.<BR>

<BR>

DATA: i_fcat type LVC_T_FCAT,<BR>

s_fcat type lvc_s_fcat,<BR>

s_lay type lvc_s_layo,<BR>

s_sty type lvc_s_styl,<BR>

i_data type t_tdata,<BR>

s_data type t_data.<BR>

<BR>

s_lay-stylefname = 'STY'.<BR>

<BR>

s_fcat-FIELDNAME = 'FLG'.<BR>

APPEND s_fcat to i_fcat.<BR>

<BR>

CLEAR: s_data.<BR>

s_data-flg = 'Yes'.<BR>

s_sty-FIELDNAME = 'FLG'.<BR>

s_sty-style = CL_GUI_ALV_GRID=>MC_STYLE_HOTSPOT.<BR>

insert s_sty into TABLE s_data-sty.<BR>

APPEND s_data to i_data.<BR>

<BR>

CLEAR: s_data.<BR>

s_data-flg = 'No'.<BR>

s_sty-FIELDNAME = 'FLG'.<BR>

s_sty-style = CL_GUI_ALV_GRID=>MC_STYLE_HOTSPOT_NO.<BR>

insert s_sty into TABLE s_data-sty.<BR>

APPEND s_data to i_data.<BR>

<BR>

CLEAR: s_data.<BR>

s_data-flg = 'No'.<BR>

s_sty-FIELDNAME = 'FLG'.<BR>

s_sty-style = CL_GUI_ALV_GRID=>MC_STYLE_HOTSPOT_NO.<BR>

insert s_sty into TABLE s_data-sty.<BR>

APPEND s_data to i_data.<BR>

<BR>

CLEAR: s_data.<BR>

s_data-flg = 'Yes'.<BR>

s_sty-FIELDNAME = 'FLG'.<BR>

s_sty-style = CL_GUI_ALV_GRID=>MC_STYLE_HOTSPOT.<BR>

insert s_sty into TABLE s_data-sty.<BR>

APPEND s_data to i_data.<BR>

<BR>

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'<BR>

EXPORTING<BR>

  • I_INTERFACE_CHECK = ' '<BR>

  • I_BYPASSING_BUFFER =<BR>

  • I_BUFFER_ACTIVE =<BR>

  • I_CALLBACK_PROGRAM = ' '<BR>

  • I_CALLBACK_PF_STATUS_SET = ' '<BR>

  • I_CALLBACK_USER_COMMAND = ' '<BR>

  • I_CALLBACK_TOP_OF_PAGE = ' '<BR>

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '<BR>

  • I_CALLBACK_HTML_END_OF_LIST = ' '<BR>

  • I_STRUCTURE_NAME =<BR>

  • I_BACKGROUND_ID = ' '<BR>

  • I_GRID_TITLE =<BR>

  • I_GRID_SETTINGS =<BR>

IS_LAYOUT_LVC = s_lay<BR>

IT_FIELDCAT_LVC = i_fcat<BR>

  • IT_EXCLUDING =<BR>

  • IT_SPECIAL_GROUPS_LVC =<BR>

  • IT_SORT_LVC =<BR>

  • IT_FILTER_LVC =<BR>

  • IT_HYPERLINK =<BR>

  • IS_SEL_HIDE =<BR>

  • I_DEFAULT = 'X'<BR>

  • I_SAVE = ' '<BR>

  • IS_VARIANT =<BR>

  • IT_EVENTS =<BR>

  • IT_EVENT_EXIT =<BR>

  • IS_PRINT_LVC =<BR>

  • IS_REPREP_ID_LVC =<BR>

  • I_SCREEN_START_COLUMN = 0<BR>

  • I_SCREEN_START_LINE = 0<BR>

  • I_SCREEN_END_COLUMN = 0<BR>

  • I_SCREEN_END_LINE = 0<BR>

  • I_HTML_HEIGHT_TOP =<BR>

  • I_HTML_HEIGHT_END =<BR>

  • IT_EXCEPT_QINFO_LVC =<BR>

  • IR_SALV_FULLSCREEN_ADAPTER =<BR>

  • IMPORTING<BR>

  • E_EXIT_CAUSED_BY_CALLER =<BR>

  • ES_EXIT_CAUSED_BY_USER =<BR>

TABLES<BR>

T_OUTTAB = i_data<BR>

  • EXCEPTIONS<BR>

  • PROGRAM_ERROR = 1<BR>

  • OTHERS = 2<BR>

.<BR>

IF SY-SUBRC <> 0.<BR>

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO<BR>

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.<BR>

ENDIF.<BR>

<BR>

Thanks,<BR>

Kiruba.<BR>

Answers (5)

Answers (5)

Former Member
0 Kudos

.

Former Member
0 Kudos

Hi,

Try this.

Whenever the No comes, u have restricted the output.

In the same way, change the fieldcatalog data for that corresponding field and refresh the grid.

Hope this helps you.

Regards,

Sharin.

Former Member
0 Kudos
Former Member
0 Kudos

Hi,

Hotspot is possible at field leval in fieldcatalog...but at record leval I d'nt think.

Better u search in thread for hotspot.

Regards,

Naveen M.

Former Member
0 Kudos

Hello Bharathi,

Controling the hotspot at record level is not possible as per my knowledge.

But if want to control the drill down of report. You can check the field value in the user command and add a condition for drill down.

i .e


if <field> = 'Yes'.
    " code for drill down report.
endif.

Hope this helps you.

Regards,

Sachinkumar Mehta.

Edited by: Sachinkumar Mehta on May 21, 2009 7:08 AM

Former Member
0 Kudos

That i've controlled...but my requirement is such tht they dont want even the hand to get displayed....