09-28-2007 12:35 PM
HI experts,
I'm using the code below. Hi can I set the hotspot to 'X'?
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = v_repid
i_internal_tabname = 'I_REPORT'
i_inclname = v_repid
CHANGING
ct_fieldcat = gt_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
09-28-2007 12:40 PM
Hi stripes,
the table gt_fieldcat[] has a field called <b>hotspot</b>. you declare it as 'X'. that will activate the hotspot option. Reward if useful
09-28-2007 12:37 PM
Hi
See this code sample
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-hotspot = 'X'.
fieldcatalog-key = 'X'.
fieldcatalog-do_sum = 'X'.
fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
The fieldcatalog type is of slis_...
This condtains the hotspot.
types: begin of slis_fieldcat_alv_spec,
key_sel(1) type c, " field not obligatory
no_sum(1) type c, " do not sum up
sp_group(4) type c, " group specification
reprep(1) type c, " selection for rep/rep
input(1) type c, " input
edit(1) type c, " internal use only
hotspot(1) type c, " hotspot
end of slis_fieldcat_alv_spec.
types: begin of slis_fieldcat_alv.
include type slis_fieldcat_main.
include type slis_fieldcat_alv_spec.
types: end of slis_fieldcat_alv.
http://www.sapdevelopment.co.uk/reporting/alv/alvlist_code.htm
<b>reward if usefull</b>
09-28-2007 12:37 PM
hi,
ya u can do that while creating fieldcat like,
wa_fcat-tabname = 'ITAB'.
wa_fcat-fieldname = 'MATNR'.
wa_fcat-seltext_m = 'Material'.
<b>wa_fcat-hotspot = 'X'.</b>
APPEND wa_fcat TO t_fcat.
CLEAR wa_fcat.
reward if useful.
09-28-2007 12:40 PM
Hi stripes,
the table gt_fieldcat[] has a field called <b>hotspot</b>. you declare it as 'X'. that will activate the hotspot option. Reward if useful
09-28-2007 12:44 PM
Hello srikanth,
I tried to set gt_fieldcat = 'X' before the function. But it gives me an error that gt_fieldcat is a table without header line therefore there has no component called HOTSPOT.
09-28-2007 12:48 PM
Hi White..
You have to declare a work area for this:
Type-pools: SLIS.
<b>Data : WA_fieldcat like line of GT_fieldcat.</b>
Read table gt_fieldcat INTO WA_FIELDCAT with key fieldname = 'EBELN'.
IF SY-SUBRC = 0.
<b>WA_FIELDCAT-HOTSPOT = 'X'.</b>
MODIFY GT_Fieldcat from Wa_fieldcat index sy-tabix.
Endif.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = v_repid
i_internal_tabname = 'I_REPORT'
i_inclname = v_repid
CHANGING
ct_fieldcat = gt_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
<b>Reward if Helpful.</b>
09-28-2007 12:40 PM
Hi
Try this:
<b>
Read table gt_fieldcat INTO WA_FIELDCAT with key fieldname = 'EBELN'.
IF SY-SUBRC = 0.
WA_FIELDCAT-HOTSPOT = 'X'.
MODIFY GT_Fieldcat from Wa_fieldcat index sy-tabix.
Endif.</b>
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = v_repid
i_internal_tabname = 'I_REPORT'
i_inclname = v_repid
CHANGING
ct_fieldcat = gt_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
<b>Reward if Helpful.</b>
09-28-2007 12:43 PM
To set the hotspot on, you need to create the field catalog in different way:
declare gx_fieldcat and gt_fieldcat.
data:
gt_fieldcat TYPE slis_t_fieldcat_alv,
gx_fieldcat TYPE slis_fieldcat_alv,
gx_fieldcat-fieldname =
gx_fieldcat-seltext_s =
gx_fieldcat-seltext_m =
gx_fieldcat-seltext_l =
gx_fieldcat-tabname =
gx_fieldcat-hotspot = 'X'.
APPEND gx_fieldcat TO gt_fieldcat.
CLEAR gx_fieldcat.
09-28-2007 12:48 PM
stripes,
declare like this,
data : wa_fieldcat type slis_fieldcat_alv.
wa_fieldcat-hotspot = 'X'.
append wa_fieldcat to gt_fieldcat.
09-28-2007 1:04 PM