Skip to Content
author's profile photo
Former Member

fieldcatalog

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

7 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 11:40 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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>

  • author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 11:48 AM

    stripes,

    declare like this,

    data : wa_fieldcat type slis_fieldcat_alv.

    wa_fieldcat-hotspot = 'X'.

    append wa_fieldcat to gt_fieldcat.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 11:37 AM

    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>

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 11:37 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 28, 2007 at 11:40 AM

    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>

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 11:43 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 12:04 PM

    Thanks for everybody. I gave my points for the best posting 😊

    Add comment
    10|10000 characters needed characters exceeded