This discussion is locked
5 Replies Latest reply: Feb 28, 2014 8:03 AM by Feiyun Wu RSS

Code for Hot spot in ALV report to call transaction

Currently Being Moderated

Hi,

I  hv never use hot spot to link as a call transaction can u give the link or code how to make hot spot on a particular fields  i am working on a ALV report in that report in the belnr coloumn when user click on belnr i want to call FB03 transaction ref. to that belnr number and fisacl year.

 

regards,

  zafar

  • Re: Code for Hot spot in ALV report to call transaction
    Sakshi Jain
    Currently Being Moderated

    hi,

    try the following code, i used it with kunnr to call transaction with the selected kunnr on hotspot click.

    fieldcatalog :

     WA_FCAT_HEADER-COL_POS   = 2.
      WA_FCAT_HEADER-FIELDNAME = 'KUNNR'.
      WA_FCAT_HEADER-TABNAME   = 'IT_POHEADER'.
      WA_FCAT_HEADER-COLTEXT   = TEXT-008.
      APPEND WA_FCAT_HEADER TO IT_FCAT_HEADER.
      CLEAR WA_FCAT_HEADER. 
    *---method implementation
    READ TABLE IT_POHEADER INDEX E_ROW_ID-INDEX INTO WA_POHEADER.
          IF WA_POHEADER-KUNNR IS NOT INITIAL.
            SET PARAMETER ID 'KUN' FIELD WA_POHEADER-KUNNR.
            CALL TRANSACTION 'XD03'.
          ENDIF. 

    hope it helps.

  • Re: Code for Hot spot in ALV report to call transaction
    Abhijit Borkar
    Currently Being Moderated

    Hi,

     

    In the fieldcatalog you will have to write the hotspot as shown below,

     

       wa_fieldcat-hotspot   =  'X'.

      APPEND wa_fieldcat TO it_fieldcat.

     

      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

          EXPORTING

            i_callback_program       = sy-repid

            i_callback_user_command  = 'USER_COMMAND'"----> this is important

    •      i_callback_pf_status_set = 'PFSTATUS'

            it_fieldcat              = it_fieldcat

            is_layout                = it_layout

    •      it_event_exit            = it_eventexit

    •      i_screen_start_column    = 10

    •      i_screen_start_line      = 20

    •      i_screen_end_column      = 70

      •      i_screen_end_line        = 45

            i_grid_title             = 'Customer-Order Details'

          TABLES

            t_outtab                 = it_data.

     

    then you will have to catch the user command as follows,

     

    FORM user_command USING r_ucomm TYPE sy-ucomm

                            rs_selfield TYPE slis_selfield.

     

      DATA: alv_vbeln TYPE vbeln,

            mess_text(30) TYPE c,

            txt_vbeln(10) TYPE c.

     

    *User clicks a Order No. in ALV it passed to the following transaction.

      CASE r_ucomm.

     

        WHEN '&IC1'.

          READ TABLE it_data INDEX rs_selfield-tabindex INTO wa_data.

          alv_vbeln  = wa_data-vbeln..

          IF sy-subrc = 0.

            CLEAR: mess_text, txt_vbeln.

     

            SUBMIT zprogram

             WITH pr_vbeln = alv_vbeln AND RETURN.

     

    put your call transaction logic here

     

          ENDIF.

      ENDCASE.

     

    ENDFORM.                    "user_command

     

    Hope it helps you,

    Regards,

    Abhijit G. Borkar

  • Re: Code for Hot spot in ALV report to call transaction
    Sujatha Galam
    Currently Being Moderated

    Hotspots are primarily used as follows:

    • Hierarchy: Hotspots help expand and collapse information for a hierarchy list, as needed.
    • Detail: In SAP, hotspots can provide functionality similar to Function key F2.
    • Hypertext links: Hotspots may be used to link the hypertexts in SAP programs

Actions