Skip to Content
author's profile photo Former Member
Former Member

Anyone know of an ALV report in SAP that has Hotspot logic?

Howdy,

Does Anyone know of an ALV report in SAP that has Hotspot logic?

I just need to implement this logic into my report and I thought I'd copy what was there.

Also, anyone know of a report where buttons are available in the cells of an ALV grid?

Thanksing you kindly.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 18, 2005 at 12:26 PM

    Hi Please execute the following code.

    this will help u.

    &----


    *& Report displaying an ALV GRID CONTROL which responds *

    *& to HOTSPOT click event *

    &----


    REPORT ZZ_ALV_GRID_RESPONDING_HOTSPOT_CLICK .

    TABLES : BKPF .

    DATA : I_BKPF TYPE STANDARD TABLE OF BKPF WITH HEADER LINE .

    DATA : MOK_CODE LIKE SY-UCOMM .

    DATA : OK_CODE LIKE SY-UCOMM .

    DATA : MM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER .

    DATA : MM_ALVGRID TYPE REF TO CL_GUI_ALV_GRID .

    DATA : CT_FIELDCAT TYPE STANDARD TABLE OF LVC_S_FCAT .

    DATA : WA_FIELDCAT LIKE LVC_S_FCAT .

    ----


    • CLASS RESPOND_EVENTS DEFINITION

    ----


    ----


    CLASS RESPOND_EVENTS DEFINITION .

    PUBLIC SECTION .

    METHODS : RESPOND_HOTSPOT_CLICK FOR EVENT

    HOTSPOT_CLICK OF

    CL_GUI_ALV_GRID IMPORTING E_ROW_ID

    E_COLUMN_ID

    ES_ROW_NO.

    ENDCLASS . "RESPOND_EVENTS DEFINITION

    ----


    • CLASS RESPOND_EVENTS IMPLEMENTATION

    ----


    ----


    CLASS RESPOND_EVENTS IMPLEMENTATION .

    METHOD RESPOND_HOTSPOT_CLICK .

    CLEAR BKPF .

    READ TABLE I_BKPF INDEX E_ROW_ID INTO BKPF .

    IF SY-SUBRC EQ 0 .

    SET PARAMETER ID 'BLN' FIELD BKPF-BELNR .

    SET PARAMETER ID 'BUK' FIELD BKPF-BUKRS .

    SET PARAMETER ID 'GJR' FIELD BKPF-GJAHR .

    CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN .

    ENDIF .

    ENDMETHOD . "RESPOND_HOTSPOT_CLICK

    ENDCLASS . "RESPOND_EVENTS IMPLEMENTATION

    DATA : I_RESPOND_EVENTS TYPE REF TO RESPOND_EVENTS .

    *=====================================================

    • SELECTION SCREEN - ( DEFAULT )

    *=====================================================

    SELECT-OPTIONS : S_BELNR FOR I_BKPF-BELNR OBLIGATORY.

    *=====================================================

    • START OF SELECTION

    *=====================================================

    START-OF-SELECTION .

    SELECT * FROM BKPF

    INTO CORRESPONDING FIELDS OF TABLE I_BKPF

    WHERE BELNR IN S_BELNR .

    *======================================================

    • END-OF-SELECTION .

    *======================================================

    END-OF-SELECTION .

    CALL SCREEN 100 .

    • ------------------------------------------------------

    • The screen 100 has a custom control named 'MCONTAINER'

    • and a command button with function code 'QUIT' .

    • Of course has an element called OK_CODE like sy-ucomm .

    • The flow logic of the screen has in the output section

    • the module PREPARE_OUTPUT ,

    • and in the input section the module USER_COMMAND_0100 .

    • ------------------------------------------------------

    &----


    *& Module USER_COMMAND_0100 INPUT

    &----


    ----


    MODULE USER_COMMAND_0100 INPUT.

    CLEAR : MOK_CODE .

    MOK_CODE = OK_CODE .

    CLEAR : OK_CODE .

    CASE MOK_CODE .

    WHEN 'QUIT' .

    LEAVE TO SCREEN 0 .

    ENDCASE .

    ENDMODULE. " USER_COMMAND_0100 INPUT

    &----


    *& Module OUTPUT OUTPUT

    &----


    • text

    ----


    MODULE PREPARE_OUTPUT OUTPUT .

    IF MM_CONTAINER IS INITIAL .

    CREATE OBJECT MM_CONTAINER

    EXPORTING CONTAINER_NAME = 'MCONTAINER' .

    CREATE OBJECT MM_ALVGRID

    EXPORTING I_PARENT = MM_CONTAINER .

    PERFORM CATALOG_CREATION .

    PERFORM SHOW_DATA .

    CREATE OBJECT I_RESPOND_EVENTS .

    SET HANDLER I_RESPOND_EVENTS->RESPOND_HOTSPOT_CLICK

    FOR MM_ALVGRID .

    ENDIF .

    ENDMODULE. " OUTPUT OUTPUT

    &----


    *& Form CATALOG_CREATION

    &----


    *

    FORM CATALOG_CREATION .

    call function 'LVC_FIELDCATALOG_MERGE'

    EXPORTING

    i_structure_name = 'BKPF'

    CHANGING

    ct_fieldcat = Ct_fieldcat.

    LOOP AT Ct_fieldcat INTO WA_fieldcat.

    IF ( WA_FIELDCAT-FIELDNAME NE 'BUKRS' )

    AND ( WA_FIELDCAT-FIELDNAME NE 'BELNR' )

    AND ( WA_FIELDCAT-FIELDNAME NE 'GJAHR' ) .

    WA_FIELDCAT-HOTSPOT = 'X' .

    MODIFY Ct_fieldcat FROM WA_fieldcat.

    ENDIF .

    ENDLOOP.

    DELETE Ct_fieldcat WHERE HOTSPOT = 'X' .

    LOOP AT Ct_fieldcat INTO WA_fieldcat.

    IF WA_FIELDCAT-FIELDNAME EQ 'BELNR' .

    WA_FIELDCAT-HOTSPOT = 'X' .

    MODIFY Ct_fieldcat FROM WA_fieldcat.

    ENDIF .

    ENDLOOP.

    ENDFORM. " CATALOG_CREATION

    &----


    *& Form SHOW_DATA

    &----


    FORM SHOW_DATA .

    CALL METHOD MM_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAY

    CHANGING

    IT_OUTTAB = I_BKPF[]

    IT_FIELDCATALOG = Ct_fieldcat[].

    ENDFORM. " SHOW_DATA

    Satish

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 18, 2005 at 11:29 AM

    Hi,

    You just need to set the field HOTSPOT = X

    in the fieldcatalog internal table.

    Thanks,

    Ramakrishna

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 18, 2005 at 11:50 AM

    Hi Steve,

    it'a a report with alv grid, where i use hot spot event,

    i hope it helps you.

    bye

    
    *&---------------------------------------------------------------------*
    *& Report  ZMONITOR_IP                                                 *
    *&                                                                     *
    *&---------------------------------------------------------------------*
    *&                                                                     *
    *&                                                                     *
    *&---------------------------------------------------------------------*
    
    REPORT  zmonitor_ip                             .
    
    TABLES: mapl, plko
    .
    *****SELECTION-SCREEN.
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_matnr  FOR mapl-matnr,
                    s_plnty  FOR mapl-plnty,
                    s_zaehl  FOR plko-zaehl,
                    s_verwe  FOR plko-verwe,
                    s_plnnr  FOR plko-plnnr,
                    s_plnal  FOR plko-plnal,
                    s_plnty2 FOR plko-plnty.
    
    SELECTION-SCREEN: END OF BLOCK b1.
    
    **********TYPES:
    TYPES: BEGIN OF str_data,
             matnr    TYPE mapl-matnr,
             werks    TYPE plko-werks,
             plnal    TYPE plko-plnal,
             plnnr    TYPE plko-plnnr,
           END OF str_data.
    
    TYPES: BEGIN OF str_data2,
            prueflos TYPE qals-prueflos,
            art      TYPE qals-art,
            herkunft TYPE qals-herkunft,
            enstehdat TYPE qals-enstehdat,
            END OF str_data2.
    
    ****Global data.
    DATA: tb_plko TYPE TABLE OF plko,
          wa_plko TYPE plko,
          tb_mapl TYPE TABLE OF mapl,
          wa_mapl TYPE TABLE OF mapl,
          tb_data TYPE TABLE OF str_data,
          wa_data TYPE str_data,
          pos1 TYPE i,
          pos2 TYPE i,
          pos3 TYPE i,
          pos4 TYPE i,
          pos5 TYPE i,
          okcode_100 TYPE sy-ucomm,
          tb_data2 TYPE TABLE OF str_data2.
    
    
    ***********************VARIABILI E STRUTTURE PER ALV********************
    
    *---------------------------------------------------------------------*
    *       CLASS lcl_event_handler DEFINITION
    *---------------------------------------------------------------------*
    *
    *---------------------------------------------------------------------*
    CLASS lcl_event_handler DEFINITION .
      PUBLIC SECTION .
        METHODS:
    *To add new functional buttons to the ALV toolbar
    *Hotspot click control
    handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
                         IMPORTING e_row_id e_column_id es_row_no,
    
    *Double-click control
    handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
                        IMPORTING e_row e_column es_row_no.
    ENDCLASS.                    "lcl_event_handler DEFINITION
    
    *---------------------------------------------------------------------*
    *       CLASS lcl_event_handler IMPLEMENTATION
    *---------------------------------------------------------------------*
    *
    *---------------------------------------------------------------------*
    CLASS lcl_event_handler IMPLEMENTATION.
      METHOD handle_hotspot_click.
    *Handle Hotspot Click METHOD handle_hotspot_click .
        PERFORM handle_hotspot_click USING e_row_id e_column_id es_row_no .
      ENDMETHOD .                    "lcl_event_handler
    
    *Handle Double Click
      METHOD handle_double_click .
    
        PERFORM handle_double_click USING e_row e_column es_row_no .
    
    
      ENDMETHOD .                    "handle_double_click
    ENDCLASS.                    "lcl_event_handler IMPLEMENTATION
    
    
    *--- ALV Grid instance reference
    DATA gr_alvgrid TYPE REF TO cl_gui_alv_grid.
    DATA gr_alvgrid2 TYPE REF TO cl_gui_alv_grid.
    
    
    *--- Name of the custom control added on the screen
    DATA gc_custom_control_name TYPE scrfname VALUE 'CC_ALV'.
    DATA gc_custom_control_name2 TYPE scrfname VALUE 'CC_ALV2'.
    
    
    *--- Customer contanier instance reference
    DATA gr_ccontainer TYPE REF TO cl_gui_custom_container.
    DATA gr_ccontainer2 TYPE REF TO cl_gui_custom_container.
    
    *--- Field catalog table
    DATA gt_fieldcat TYPE lvc_t_fcat.
    DATA gt_fieldcat2 TYPE lvc_t_fcat.
    
    *--- Layout structure
    DATA gs_layout TYPE lvc_s_layo.
    DATA gs_layout2 TYPE lvc_s_layo.
    
    
    DATA ls_variant       TYPE disvariant.
    DATA gr_event_handler TYPE REF TO lcl_event_handler .
    
    
    
    
    
    
    
    
    
    
    
    ****INITIALIZZATION
    INITIALIZATION.
    
      pos1 = 4.
      pos2 = pos1 + 20.
      pos3 = pos2 + 10.
      pos4 = pos3 + 10.
      pos5 = pos4 + 10.
    
    
    *****TOP OF PAGE
    TOP-OF-PAGE.
      WRITE AT /pos1 'Material'.
      WRITE AT pos2  'Plan'.
      WRITE AT pos3 'Group'.
      WRITE AT pos4 'Group Count'.
      SKIP 1.
    
    
    *****AT USER COMMAND.
    AT USER-COMMAND.
      CASE sy-ucomm.
        WHEN 'BACK'.
          SET SCREEN 0.
          LEAVE SCREEN.
      ENDCASE.
    
    AT LINE-SELECTION.
      PERFORM select_line.
    
    
    *****START-OF-SELECTION.
    START-OF-SELECTION.
    
      PERFORM select_data.
    
      PERFORM output.
    
    END-OF-SELECTION.
    ****END-OF-SELCTION.
    *&---------------------------------------------------------------------*
    *&      Form  select_data
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *  -->  p1        text
    *  <--  p2        text
    *----------------------------------------------------------------------*
    FORM select_data .
      SELECT   b~werks b~plnal b~plnnr a~matnr
               FROM plko AS b
               JOIN mapl AS a
               ON ( a~plnty = b~plnty AND
                   a~plnnr = b~plnnr AND
                   a~plnal = b~plnal )
               INTO CORRESPONDING FIELDS OF TABLE tb_data
               WHERE
                 a~matnr IN s_matnr  AND
                 a~plnty IN s_plnty  AND
                 b~zaehl IN s_zaehl  AND
                 b~verwe IN s_verwe  AND
                 b~plnnr IN s_plnnr  AND
                 b~plnal IN s_plnal  AND
                 b~plnty IN s_plnty2 .
    
    ENDFORM.                    " select_data
    *&---------------------------------------------------------------------*
    *&      Form  OUTPUT
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *  -->  p1        text
    *  <--  p2        text
    *----------------------------------------------------------------------*
    FORM output .
      CALL SCREEN '0100'.
    
    
    
    
    
    
    
    ENDFORM.                    " OUTPUT
    *&---------------------------------------------------------------------*
    *&      Form  SELECT_LINE
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *  -->  p1        text
    *  <--  p2        text
    *----------------------------------------------------------------------*
    FORM select_line .
      DATA line TYPE i.
      CLEAR wa_data.
      GET CURSOR LINE line.
      READ LINE line FIELD VALUE wa_data-matnr  INTO wa_data-matnr.
      READ LINE line FIELD VALUE wa_data-werks  INTO wa_data-werks.
      READ LINE line FIELD VALUE wa_data-plnnr  INTO wa_data-plnnr.
      READ LINE line FIELD VALUE wa_data-plnal  INTO wa_data-plnal.
    
    
    
    
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    
      SET PARAMETER ID 'MAT' FIELD wa_data-matnr.
      SET PARAMETER ID 'WRK' FIELD wa_data-werks.
      SET PARAMETER ID 'QHK' FIELD '89'.
      SET PARAMETER ID 'PLN' FIELD wa_data-plnnr.
      SET PARAMETER ID 'PAL' FIELD wa_data-plnal.
    
      CALL TRANSACTION 'QA01' AND SKIP FIRST SCREEN.
      SET PARAMETER ID 'PLN' FIELD ' '.
      SET PARAMETER ID 'PAL' FIELD ' '.
    ENDFORM.                    " SELECT_LINE
    
    
    *&--------------------------------------------------------------------*
    *&      Form  prepare_field_catalog
    *&--------------------------------------------------------------------*
    *       text
    *---------------------------------------------------------------------*
    *      -->PT_FIELDCATtext
    *---------------------------------------------------------------------*
    FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat .
      DATA ls_fcat TYPE lvc_s_fcat .
      ls_fcat-fieldname = 'MATNR' .
    *  ls_fcat-inttype = 'C' .
      ls_fcat-outputlen = '18' .
      ls_fcat-hotspot = 'X'.
      ls_fcat-coltext = 'Material' .
      ls_fcat-seltext = 'Material' .
      APPEND ls_fcat TO pt_fieldcat .
      CLEAR ls_fcat .
    
      ls_fcat-fieldname = 'WERKS' .
    *  ls_fcat-outputlen = '30' .
      ls_fcat-coltext = 'Plant' .
      ls_fcat-seltext = 'Plant' .
      APPEND ls_fcat TO pt_fieldcat .
      CLEAR ls_fcat .
    
    
      ls_fcat-fieldname = 'PLNNR' .
    *  ls_fcat-outputlen = '6' .
      ls_fcat-coltext = 'Orig. IP' .
      ls_fcat-seltext = 'Orig. IP' .
      APPEND ls_fcat TO pt_fieldcat .
      CLEAR ls_fcat .
    
      ls_fcat-fieldname = 'PLNAL' .
    *  ls_fcat-outputlen = '6' .
      ls_fcat-coltext = 'Orig. IP Conuter' .
      ls_fcat-seltext = 'Orig. IP Conuter' .
      APPEND ls_fcat TO pt_fieldcat .
      CLEAR ls_fcat .
    ENDFORM .                    "prepare_field_catalog
    *&--------------------------------------------------------------------*
    *&      Form  prepare_layout
    *&--------------------------------------------------------------------*
    *       text
    *---------------------------------------------------------------------*
    *      -->PS_LAYOUT  text
    *---------------------------------------------------------------------*
    FORM prepare_layout CHANGING ps_layout TYPE lvc_s_layo.
      ps_layout-zebra = 'X' .
      ps_layout-grid_title = '' .
      ps_layout-smalltitle = 'X' .
      ps_layout-sel_mode = 'B'.
    ENDFORM. " prepare_layout
    *&---------------------------------------------------------------------*
    *&      Module  DISPLAY  OUTPUT
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    MODULE display OUTPUT.
    
    
    
    ***ALV.
      IF gr_alvgrid IS INITIAL AND
         gr_alvgrid2 IS INITIAL.
    
    
    *----Creating custom container instance
        CREATE OBJECT gr_ccontainer
           EXPORTING
           container_name = gc_custom_control_name
           EXCEPTIONS
           cntl_error = 1
           cntl_system_error = 2
           create_error = 3
           lifetime_error = 4
           lifetime_dynpro_dynpro_link = 5
           OTHERS = 6 .
    
        CREATE OBJECT gr_ccontainer2
            EXPORTING
            container_name = gc_custom_control_name2
            EXCEPTIONS
            cntl_error = 1
            cntl_system_error = 2
            create_error = 3
            lifetime_error = 4
            lifetime_dynpro_dynpro_link = 5
            OTHERS = 6 .
    
    
    *----creating alv grid instance
        CREATE OBJECT gr_alvgrid
        EXPORTING
        i_parent = gr_ccontainer
        EXCEPTIONS
        error_cntl_create = 1
        error_cntl_init = 2
        error_cntl_link = 3
        error_dp_create = 4
        OTHERS = 5 .
    
    
    
        CREATE OBJECT gr_event_handler .
        SET HANDLER gr_event_handler->handle_hotspot_click FOR gr_alvgrid .
        SET HANDLER gr_event_handler->handle_double_click FOR gr_alvgrid .
    *----Preparing field catalog.
        PERFORM prepare_field_catalog CHANGING gt_fieldcat .
    
    *----Preparing layout structure
        PERFORM prepare_layout CHANGING gs_layout .
    
    *----Here will be additional preparations
    *--e.g. initial sorting criteria, initial filtering criteria, excluding
    *--functions
    
        CALL METHOD gr_alvgrid->set_table_for_first_display
        EXPORTING
    * I_BUFFER_ACTIVE =
    * I_CONSISTENCY_CHECK =
    * I_STRUCTURE_NAME =
     is_variant = ls_variant
     i_save = 'A'
    * I_DEFAULT = 'X'
        is_layout = gs_layout
    * IS_PRINT =
    * IT_SPECIAL_GROUPS =
    * IT_TOOLBAR_EXCLUDING =
    * IT_HYPERLINK =
        CHANGING
        it_outtab = tb_data
        it_fieldcatalog = gt_fieldcat
    * IT_SORT =
    * IT_FILTER =
        EXCEPTIONS
        invalid_parameter_combination = 1
        program_error = 2
        too_many_lines = 3
        OTHERS = 4 .
    
      ELSE .
        CALL METHOD gr_alvgrid->refresh_table_display
    * EXPORTING
    * IS_STABLE =
    * I_SOFT_REFRESH =
        EXCEPTIONS
        finished = 1
        OTHERS = 2 .
    
    
    
    
    
      ENDIF .
    
    
    
    
    ENDMODULE.                 " DISPLAY  OUTPUT
    *&---------------------------------------------------------------------*
    *&      Module  STATUS_0100  OUTPUT
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'MONITOR'.
    *  SET TITLEBAR 'xxx'.
    
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&---------------------------------------------------------------------*
    *&      Module  USER_COMMAND_0100  INPUT
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    MODULE user_command_0100 INPUT.
      CASE okcode_100.
        WHEN 'BACK'.
          SET SCREEN 0.
          LEAVE SCREEN.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    
    
    *&--------------------------------------------------------------------*
    *&      Form  handle_hotspot_click
    *&--------------------------------------------------------------------*
    *       text
    *---------------------------------------------------------------------*
    *      -->I_ROW_ID   text
    *      -->I_COLUMN_IDtext
    *      -->IS_ROW_NO  text
    *---------------------------------------------------------------------*
    FORM handle_hotspot_click USING i_row_id TYPE lvc_s_row
                                    i_column_id TYPE lvc_s_col
                                    is_row_no TYPE lvc_s_roid.
    
      READ TABLE tb_data INDEX is_row_no-row_id INTO wa_data.
    
      SELECT * FROM qals INTO CORRESPONDING FIELDS OF TABLE tb_data2
                WHERE selmatnr = wa_data-matnr AND
                      werk     = wa_data-werks .
    
    
    
      IF gr_alvgrid2 IS INITIAL.
        CREATE OBJECT gr_alvgrid2
      EXPORTING
      i_parent = gr_ccontainer2
      EXCEPTIONS
      error_cntl_create = 1
      error_cntl_init = 2
      error_cntl_link = 3
      error_dp_create = 4
      OTHERS = 5 .
    
    *----preparing field catalog.
        PERFORM prepare_field_catalog2 CHANGING gt_fieldcat2 .
    
    *----Preparing layout structure
        PERFORM prepare_layout CHANGING gs_layout2 .
    
    *----Here will be additional preparations
    *--e.g. initial sorting criteria, initial filtering criteria, excluding
    *--functions
    
        CALL METHOD gr_alvgrid2->set_table_for_first_display
        EXPORTING
    * I_BUFFER_ACTIVE =
    * I_CONSISTENCY_CHECK =
    * I_STRUCTURE_NAME =
     is_variant = ls_variant
     i_save = 'A'
    * I_DEFAULT = 'X'
        is_layout = gs_layout2
    * IS_PRINT =
    * IT_SPECIAL_GROUPS =
    * IT_TOOLBAR_EXCLUDING =
    * IT_HYPERLINK =
        CHANGING
        it_outtab = tb_data2
        it_fieldcatalog = gt_fieldcat2
    * IT_SORT =
    * IT_FILTER =
        EXCEPTIONS
        invalid_parameter_combination = 1
        program_error = 2
        too_many_lines = 3
        OTHERS = 4 .
    
    
    
    
      ELSE.
        CALL METHOD gr_alvgrid2->refresh_table_display
    * EXPORTING
    * IS_STABLE =
    * I_SOFT_REFRESH =
      EXCEPTIONS
      finished = 1
      OTHERS = 2 .
    
      ENDIF.
    *  call screen 100.
    ENDFORM .                    "handle_hotspot_click
    *&---------------------------------------------------------------------*
    *&      Form  prepare_field_catalog2
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *      <--P_GT_FIELDCAT2  text
    *----------------------------------------------------------------------*
    FORM prepare_field_catalog2 CHANGING pt_fieldcat TYPE lvc_t_fcat .
    
    
      DATA ls_fcat TYPE lvc_s_fcat .
    
      ls_fcat-fieldname = 'PRUEFLOS' .
      ls_fcat-outputlen = '23' .
      ls_fcat-coltext = 'Inspection Lot Number' .
      ls_fcat-seltext = 'Inspection Lot Number' .
      APPEND ls_fcat TO pt_fieldcat .
      CLEAR ls_fcat .
    
      ls_fcat-fieldname = 'ART' .
      ls_fcat-coltext = 'Inspection Type' .
      ls_fcat-seltext = 'Inspection Type' .
      APPEND ls_fcat TO pt_fieldcat .
      CLEAR ls_fcat .
    
    
      ls_fcat-fieldname = 'HERKUNFT' .
      ls_fcat-coltext = 'Inspection Lot Origin' .
      ls_fcat-seltext = 'Inspection Lot Origin' .
      APPEND ls_fcat TO pt_fieldcat .
      CLEAR ls_fcat .
    
    
      ls_fcat-fieldname = 'ENSTEHDAT' .
      ls_fcat-coltext = 'Date of Lot Creation' .
      ls_fcat-seltext = 'Date of Lot Creation' .
      APPEND ls_fcat TO pt_fieldcat .
      CLEAR ls_fcat .
    
    ENDFORM.                    " prepare_field_catalog2
    
    
    *&--------------------------------------------------------------------*
    *&      Form  handle_double_click
    *&--------------------------------------------------------------------*
    *       text
    *---------------------------------------------------------------------*
    *      -->I_ROW      text
    *      -->I_COLUMN   text
    *      -->IS_ROW_NO  text
    *---------------------------------------------------------------------*
    FORM handle_double_click USING i_row TYPE lvc_s_row
                                   i_column TYPE lvc_s_col
                                   is_row_no TYPE lvc_s_roid.
    
    
      CLEAR wa_data.
      READ TABLE tb_data INDEX i_row-index INTO wa_data.
    
      SET PARAMETER ID 'MAT' FIELD wa_data-matnr.
      SET PARAMETER ID 'WRK' FIELD wa_data-werks.
      SET PARAMETER ID 'QHK' FIELD '89'.
      SET PARAMETER ID 'PLN' FIELD wa_data-plnnr.
      SET PARAMETER ID 'PAL' FIELD wa_data-plnal.
    
      CALL TRANSACTION 'QA01' AND SKIP FIRST SCREEN.
      SET PARAMETER ID 'PLN' FIELD ' '.
      SET PARAMETER ID 'PAL' FIELD ' '.
    
    ENDFORM .                    "handle_double_click
    

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.