Need help on ALV Grid Control

Hi,
I have written a program to display the details of customer in ALV Grid. I have also added code to add a hyperlink to the field name - KTOKD of the table KNA1. It would be helpful if anyone could tell me what is wrong with the code. The list is correctly displayed but the hyperlink is not working.
tables kna1.
data: BEGIN OF itkna1 OCCURS 0,
         ktokd like kna1-ktokd,
         kunnr like kna1-kunnr,
         name1 like kna1-name1,
         name2 like kna1-name2,
         ktokd_hdl type int4,
      end of itkna1.
*creating an instance of grid
data it_custom_control_name type scrfname value 'C_C_ALV'.
data it_container type ref to cl_gui_custom_container.
data it_alvgrid type ref to cl_gui_alv_grid.
data it_lyo type lvc_s_layo.
data it_fcat type lvc_t_fcat.
data tmp_fcat like LINE OF it_fcat.
data it_hype type lvc_t_hype.
data tmp_hype type lvc_s_hype.
Selection-screen begin of block Enter_data with frame title text-001.
  PARAMETERS pktokd like KNA1-ktokd OBLIGATORY.
  SELECT-OPTIONS skunnr FOR KNA1-kunnr.
Selection-screen end of block Enter_data.
SELECT ktokd kunnr name1 name2
  FROM kna1 into CORRESPONDING FIELDS OF TABLE itkna1
       WHERE ktokd = pktokd AND kunnr IN skunnr.
*prepare field catalog
clear: it_fcat, tmp_fcat.
tmp_fcat-fieldname = 'KTOKD'.
tmp_fcat-ref_table = 'KNA1'.
tmp_fcat-ref_field = 'KTOKD'.
tmp_fcat-col_pos = '1'.
tmp_fcat-web_field = 'ktokd_hdl'.
append tmp_fcat to it_fcat.
tmp_fcat-fieldname = 'KUNNR'.
tmp_fcat-ref_table = 'KNA1'.
tmp_fcat-ref_field = 'KUNNR'.
tmp_fcat-col_pos = '2'.
append tmp_fcat to it_fcat.
tmp_fcat-fieldname = 'NAME1'.
tmp_fcat-ref_table = 'KNA1'.
tmp_fcat-ref_field = 'NAME1'.
tmp_fcat-col_pos = '3'.
append tmp_fcat to it_fcat.
tmp_fcat-fieldname = 'NAME2'.
tmp_fcat-ref_table = 'KNA1'.
tmp_fcat-ref_field = 'NAME2'.
tmp_fcat-col_pos = '4'.
append tmp_fcat to it_fcat.
data: c_lines type I, count type I.
DESCRIBE table itkna1 LINES c_lines.
loop at itkna1.
  count = count + 1.
  tmp_hype-handle = count.
  tmp_hype-href = itkna1-ktokd.
  APPEND tmp_hype to it_hype.
  itkna1-ktokd_hdl = count.
  MODIFY itkna1.
ENDLOOP.
*prepare layout
it_lyo-grid_title = 'Custormer details'.
call screen 200.
module status_0200 OUTPUT.
*creating an instance of container class
CREATE OBJECT it_container
    EXPORTING container_name = it_custom_control_name.
*creating an instance of the grid
create OBJECT it_alvgrid
    EXPORTING i_parent = it_container.
*displaying the grid
call METHOD it_alvgrid->set_table_for_first_display
   EXPORTING
     is_layout = it_lyo
     it_hyperlink = it_hype
   CHANGING
     it_outtab = itkna1[]
     it_fieldcatalog = it_fcat
   EXCEPTIONS
     invalid_parameter_combination = 1
     others = 2.
ENDMODULE.

Try this..
give the field name in CAPITAL LETTERS..
*prepare field catalog
clear: it_fcat, tmp_fcat.
tmp_fcat-fieldname = 'KTOKD'.
tmp_fcat-ref_table = 'KNA1'.
tmp_fcat-ref_field = 'KTOKD'.
tmp_fcat-col_pos = '1'.
tmp_fcat-web_field =<b> 'KTOKD_HDL'.</b>
REGARDS,
SAI RAMESH

Similar Messages

  • F4 help in ALV Grid Control (using classes)

    Hi All,
        I have created a report using ALV Grid control (using classes). I need to provide F4 help for some of the fields in the Grid control.  I couldn't understand the standard demo program BCALV_GRID_F4_HELP. So Can anyone please provide me sample code for the same.
    Regards
    Jaker.

    hi check this..programs also
    BCALV_GRID_EDIT_DELTA
    BCALV_TEST_GRID_F4_HELP
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/how%2bto%2bimplement%2bf4%2bsearch%2bhelp%2bin%2boo%2balv%2bgrid
    Struggling with f4 handling in ALV grid - Minisap 46D
    regards,
    venkat

  • Need help with ALV Grid

    Hi,
    I am displaying Header and Item details in an ALV Grid. The first row will be having Header info and the next rows contains Item Details. I want to hide some of the columns of the first record only. The titles and the Item Details should remain same.
    Can any body help me.
    Regards,
    Srinivas

    Hello,
    That cannot be done as you are displaying the header and item level data together. Let the fields you do not want to display be blank while you display.
    Hope it helps.
    Thanks,
    Jayant

  • Need help in alv grid output

    Hi ihave a problem in alv grid i want display the longtext which was very long in characters it contains of more than 20 lines as shown below now i want the output the material number and shorttext description only one time but not as many times as there are lines in the long text that is i want to delete the remaining short text and material number for a single material number.
    I'm posting here my ALv grid code also pla consider it and give me solution
    FORM field_catalog.
    ***MATERIAL NO no
      int_cat-tabname       = 'INT_OUT'.
      int_cat-fieldname     = 'MATNR'.
      int_cat-reptext_ddic  = 'MATERIAL NO'.
      APPEND int_cat .
    *vender name
      int_cat-tabname       = 'INT_OUT'.
      int_cat-fieldname     = 'MAKTX'.
      int_cat-reptext_ddic  = 'MATERIAL SHORT DESCRIPTION'.
      APPEND int_cat .
    ** PO No
      int_cat-tabname       = 'INT_OUT'.
      int_cat-fieldname     = 'TDLINE'.
      int_cat-reptext_ddic  = 'MATERIAL LONG DESCRIPTION'.
      int_cat-outputlen = '100'.
      APPEND int_cat .
    endform.
    *&      Form  display_data
    *       text
    FORM display_data.
    DATA : X_SORT TYPE SLIS_SORTINFO_ALV.
    DATA: IT_SORT TYPE SLIS_T_SORTINFO_ALV.
    X_SORT-SPOS = '1'.
    X_SORT-FIELDNAME = 'MATNR'.
    X_SORT-TABNAME = 'INT_OUT'.
    X_SORT-UP = 'X'.
    APPEND X_SORT TO IT_SORT.
    CLEAR X_SORT.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program = sy-repid
          it_fieldcat        = int_cat[]
    *      I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
    *      I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    **      IS_LAYOUT = X_LAYOUT
    **      IT_FIELDCAT = IT_FIELDCAT
    **      IT_EVENTS = IT_EVENT
    *      IT_SORT = INT_OUT
        TABLES
          t_outtab           = int_out
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
    ENDFORM.                    "display_data
    <b>
    1000100000 Test material 1 1. DataSet vs DataReader
    1000100000 Test material 1 # DataReader
    1000100000 Test material 1 # Object to access data in a connected, forward-only, read-only
    1000100000 Test material 1 fashion
    1000100000 Test material 1
    1000100000 Test material 1 # DataSet
    1000100000 Test material 1 # Data structure to store schema and data in a disconnected fashion
    1000100000 Test material 1 # Useful for editing data offline and later update to data source
    1000100000 Test material 1
    1000100000 Test material 1 2. What is Microsoft .NET?
    1000100000 Test material 1 .NET represents an advanced new generation of software that will
    1000100000 Test material 1 drive the Next Generation Internet. Its purpose is to make information
    1000100000 Test material 1 available any time, any place, and on any device.
    1000100000 Test material 1 Quick Definition
    1000100000 Test material 1 .NET is an initiative to integrate all Microsoft products with
    1000100000 Test material 1 the #Next Generation# web.
    1000100000 Test material 1
    1000100000 Test material 1 3. Recordset
    1000100000 Test material 1
    1000100000 Test material 1 ? Recordsets are generated one per table. This does not support
    1000100000 Test material 1 hierarchical structure of data access. It will be programmer#s
    1000100000 Test material 1 responsibility to define relationships among different recordsets.
    1000100000 Test material 1 ? Rercordsets can not support data accessing from multiple sources.
    1000100000 Test material 1
    1000100000 Test material 1
    1000100000 Test material 1 4. Connection-oriented Vs Connection-less
    1000100000 Test material 1 ? Connection-oriented
    1000100000 Test material 1 # Keeps the connection to the data base alive
    1000100000 Test material 1 # Intended for applications with:
    1000100000 Test material 1 ? short running transactions
    1000100000 Test material 1 ? only a few parallel accesses
    1000100000 Test material 1 ? up-to-date data
    1000100000 Test material 1
    1000100000 Test material 1 ? Connectionless</b>

    hi shiaba
    i have allredy done like this but same out put is coming as per earlier.
    i want to delete material No and short description  only in one line not all line
    if long description is 50 line
    out ut is coming like this
    MATERIAL NO MATERIAL SHORT DESCRIPTION MATERIAL LONG DESCRIPTION
    1000100000  Test material 1            1.   DataSet vs DataReader
    1000100000  Test material 1            # DataReader
    1000100000  Test material 1            # Object to access data in a connected, forward-only, read-only
    1000100000  Test material 1            fashion
    1000100000  Test material 1
    1000100000  Test material 1            # DataSet
    1000100000  Test material 1            # Data structure to store schema and data in a disconnected fash
    1000100000  Test material 1            # Useful for editing data offline and later update to data sourc
    1000100000  Test material 1
    1000100000  Test material 1            2. What is Microsoft .NET?
    1000100000  Test material 1              .NET represents an advanced new generation of software that wi
    1000100000  Test material 1            drive the Next Generation Internet.  Its purpose is to make info
    1000100000  Test material 1            available any time, any place, and on any device.
    1000100000  Test material 1              Quick Definition
    1000100000  Test material 1              .NET is an initiative to integrate all Microsoft products with
    1000100000  Test material 1            the #Next Generation# web.
    but i want like below
    MATERIAL NO     MATERIAL SHORT DESCRIPTION     MATERIAL LONG DESCRIPTION
    1000100000     Test material 1     1.   DataSet vs DataReader
    DataReader
    Object to access data in a connected, forward-only, read-          fashion
    DataSet
    Data structure to store schema and data in a        
              2. What is Microsoft .NET?
              .NET represents an advanced new generation of software           drive the Next Generation Internet.  Its purpose is to make           available any time, any place, and on any device.
              Quick Definition
              .NET is an initiative to integrate all Microsoft products with
              the #Next Generation# web.
    thanks .

  • Need help in ALV grid editable cells

    Hi,
    I have created a ALV Grid program in which i made certain cells as editable cells.Now my question is if suppose i have 2 rows in my output then if i change the 2nd rows some cells, then some calculation has to perform till this it is fine but nw i want to modify the 3rd rows some cells as per the changes in 2nd row.
    How to do it with ALV oops concepts.
    I have refered BCALV_EDIT_02 and BCALV_EDIT_03 these std programs.
    Thanks & Regards
    Madhuri

    Hello Madhuri
    I recommend to do any post-processing of the changed data OUTSIDE your event handler method (HANDLE_DATA_CHANGED).
    Within the event handler method do all required validations and the trigger PAI by calling method CL_GUI_CFW=>SET_NEW_OK_CODE (for an example refer to my sample report ZUS_SDN_TWO_ALV_GRIDS in alv)
    Now at PAI of your screen you can do any kind of post-processing, calculation, etc. within the itab used for the ALV list.
    Regards
      Uwe

  • I need model program for alv grid control

    hi all,
    i need example program and detailed description of alv grid control . what is the features of alv grid control over normal alv.

    Hi,
    Check out the below sample code.I have pasted even the include programs, u can copy the program.
    SAP-User       : BWR2KOR                                             *
    Author (name)  : Bharadwaja R                                        *
    Created on/in  : 07.02.2006                                          *
    Description    : Report for Listing IDOC-Informations for the given  *
                     segment on the selection screen                     *
    Changes:       - for each change: add chapter                        *
                   - changes get a changes number (ascending)            *
                   - source code has to be marked with SAP-user-name     *
                     change date and number                              *
    Change number       :                                                *
    Enhance/Change numer: 90xxxx    (900001-909999) -> /RB11/YBF_MODIF   *
    SAP-User            :                                                *
    Author (name)       :                                                *
    Created on/in       :                                                *
    Reason for the change:                                               *
    REPORT Y16S_VIEW_IDOC_CONTENT  LINE-SIZE 230
                                   NO STANDARD PAGE HEADING.
    Data declarations
    INCLUDE Y16S_VIEW_IDOC_CONTENT_D01I.
    Selection screen
    INCLUDE Y16S_VIEW_IDOC_CONTENT_S01I.
    Events
    INCLUDE Y16S_VIEW_IDOC_CONTENT_E01I.
    Routines for program
    INCLUDE Y16S_VIEW_IDOC_CONTENT_F01I.
    START-OF-SELECTION.
    Get the fieldcatalog
    PERFORM get_fcat.
    **Method for getting the reference for the structure
    CALL METHOD cl_alv_table_create=>create_dynamic_table
                EXPORTING it_fieldcatalog = g_t_fieldcat
                IMPORTING ep_table = dref.
    **Passing the reference of the structure to field-symbol of type table
    ASSIGN dref->* TO .
    Fill IDoc data
    PERFORM fill_data.
    Display ALV
    perform display_grid.
      INCLUDE Y16S_VIEW_IDOC_CONTENT_D01I                                *
    Data declaration : Tables used                                       *
    TABLES : edidd,           "Data record (IDoc)
             edidc,           "Control record (IDoc)
             edid4,           "IDoc Data Records from 4.0 onwards
             dd03d,           "Dynpro fields for table fields
             edsappl,         "EDI: IDoc Segment Application Structure
             int_seg,         "Data record details display
             dd03l,           "Table Fields
             edisegment.      "IDoc Development : IDoc Segment
    Name of segment
    DATA : g_f_segment LIKE dntab-tabname.
    *--Data Declaration.
    FIELD-SYMBOLS :  TYPE ANY.
    DATA : BEGIN OF g_t_edid OCCURS 0,
            docnum LIKE edid4-docnum,
            segnum  LIKE edid4-segnum,
            sdata   LIKE edid4-sdata,
          END OF g_t_edid.
    *DATA : g_t_edid LIKE edid4 OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF g_t_edidc OCCURS 0,
            docnum  LIKE edidc-docnum,
            credat  LIKE edidc-credat,
            mestyp  LIKE edidc-mestyp,
          END OF g_t_edidc.
    DATA : BEGIN OF g_t_appl OCCURS 0,
            fieldname  LIKE edsappl-fieldname,
           END OF g_t_appl.
    DATA : g_v_tabix LIKE sy-tabix.
    ALV Declarations
    *Declaration of type groups
    TYPE-POOLS :
       slis.                    "Globale Typen für generische Listbausteine
    DATA: g_f_okcode LIKE sy-ucomm,
          g_container TYPE scrfname VALUE 'G_C_ALV',
          grid1  TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container.
    FIELD-SYMBOLS: .
    Class
    CLASS: g_cl_event DEFINITION DEFERRED.
    Alv Grid Constants
    DATA : g_c_handle(4) TYPE c VALUE '0100',
           g_c_save(1) TYPE c VALUE 'A',
           g_c_exit(4) TYPE c VALUE 'EXIT'.
    DATA:  g_v_layout  TYPE lvc_s_layo,
           g_f_print   TYPE lvc_s_prnt,
           g_f_variant TYPE disvariant,
           g_v_recv    TYPE REF TO g_cl_event.
    CONSTANTS : gc_ucomm_sel_criteria(12)        VALUE 'SEL_CRITERIA'.
          CLASS G_Cl_EVENT DEFINITION
          Class to handle GRID Events                                   *
    CLASS g_cl_event DEFINITION.
      PUBLIC SECTION.
        METHODS:
         constructor IMPORTING value(grid_name) TYPE REF TO
             cl_gui_alv_grid,
        handle_toolbar
              FOR EVENT toolbar OF cl_gui_alv_grid
                IMPORTING e_object e_interactive,
        handle_user_command
              FOR EVENT user_command OF cl_gui_alv_grid
                  IMPORTING e_ucomm.
      PRIVATE SECTION.
        DATA: g_v_alv TYPE REF TO cl_gui_alv_grid.
    ENDCLASS.                    "g_cl_event DEFINITION
          CLASS g_cl_events IMPLEMENTATION
          Class to handle GRID Events                                   *
    CLASS g_cl_event IMPLEMENTATION.
    Handling methods
      METHOD constructor.
        g_v_alv = grid_name.
      ENDMETHOD.                    "constructor
    Tool bar
      METHOD handle_toolbar.
        CONSTANTS:
          lc_quickinfo_sel_criteria(111) VALUE 'Show Selection Criteria'.
        DATA:
          l_toolbar            TYPE stb_button.
        CLEAR l_toolbar.
        MOVE 0                          TO l_toolbar-butn_type.
        MOVE gc_ucomm_sel_criteria      TO l_toolbar-function.
        MOVE icon_select_with_condition TO l_toolbar-icon.
        MOVE lc_quickinfo_sel_criteria  TO l_toolbar-quickinfo.
        MOVE space                      TO l_toolbar-disabled.
        APPEND l_toolbar                TO e_object->mt_toolbar.
      ENDMETHOD.                    "handle_toolbar
    User Command
      METHOD handle_user_command.
        CASE e_ucomm.
    When Exit button is used
          WHEN 'EXIT'.
            PERFORM exit_program.
          WHEN OTHERS.
        ENDCASE.
      ENDMETHOD.                    "handle_user_command
    ENDCLASS.                    "g_cl_event IMPLEMENTATION
      INCLUDE Y16S_VIEW_IDOC_CONTENT_S01I                                *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    Creation Date of IDoc
    SELECT-OPTIONS : s_date FOR  edidc-credat.
    IDoc Number
    SELECT-OPTIONS : s_idocnm FOR edidc-docnum.
    Basic IDoc type
    SELECT-OPTIONS : s_idoctp FOR edidc-idoctp.
    *Message type
    SELECT-OPTIONS : s_mestyp  FOR edidc-mestyp.
    Segment name
    PARAMETERS : p_segnam LIKE edisegment-segtyp OBLIGATORY.
    Field name
    SELECT-OPTIONS : s_fldnam FOR dd03d-fieldname NO INTERVALS.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
    Field name
    PARAMETERS : p_fldnam LIKE dd03d-fieldname.
    Field contents of a field of an IDoc segment
    SELECT-OPTIONS : s_fldval FOR int_seg-string.
    SELECTION-SCREEN END OF BLOCK b2.
      INCLUDE Y16S_VIEW_IDOC_CONTENT_E01I                                *
    Check for IDoc number on selection screen
    AT SELECTION-SCREEN ON s_idocnm.
      IF NOT s_idocnm IS INITIAL.
    Data fetch : Control record (IDoc)
        SELECT COUNT( * ) FROM edidc
                     WHERE docnum IN s_idocnm.
        IF sy-subrc NE 0.
          MESSAGE e429(mo).
        ENDIF.
      ELSE.
    message for required entry.
        MESSAGE e055(00).
      ENDIF.
    Check for segment name on selection screen
    AT SELECTION-SCREEN ON p_segnam.
    Check segment name is an input on selection screen
      IF NOT p_segnam IS INITIAL.
    Data fetch : Table Fields
        SELECT SINGLE  *  FROM dd03l
                       WHERE tabname EQ p_segnam.
        IF sy-subrc NE 0.
          MESSAGE e429(mo).
        ENDIF.
      ENDIF.
    F4 help for fieldname
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_fldnam-low.
      DATA : l_rc LIKE sy-subrc.
    Check segment name on selection screen is not empty
      IF NOT p_segnam IS INITIAL.
        PERFORM get_f4help USING l_rc.
        IF l_rc = 0.
    Fill the selected field name
          READ TABLE g_t_appl INDEX g_v_tabix.
          CHECK sy-subrc = 0.
          s_fldnam-low = g_t_appl-fieldname.
          s_fldnam-sign = 'I'.
          s_fldnam-option = 'EQ'.
          APPEND s_fldnam.
        ENDIF.
      ENDIF.
    Check for field name on selection screen
    AT SELECTION-SCREEN ON s_fldnam.
      IF NOT p_fldnam IS INITIAL.
    Data fetch : Table Fields
        SELECT SINGLE  *  FROM dd03l
                     WHERE tabname   EQ p_segnam
                     AND   fieldname IN s_fldnam.
        IF sy-subrc NE 0.
          MESSAGE e429(mo).
        ENDIF.
      ENDIF.
    F4 help for fieldname
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fldnam.
      DATA : l_rc LIKE sy-subrc.
    Check segment name on selection screen is not empty
      IF NOT p_segnam IS INITIAL.
    F4 Help for fieldname
        PERFORM get_f4help USING l_rc.
        IF l_rc = 0.
    Fill the selected field name
          READ TABLE g_t_appl INDEX g_v_tabix.
          CHECK sy-subrc = 0.
          p_fldnam = g_t_appl-fieldname.
        ENDIF.
      ENDIF.
    Check for field name on selection screen
    AT SELECTION-SCREEN ON p_fldnam.
      IF NOT p_fldnam IS INITIAL.
    Data fetch : Table Fields
        SELECT SINGLE  *  FROM dd03l
                     WHERE tabname   EQ p_segnam
                     AND   fieldname EQ p_fldnam.
        IF sy-subrc NE 0.
          MESSAGE e429(mo).
        ENDIF.
      ENDIF.
    Check for field name on selection screen
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_fldval-low.
    Check field name is an input on selection screen
      IF NOT p_fldnam IS INITIAL.
    Get the domain values as F4 help
        PERFORM get_domain_value.
      ENDIF.
    *Check for Message type on selection screen
    AT SELECTION-SCREEN ON s_mestyp.
      IF NOT s_mestyp IS INITIAL.
    Data fetch : Logical message types
        SELECT COUNT( * ) FROM edmsg
                     WHERE msgtyp IN s_mestyp.
        IF sy-subrc NE 0.
          MESSAGE e429(mo).
        ENDIF.
      ENDIF.
    *Check for Basic type on selection screen
    AT SELECTION-SCREEN ON s_idoctp.
      IF NOT s_idoctp IS INITIAL.
    Data fetch : Basic types
        SELECT COUNT( * ) FROM edbas
                     WHERE idoctyp IN s_idoctp.
        IF sy-subrc NE 0.
          MESSAGE e429(mo).
        ENDIF.
      ENDIF.
    *&      Form  GET_F4HELP
          text
         -->P_L_RC  text
    FORM get_f4help USING    p_l_rc LIKE sy-subrc.
      DATA : l_v_segment LIKE edsappl-segtyp.
      DATA : l_t_help_value LIKE help_value OCCURS 0 WITH HEADER LINE.
    Segment name
      l_v_segment = p_segnam.
    Data fetch : EDI: IDoc Segment Application Structure
      SELECT pos fieldname FROM edsappl
                       INTO CORRESPONDING FIELDS OF TABLE g_t_appl
                       WHERE segtyp = l_v_segment
                       ORDER BY pos.
    Popup having data
      CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
           EXPORTING
                endpos_col   = 110
                endpos_row   = 16
                startpos_col = 90
                startpos_row = 1
                titletext    = text-001
           IMPORTING
                choise       = g_v_tabix
           TABLES
                valuetab     = g_t_appl
           EXCEPTIONS
                break_off    = 1
                OTHERS       = 2.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Return code
      p_l_rc = sy-subrc.
    ENDFORM.                    " GET_F4HELP
    *&      Form  GET_DOMAIN_VALUE
          text
         -->P_L_RC  text
    FORM get_domain_value.
    DD: Domain header with text
      DATA : l_s_dd01v LIKE dd01v.
    Value table
      DATA : l_v_valuetab LIKE l_s_dd01v-entitytab.
    RFC Table Read: Description of Fields to Retrieve
      DATA : l_t_db_fld LIKE rfc_db_fld OCCURS 0 WITH HEADER LINE.
    RFC Table Read: Select Options / WHERE Clause
      DATA : l_t_options LIKE rfc_db_opt OCCURS 0 WITH HEADER LINE.
    Table with a 512 byte field
      DATA : l_t_valuetab  LIKE tab512 OCCURS 0 WITH HEADER LINE.
    *Data Dictionary access routines
      CALL FUNCTION 'G_DOMAIN_READ'
           EXPORTING
                domain      = p_fldnam
                langu       = sy-langu
           IMPORTING
                domain_attr = l_s_dd01v
           EXCEPTIONS
                not_found   = 1
                OTHERS      = 2.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      l_v_valuetab = l_s_dd01v-entitytab.
      l_t_db_fld-fieldname = p_fldnam.
      APPEND l_t_db_fld.
    External access to R/3 tables via RFC
      CALL FUNCTION 'RFC_READ_TABLE'
           EXPORTING
                query_table          =  l_v_valuetab
            DELIMITER            = ' '
            NO_DATA              = ' '
            ROWSKIPS             = 0
            ROWCOUNT             = 0
           TABLES
                options              = l_t_options
                fields               = l_t_db_fld
                data                 = l_t_valuetab
          EXCEPTIONS
               table_not_available  = 1
               table_without_data   = 2
               option_not_valid     = 3
               field_not_valid      = 4
               not_authorized       = 5
               data_buffer_exceeded = 6
               OTHERS               = 7
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CLEAR g_v_tabix.
      IF NOT l_t_valuetab[] IS INITIAL.
    Popup having data
        CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
             EXPORTING
                  endpos_col   = 110
                  endpos_row   = 16
                  startpos_col = 90
                  startpos_row = 1
                  titletext    = text-001
             IMPORTING
                  choise       = g_v_tabix
             TABLES
                  valuetab     = l_t_valuetab
             EXCEPTIONS
                  break_off    = 1
                  OTHERS       = 2.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        READ TABLE l_t_valuetab INDEX g_v_tabix.
        CHECK sy-subrc = 0.
    Fill the select-options of Fieldvalue
        s_fldval-low = l_t_valuetab-wa.
        s_fldval-sign = 'I'.
        s_fldval-option = 'EQ'.
        APPEND s_fldval.
      ENDIF.
    ENDFORM.                    " GET_DOMAIN_VALUE
      INCLUDE Y16S_VIEW_IDOC_CONTENT_F01I                                *
    *&      Module  STATUS_0100  OUTPUT
          ALV grid output
    MODULE status_0100 OUTPUT.
    *set the screen elements
      SET PF-STATUS 'MAIN100'.
      SET TITLEBAR 'TITLE100'.
    *instantiation
      IF g_custom_container IS INITIAL.
        g_v_layout-zebra  =  'X'.
        g_v_layout-sel_mode  =  'A'.
    Create custom container
        CREATE OBJECT g_custom_container
                EXPORTING  container_name = g_container.
    Create ALV grid
        CREATE OBJECT grid1
               EXPORTING  i_parent = g_custom_container.
        CREATE OBJECT g_v_recv EXPORTING grid_name = grid1.
    Display ALV grid
        CALL METHOD grid1->set_table_for_first_display
          EXPORTING
            i_save          = g_c_save
            is_layout       = g_v_layout
            is_print        = g_f_print
            is_variant      = g_f_variant
          CHANGING
            it_fieldcatalog = g_t_fieldcat
            it_outtab       = refresh_table_display.
      ENDIF.
    User command
      SET HANDLER g_v_recv->handle_user_command FOR grid1.
      CALL METHOD grid1->set_toolbar_interactive.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          User actions on grid
    MODULE user_command_0100 INPUT.
    Dispatch the okcode
      CALL METHOD cl_gui_cfw=>dispatch.
      CASE g_f_okcode.
        WHEN g_c_exit.
          PERFORM exit_program.
        WHEN OTHERS.
    *do nothing
      ENDCASE.
      CLEAR g_f_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  EXIT_PROGRAM
         Exit from the Grid
    -->  p1        text
    <--  p2        text
    FORM exit_program.
    Container for Custom Controls in the Screen Area
      CALL METHOD g_custom_container->free.
    *Control Framework Basic Class
      CALL METHOD cl_gui_cfw=>flush.
    Call the selection screen
      SET SCREEN 0.
      LEAVE SCREEN.
    ENDFORM.                    " EXIT_PROGRAM
    *&      Form  GET_FCAT
         Field catalog fill
    -->  p1        text
    <--  p2        text
    FORM get_fcat.
    *Segment details regarding fields
      PERFORM get_segment_details.
    Populate the Fieldcatalog
      PERFORM fill_fieldcat.
      IF g_f_variant-variant IS INITIAL.
    Get the default variant
        g_f_repid = sy-repid.
        CLEAR : g_f_variant.
        g_f_variant-report = g_f_repid.
        g_r_x_variant = g_f_variant.
    Get default variant
        CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
             EXPORTING
                  i_save     = g_c_save
             CHANGING
                  cs_variant = g_r_x_variant
             EXCEPTIONS
                  not_found  = 2.
        g_f_variant = g_r_x_variant.
        g_f_variant-variant = 'X'.
      ENDIF.
    ENDFORM.                    " GET_FCAT
    *&      Form  FILL_DATA
         Fill the output internal table
    -->  p1        text
    <--  p2        text
    FORM fill_data.
      FIELD-SYMBOLS  TYPE ANY.
      DATA : l_rc LIKE sy-subrc.
    *Get the IDoc data
      PERFORM get_data.
      LOOP AT g_t_edid.
    *Check for filtering the values
        IF ( NOT ( p_fldnam IS INITIAL AND s_fldval[] IS INITIAL ) ).
    Field value check
          PERFORM check_fieldvalue USING l_rc.
          IF l_rc NE 0.
            CONTINUE.
          ENDIF.
        ENDIF.
        ASSIGN LOCAL COPY OF g_t_edid TO .
      ENDLOOP.
    ENDFORM.                    " FILL_DATA
    *&      Form  DISPLAY_GRID
          Display ALV grid
    -->  p1        text
    <--  p2        text
    FORM display_grid.
    Call ALV grid
      CALL SCREEN 100.
    ENDFORM.                    " DISPLAY_GRID
    *&      Form  CHECK_FIELDVALUE
          Check the fieldvalue
         -->P_L_RC  text
    FORM check_fieldvalue USING    p_l_rc LIKE sy-subrc.
    Segment data
      ASSIGN g_t_edid-sdata TO  CASTING TYPE (p_segnam).
    Segment fields
      LOOP AT g_t_segment WHERE fieldname = p_fldnam.
        ASSIGN COMPONENT g_t_segment-fieldname
                         OF STRUCTURE  IN s_fldval.
          p_l_rc = 0.
        ELSE.
          p_l_rc = 4.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " CHECK_FIELDVALUE
    *&      Form  GET_DATA
        Get the IDoc data
    -->  p1        text
    <--  p2        text
    FORM get_data.
    *Clear the header line of the internal table
      CLEAR   : g_t_edid,
                g_t_edidc.
    Clear the body of the internal table
      REFRESH : g_t_edid,
                g_t_edidc.
    *Data fetch : Control record (IDoc)
      SELECT docnum credat mestyp FROM edidc
                                  INTO TABLE g_t_edidc
                                  WHERE docnum IN s_idocnm AND
                                        credat IN s_date   AND
                                        mestyp IN s_mestyp AND
                                        idoctp IN s_idoctp.
    *Date/Message type if not initial
      IF (  ( NOT ( s_date[] IS INITIAL ) )
         OR ( NOT ( s_mestyp[] IS INITIAL ) )
         OR ( NOT ( s_idoctp[] IS INITIAL ) ) ).
    Check the control record of the IDoc
        PERFORM check_control_data.
      ELSE.
    Data fetch : IDoc Data Records from 4.0 onwards
        SELECT docnum segnum sdata FROM edid4 INTO TABLE g_t_edid
                                   WHERE docnum IN s_idocnm AND
                                         segnam EQ p_segnam.
      ENDIF.
    ENDFORM.                    " GET_DATA
    *&      Form  CHECK_CONTROL_DATA
        Check the control data of IDoc
    -->  p1        text
    <--  p2        text
    FORM check_control_data.
      CHECK NOT g_t_edidc[] IS INITIAL.
    Data fetch : IDoc Data Records from 4.0 onwards
      SELECT docnum segnum sdata FROM edid4 INTO TABLE g_t_edid
                                 WHERE docnum IN s_idocnm AND
                                       segnam EQ p_segnam.
      LOOP AT g_t_edid.
        READ TABLE g_t_edidc WITH KEY docnum = g_t_edid-docnum.
    *Check for the correct MT
        IF sy-subrc = 0.
          CONTINUE.
        ELSE.
    *Delete, if unsuccessful
          DELETE g_t_edid.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " CHECK_CONTROL_DATA
    *&      Form  GET_SEGMENT_DETAILS
        Segment details regarding fields
    -->  p1        text
    <--  p2        text
    FORM get_segment_details.
    Segment name
      g_f_segment = p_segnam.
      CALL FUNCTION 'NAMETAB_GET'
           EXPORTING
             langu               = sy-langu
                tabname             = g_f_segment
           TABLES
                nametab             = g_t_segment
           EXCEPTIONS
                internal_error      = 1
                table_has_no_fields = 2
                table_not_activ     = 3
                no_texts_found      = 4
                OTHERS              = 5.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " GET_SEGMENT_DETAILS
    *&      Form  FILL_FIELDCAT
        Populate the Fieldcatalog
    -->  p1        text
    <--  p2        text
    FORM fill_fieldcat.
      DATA : lv_pos TYPE i.
    IDoc number in the catalog
      lv_pos = 1.
      g_r_fieldcat-fieldname = 'DOCNUM'.
      g_r_fieldcat-ref_table = 'EDID4'.
      g_r_fieldcat-ref_field = 'DOCNUM'.
      g_r_fieldcat-key       =  'X'.
      g_r_fieldcat-col_pos   =  lv_pos.
      g_r_fieldcat-outputlen =  '10'.
      APPEND g_r_fieldcat TO g_t_fieldcat.
    Segment number in the catalog
      ADD 1 TO lv_pos.
      g_r_fieldcat-fieldname = 'SEGNUM'.
      g_r_fieldcat-ref_table = 'EDID4'.
      g_r_fieldcat-ref_field = 'SEGNUM'.
      g_r_fieldcat-key       =  'X'.
      g_r_fieldcat-col_pos   =  lv_pos.
      g_r_fieldcat-outputlen =  '10'.
      g_r_fieldcat-colddictxt = 'X'.
    g_r_fieldcat-reptext   = text-002.
      APPEND g_r_fieldcat TO g_t_fieldcat.
    **Populating fieldcatalog with segment field
      LOOP AT g_t_segment .
        ADD 1 TO lv_pos.
        CLEAR g_r_fieldcat.
        g_r_fieldcat-fieldname = g_t_segment-fieldname .
        g_r_fieldcat-ref_table = p_segnam.
        g_r_fieldcat-ref_field = g_t_segment-fieldname .
        g_r_fieldcat-key             =  'X'.
        g_r_fieldcat-col_pos         =  lv_pos.
        g_r_fieldcat-outputlen       =  '10'.
    Check for given fields on the selection screen
        IF NOT g_t_segment-fieldname IN s_fldnam.
          g_r_fieldcat-no_out = 'X'.
        ENDIF.
    *Column text
        IF g_t_segment-fieldtext IS INITIAL.
    *Get the DDIC texts for columns
          PERFORM get_ddic_texts.
        ENDIF.
        APPEND g_r_fieldcat TO g_t_fieldcat.
      ENDLOOP.
    ENDFORM.                    " FILL_FIELDCAT
    *&      Form  GET_DDIC_TEXTS
         Get the DDIC texts
    -->  p1        text
    <--  p2        text
    FORM get_ddic_texts.
      DATA : l_f_descr TYPE string.
    Get the texts for the data element
      CALL FUNCTION 'TB_DATAELEMENT_GET_TEXTS'
           EXPORTING
                name         = g_t_segment-fieldname
          IMPORTING
               description   = l_f_descr
               LENGTH_FIELD  =
               LENGTH_HEADER =
               LENGTH_LONG   =
               LENGTH_MIDDLE =
               LENGTH_SHORT  =
               TEXT_HEADER   =
               TEXT_LONG     =
               TEXT_MIDDLE   =
               TEXT_SHORT    =
       EXCEPTIONS
            not_found     = 1
            OTHERS        = 2
      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 DDIC text..
      g_r_fieldcat-colddictxt = 'X'.
      g_r_fieldcat-reptext = l_f_descr.
    ENDFORM.                    " GET_DDIC_TEXTS

  • Need some low level help/info on Grid Control / Data Guard

    I need to get some info concerning the set up and administration of Grid Control. In particular, I need to know why Grid Control needs to have the Oracle OS-Level username and password stored in Grid Control in order for GC to set up and manage a Data Guard database.
    Is it because when the database is being created, GC issues commands like RMAN and SCP to put files onto the standby host?
    Also, for accountability purposes, can I not use a named user account (with the same privs as the oracle user) saved as the preferred credential and still perform the necessary functions to use DG and GC together effectively.
    Probably a lot of info and variables, and I've not explained much, but happy to explain further if needed.
    Thanks!
    Edited by: joe.bednarz on Oct 14, 2009 9:38 AM

    Thanks for the input... we need to use another account other the "oracle" account so there is some accountability for who does what. If I create an account that has similar privileges as the oracle user, I can still run all things Oracle, while still having a log of my log in time and actions.
    More of security issue...
    Thanks again. Appreciate it!

  • Color change of a field  in ALV Grid Control

    Hi,
    One small help needed....
    My req is explained below:
    I have 3 fields empno, ename and deptno. and the records of these fields would be displayed in ALV grid control.
    When I hover the mouse on ename field, the color of the complete field should change to other color, say "RED".
    How do I get this. Are there any Mouse events in SAP?
    Kalyan

    Hi,
    Once i changed the color of a field in a alv (not grid alv), i suspose that the same in alv grid. Also i used an mouse event.
    To manage the color:
    TYPE-POOLS : SLIS, and check this type:  SLIS_T_SPECIALCOL_ALV.
    when you call the function to display the alv, there is a parameter in which you should pass an internal table that references the type  SLIS_T_SPECIALCOL_ALV.
    To manage the mouse:
    1.- You should add the event user command:
    for example:
    DATA: I_EVENT TYPE SLIS_ALV_EVENT.
    Llamo al la función que obtiene los eventos validos para el ALV
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                I_LIST_TYPE     = 0
           IMPORTING
                ET_EVENTS       = P_EVENTS
           EXCEPTIONS
                LIST_TYPE_WRONG = 1
                OTHERS          = 2.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ELSE.
      agrega evento user command
        READ TABLE P_EVENTS INTO I_EVENT
          WITH KEY NAME = SLIS_EV_USER_COMMAND.
        IF SY-SUBRC EQ 0.
          I_EVENT-FORM  = SLIS_EV_USER_COMMAND.
          MODIFY P_EVENTS FROM I_EVENT INDEX SY-TABIX.
        ENDIF.
      ENDIF.
    2.- you work with the user command event:
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
                            RS_SELFIELD TYPE SLIS_SELFIELD .
      CASE R_UCOMM.
        WHEN C_DOBLE_CLICK.
        here you do the things that you need when the mouse *     bottom it's pressed
          PERFORM xxxxxxx.
      ENDCASE.
    ENDFORM.
    3.- you can change the form of the mouse, but i don't remember exactly how to do that... try to check that, it's helpfull in order to display the fields that can execute a funtion in your alv.
    I hope this help you, and sorry for my english.
    Albio.-

  • LEFT_CLICK_RUN event of ALV Grid Control

    Hello,
    What is the use of LEFT_CLICK_RUN event of the CL_GUI_ALV_GRID control. I thought it gets triggered when we click on the ALV Grid. But nothing as such is happening.
    I had defined the event and then implemented it. I had even registered the event to the Grid Control. But when I am clicking on the Grid control, this event is not gettin triggered.
    My requirement is I need to get a popup when I click on a particular field of a ALV Grid Control.
    Priya

    Hi Priya,
    Please check demo program BCALV_GRID_06, it shows how to create a context menu when you right-click on the list.
    Hope this may help you.
    Regards,
    Lanka

  • Multiple ALV Grid Controls per report - problem with default displ.variant

    Hi,
    I have a report with few screens called sequentialy. Each one of the screens has implemented own instance of ALV Grid Control within custom container, means:
    - screen 100 has container Cont100 and grid control "grid100",
    - screen 110 has container Cont110 and grid control "grid110"
    - screen 120 has container Cont120 and grid control "grid120"
    and so on...
    Each one of the grid controls is initialized with own field catalog table, with own layout and variant structure definitions. My problem occurs when the user changes the display variant for some of the grid controls and save the layout variant using "default setting" checkbox. In this case next time the program is started all other grid controls behaves like they don't have their own variant definitions, but uses the default setting of the mentioned screen. This leads (usualy) to unsuable grid controls by default, because usualy different controls have no equal field-definition tables. I have the same behaviour even when there are more than 1 ALV grids on a single screen (for example - 2).
    For now I don't provide variant variables at selection screen, but it seems there is no way to provide such variables for each one of the grid-controls.
    Is anyone aware how to control this? Means no matter if there is default setting in use for some of the grid-controls, how to manipulate other grid-controls not to use this default setting?
    Many thanks in advance.
    Regards,
    Ivaylo Mutafchiev

    check this sample code which displays 4 grids in 4 different tabs and with 4 different handles
    PROGRAM  sapmzsdpp MESSAGE-ID z1.
    Table Declarations                                                   *
    TABLES:
      vbpa,                                " Sales Document: Partner
      kna1,                                " Customer Master
      vbap.                                " Sales Document: Item Data
    Tab Strip Declarations                                              *
    CONTROLS:
      tabstrip_sdpp TYPE TABSTRIP.         " Tabstrip
    Constants declarations                                               *
    CONSTANTS:
      c_rep_zm(2)   TYPE c VALUE 'ZM',     " Outside Sales Representative
      c_rep_ve(2)   TYPE c VALUE 'VE',     " Inside Sales Representative
      c_rep_zi(2)   TYPE c VALUE 'ZI',     " Sales Manager
      c_abgru_08(2) TYPE c VALUE '08',     " Reason for Rej: SO Not Closed
      c_stock_ind_e TYPE c VALUE 'E',      " Stock Idctr : Orders on hand
      c_gauge(5)    TYPE c VALUE 'GAUGE',  " Characteristic Name - GAUGE
      c_width(5)    TYPE c VALUE 'WIDTH',  " Characteristic Name - WIDTH
      c_gauge_metric(12)                   " Character Name - GAUGE_METRIC
                    TYPE c VALUE 'GAUGE_METRIC',
      c_width_metric(12)                   " Character Name - WIDTH_METRIC
                    TYPE c VALUE 'WIDTH_METRIC',
      c_eng_metric(14)                     " Charac Value - ENGLISH_METRIC
                    TYPE c VALUE 'ENGLISH_METRIC',
      c_coil(4)     TYPE c VALUE 'COIL',   " For Value COIL
      c_spec_bf(7)  TYPE c VALUE 'SPEC_BF'," Charac value SPEC_BF
      c_wadat_ist(8)                       " Actual Goods Movement Date
                    TYPE c VALUE '00000000',
      c_mcha(4)     TYPE c VALUE 'MCHA',   " Database Table 'MCHA'
      c_classtype_022(3)
                    TYPE c VALUE '022',    " Class Type : BATCH
      c_pipe(2)     TYPE c VALUE '06',     " Material Pricing Group: Pipes
      c_item_ctgry_ztam(4)
                    TYPE c VALUE 'ZTAM',   " Item Cat:Certificate Mnfctr
      c_lab_result(10)                     " Charac Value LAB_RESULT
                    TYPE n VALUE '0000001392',
      c_none_reqd(10)                      " For Value NONE REQD
                    TYPE c VALUE 'NONE REQD.',
      c_passed(6)   TYPE c VALUE 'PASSED', " For Value PASSED
      c_pending(12) TYPE c                 " For Value TEST PENDING
                    VALUE 'TEST PENDING',
      c_bundling(13)                       " For Value TEST BUNDLING
                    TYPE c VALUE 'TEST BUNDLING',
      c_normal(2)   TYPE c VALUE '01'.     " Priority: Normal
    Internal Table Declarations                                          *
    DATA :
    Internal table to hold common data for all reports
    BEGIN OF t_common_data OCCURS 0,
       kunnr        LIKE vbak-kunnr,       " Customer Number
       vbeln        LIKE vbap-vbeln,       " Sales Document Number
       posnr        LIKE vbap-posnr,       " Sales Document Item Number
       ihrez_e      LIKE vbkd-ihrez_e,     " Mill Order Number
       matnr        LIKE vbap-matnr,       " Material Number
       pstyv        LIKE vbap-pstyv,       " Sales Document Item Category
       kwmeng       LIKE vbap-kwmeng,      " Cumulative Order Quantity
       lprio        LIKE vbap-lprio,       " Delivery Priority
       werks        LIKE vbap-werks,       " Plant
       kondm        LIKE vbap-kondm,       " Material Pricing Group
       aedat        LIKE vbap-aedat,       " Date of Last Change
       cuobj        LIKE vbap-cuobj,       " Configuration
       saldata      LIKE vbap-zzcust_req_avail,
                                           " Required Availability Date
    END OF t_common_data,
    Internal table to hold Customer Number
      BEGIN OF t_cust_temp OCCURS 0,
        kunnr       LIKE vbak-kunnr,       " Customer Number
      END OF t_cust_temp,
    Internal table to hold stock details
      BEGIN OF t_stock OCCURS 0,
       vbeln        LIKE mska-vbeln,       " Sales Document Number
       posnr        LIKE mska-posnr,       " Sales Document Item Number
       matnr        LIKE mska-matnr,       " Material Number
       werks        LIKE mska-werks,       " Plant
       charg        LIKE mska-charg,       " Batch Number
       kalab        LIKE mska-kalab,       " Valuated Stock
       ersda        LIKE mska-ersda,
    END OF t_stock,
    Internal table to hold deliveries
    BEGIN OF t_delivery_data OCCURS 0,
      vbeln         LIKE lips-vbeln,       " Delivery Document Number
      vgbel         LIKE lips-vgbel,       " Document No of Ref Document
      vgpos         LIKE lips-vgpos,       " Item No of Ref Item
    END OF t_delivery_data,
    Internal table to hold released tons & released days
    BEGIN OF t_released_tons_days OCCURS 0,
      vbeln         LIKE likp-vbeln,       " Delivery Document Number
      btgew         LIKE likp-btgew,       " Total Weight
      bldat         LIKE likp-bldat,       " Document Date in Document
    END OF t_released_tons_days,
    Internal table to hold Pre-Production-Pending Orders (Report-1)
    BEGIN OF t_pre_prod_ord OCCURS 0,
       sortl1       LIKE zcustcode-sortl,  " Customer Search Term
       ihrez_e1     LIKE vbkd-ihrez_e,     " Mill Order Number
       salord1(17)  TYPE c,                " Sales Order Document & Item
       descri       TYPE char70,           " Specification of the Item
       speci        TYPE char30,           " Description of the Item
       days_entry   LIKE zlgcyinfo-days_since_entry,
                                           " Days Since Entry
       dept         LIKE zlgcyinfo-bklog,  " Department
       notes1       LIKE zcsimemo-text,    " CSI File Memo Text
    */ Request No. DV2K904687
       chng_date    LIKE vbap-aedat,       " Date of Last Change
    END OF t_pre_prod_ord,
    Internal table to hold Delinquent Orders (Report-2)
    BEGIN OF t_delinquent_ord OCCURS 0,
       sortl2       LIKE zcustcode-sortl,  " Customer Search Term
       ihrez_e2     LIKE vbkd-ihrez_e,     " Mill Order Number
       salord2(17)  TYPE c,                " Sales Order Document & Item
       descri       TYPE char70,           " Specification of the Item
       speci        TYPE char30,           " Description of the Item
       saldata      LIKE vbap-zzcust_req_avail,
       schdate      LIKE vbep-edatu,       " Schedule Line Date
       days_late    LIKE zlgcyinfo-dayslate,
                                           " Days Late
       unit         LIKE zlgcyinfo-unit,   " Status of Consolidation Units
       days_at_unit LIKE zlgcyinfo-daysatunit,
       notes2       LIKE zcsimemo-text,    " CSI File Memo Text
    END OF t_delinquent_ord,
    Internal table to hold Processed Material Orders (Report-3)
    BEGIN OF t_processed_ord OCCURS 0,
       sortl3       LIKE zcustcode-sortl,  " Customer Search Term
       ihrez_e3     LIKE vbkd-ihrez_e,     " Mill Order Number
       salord3(17)  TYPE c,                " Sales Order Document & Item
       descri       TYPE char70,           " Specification of the Item
       speci        TYPE char30,           " Description of the Item
       order_tons   LIKE vbap-kwmeng,      " Cumulative Order Quantity
       fin_tons     LIKE mska-kalab,       " Val.Stock With Unres Usage
       fin_days     TYPE i,                " Finished Days
       rel_tons     LIKE likp-btgew,       " Total Weight
       rel_days     TYPE i,                " No.of.Days Order is Released
       status(15)   TYPE c,                " Status Of Stock
       tb_tons      LIKE zlgcyinfo-tons,   " Tons
       notes3       LIKE zcsimemo-text,    " CSI File Memo Text
    END OF t_processed_ord,
    Internal table to hold Flagged Orders (Report-4)
    BEGIN OF t_flagged_ord OCCURS 0,
       sortl4       LIKE zcustcode-sortl,  " Customer Search Term
       ihrez_e4     LIKE vbkd-ihrez_e,     " Mill Order Number
       salord4(17)  TYPE c,                " Sales Order Document & Item
       descri       TYPE char70,           " Specification of the Item
       speci        TYPE char30,           " Description of the Item
       saldata      LIKE vbap-zzcust_req_avail,
       unit         LIKE zlgcyinfo-unit,   " Status of Consolidation Units
       tons         LIKE zlgcyinfo-tons,   " Tons
       priority     LIKE vbap-lprio,       " Delivery Priority
       notes4       LIKE zcsimemo-text,    " CSI File Memo Text
    END OF t_flagged_ord,
    Internal table to hold CSI memo file data
    BEGIN OF t_csi_memo_data OCCURS 0,
       vbeln        LIKE zcsimemo-vbeln,   " Sales Document Number
       posnr        LIKE zcsimemo-posnr,   " Sales Order line item
       text         LIKE zcsimemo-text,    " CSI File Memo Text
    END OF t_csi_memo_data,
    Internal table to hold Customer Codes
    BEGIN OF t_customer_code OCCURS 0,
       sortl        LIKE zcustcode-sortl,  " Sort Field
       kunnr        LIKE zcustcode-kunnr,  " Customer Number
    END OF t_customer_code,
    Internal table to hold schedule line dates
    BEGIN OF t_schedule_line_date OCCURS 0,
       vbeln        LIKE vbep-vbeln,       " Sales Document Number
       posnr        LIKE vbep-posnr,       " Sales Document Item Number
       edatu        LIKE vbep-edatu,       " Schedule line date
    END OF t_schedule_line_date,
    Internal table to hold Characteristic values
      t_configuration
                    TYPE TABLE OF conf_out
                    WITH HEADER LINE,
    Internal tables to hold legacy data
      t_lgcyinfo    TYPE TABLE OF zlgcyinfo
                    WITH HEADER LINE.
    Work variables declarations                                          *
    DATA:
      gv_parvw      LIKE kupav-parvw,      " Partner function
      gv_abgru      LIKE vbap-abgru,       " Reason to eject sales order
      gv_gauge      LIKE conf_out-atwtb,   " Charac Value Description
      gv_width      LIKE conf_out-atwtb,   " Charac Value Description
      gv_ok_code    LIKE sy-ucomm,         " Usercommand
      gv_okcode     LIKE sy-ucomm,         " User Command
      gv_number     LIKE sy-dynnr
                    VALUE '0101',          " Initial Sub Screen Number
      gv_vbeln      LIKE vbak-vbeln,       " Sales Order
      gv_posnr      LIKE vbup-posnr,       " Sales Item
    */ Request No. DV2K904687
      gv_del_prio   LIKE vbap-lprio,       " Delivery Priority
      gv_obj_key    LIKE inob-objek,       " Object Key
      gv_config     LIKE inob-cuobj,       " Configuration
      gv_lab_result LIKE ausp-atwrt,       " Lab Result Value
      gv_pass_stock LIKE mska-kalab,       " Finished Stock
      gv_fail_stock LIKE mska-kalab,       " Failed Stock
      gv_tp_tons    LIKE mska-kalab,       " Test Pending Tons
      gv_csi_stock  LIKE mbew-lbkum,       " CSI Stock On Hand
      gv_val_stock  LIKE mska-kalab,       " Valuated Stock
      gv_fin_tons   LIKE mska-kalab,       " Finished Tons
      gv_fin_days   TYPE i,                " Finished Days
      gv_rel_tons   LIKE likp-btgew,       " Released Tons
      gv_rel_days   TYPE i,                " Released Days
      gv_no_delivery                       " Number of Delivery Documents
                    TYPE i,
      gv_bund_tons  LIKE zlgcyinfo-tons,   " Bundling Tons
      gv_net_weight LIKE mara-ntgew,       " Net Weight
      gv_tb_tons    LIKE zlgcyinfo-tons,   " Test/Bundling Tons
      gv_date       LIKE mska-ersda,       " Date
      gv_tabix      LIKE sy-tabix,         " Table Index
      gv_flg        TYPE c,                " Flag Variable
      gv_exit       TYPE c.                " For Parameter Exit
    Constant declarations for ALV Grid                                   *
    CONSTANTS:
      c_cont_pre_prod_ord
                     TYPE scrfname VALUE 'CUST_PPP',
                                           " Custom Container for Report-1
      c_cont_delinquent_ord
                     TYPE scrfname VALUE 'CUST_DIP',
                                           " Custom Container for Report-2
      c_cont_processed_ord
                     TYPE scrfname VALUE 'CUST_PMS',
                                           " Custom Container for Report-3
      c_cont_flagged_ord
                     TYPE scrfname VALUE 'CUST_FLGORD',
                                           " Custom Container for Report-4
      c_handle1(3)   TYPE c VALUE 'G_1',   " Handle for PPP rpt Grid
      c_handle2(3)   TYPE c VALUE 'G_2',   " Handle for DIP rpt Grid
      c_handle3(3)   TYPE c VALUE 'G_3',   " Handle for PMS rpt Grid
      c_handle4(3)   TYPE c VALUE 'G_4',   " Handle for FLGORD rpt Grid
      c_true         TYPE c VALUE 'X',     " For value 'X'
      c_save         TYPE c VALUE 'A'.     " User-Defd & Global Variants
    Selection Screen                                                     *
    SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-014.
    PARAMETERS :
      p_osr       RADIOBUTTON GROUP g1
                  DEFAULT 'X',             " Outside Sales Representative
      p_isr       RADIOBUTTON GROUP g1,    " Inside Sales Representative
      p_s_mgr     RADIOBUTTON GROUP g1.    " Sales Manager
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-005.
    SELECT-OPTIONS:
      s_pernr     FOR vbpa-pernr
                  OBLIGATORY,              " Employee Number
      s_kunnr     FOR kna1-kunnr,          " Customer Number
      s_sortl     FOR kna1-sortl,          " Customer Search Term
      s_kondm     FOR vbap-kondm.          " Material Pricing Group
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-006.
    PARAMETERS:
      p_open      RADIOBUTTON GROUP g2
                  DEFAULT 'X',             " Open Orders
      p_closed    RADIOBUTTON GROUP g2.    " Closed Orders
    SELECTION-SCREEN END OF BLOCK b3.
    SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-007.
    PARAMETERS:
      p_var1      LIKE disvariant-variant, " Variant For Report-1
      p_var2      LIKE disvariant-variant, " Variant For Report-2
      p_var3      LIKE disvariant-variant, " Variant For Report-3
      p_var4      LIKE disvariant-variant. " Varinat For Report-3
    SELECTION-SCREEN END OF BLOCK b4.
    SELECTION-SCREEN END OF SCREEN 500.
    */ Begin of Modification - Request No. DV2K904687
    Selection Screen for Changing Sales Order Priority
    SELECTION-SCREEN BEGIN OF SCREEN 1100 AS WINDOW.
    SELECTION-SCREEN BEGIN OF BLOCK b5 WITH FRAME TITLE text-044.
    PARAMETERS    p_sonum  LIKE vbap-vbeln." Sales Order Number
    SELECT-OPTIONS s_item  FOR  vbap-posnr." Sales Order Item
    PARAMETERS     p_delpr LIKE vbap-lprio." Delivery Priority
    SELECTION-SCREEN END OF BLOCK b5.
    SELECTION-SCREEN END OF SCREEN 1100.
    */ End of Modification - Request No. DV2K904687
    CLASS lcl_gv_event_receiveriver DEFINITION                           *
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    ALV Grid - Work Variables Declarations                               *
    DATA:
      gv_cont_pre_prod_ord   TYPE REF
                               TO cl_gui_custom_container,
                                           " Custom Cont For Report-1
      gv_cont_delinquent_ord TYPE REF
                               TO cl_gui_custom_container,
                                          " Custom Cont For Report-2
      gv_cont_processed_ord  TYPE REF
                               TO cl_gui_custom_container,
                                           " Custom Cont For Report-3
      gv_cont_flagged_ord    TYPE REF
                               TO cl_gui_custom_container,
                                           " Custom Cont For Report-4
      gv_grid_pre_prod_ord   TYPE REF
                               TO cl_gui_alv_grid,
                                           " Grid For Report-1
      gv_grid_delinquent_ord TYPE REF
                               TO cl_gui_alv_grid,
                                           " Grid For Report-2
      gv_grid_processed_ord  TYPE REF
                               TO cl_gui_alv_grid,
                                           " Grid For Report-3
      gv_grid_flagged_ord    TYPE REF
                               TO cl_gui_alv_grid,
                                           " Grid For Report-4
      gv_event_receiver      TYPE REF
                               TO lcl_event_receiver,
                                           " Object For Local Class
      gs_lay_pre_prod_ord    TYPE lvc_s_layo,
                                           " Work Area for Grid layout
      gs_lay_delinquent_ord  TYPE lvc_s_layo,
                                           " Work Area for Grid layout
      gs_lay_processed_ord   TYPE lvc_s_layo,
                                           " Work Area for Grid layout
      gs_lay_flagged_ord     TYPE lvc_s_layo,
                                           " Work Area for Grid Layout
      gs_var_pre_prod_ord    TYPE disvariant,
                                           " Layout Structure
      gs_var_delinquent_ord  TYPE disvariant,
                                           " Layout Structure
      gs_var_processed_ord   TYPE disvariant,
                                           " Layout Structure
      gs_var_flagged_ord     TYPE disvariant,
                                           " Layout Structure
      t_fcat_pre_prod_ord    TYPE lvc_t_fcat
                             WITH HEADER LINE,
                                           " Field Catalog For Report-1
      t_fcat_delinquent_ord  TYPE lvc_t_fcat
                             WITH HEADER LINE,
                                           " Field Catalog For Report-2
      t_fcat_processed_ord   TYPE lvc_t_fcat
                             WITH HEADER LINE,
                                           " Field Catalog For Report-3
      t_fcat_flagged_ord     TYPE lvc_t_fcat
                             WITH HEADER LINE,
                                           " Field Catalog For Report-4
      t_exclude              TYPE ui_functions,
                                           " Function Code Table
      gs_exclude             TYPE ui_func. " Function Code Structure
    CLASS lcl_gv_event_receiver DEFINITION                               *
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
          handle_hotspot
            FOR EVENT hotspot_click OF cl_gui_alv_grid
              IMPORTING e_row_id e_column_id es_row_no,
          handle_top_of_page
                          FOR EVENT print_top_of_page OF cl_gui_alv_grid,
    */ Begin of Modification - Request No. DV2K904687
        handle_toolbar
            FOR EVENT toolbar OF cl_gui_alv_grid
                IMPORTING e_object e_interactive,
        handle_user_command
            FOR EVENT user_command OF cl_gui_alv_grid
                IMPORTING e_ucomm.
    */ End of Modification - Request No. DV2K904687
    ENDCLASS.                              " LCL_EVENT_RECEIVER DEFINITION
    CLASS IMPLEMENTATION                                                 *
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD handle_hotspot.
        CASE e_column_id-fieldname.
          WHEN 'SALORD1'.
            CLEAR t_pre_prod_ord.
            READ TABLE t_pre_prod_ord
                  INTO t_pre_prod_ord
                 INDEX e_row_id-index.
          Call VA03 To View Sales Order Line Item Details
            PERFORM call_va03 USING t_pre_prod_ord-salord1.
          WHEN 'SALORD2'.
            CLEAR t_delinquent_ord.
            READ TABLE t_delinquent_ord
                  INTO t_delinquent_ord
                 INDEX e_row_id-index.
          Call VA03 To View Sales Order Line Item Details
            PERFORM call_va03 USING t_delinquent_ord-salord2.
          WHEN 'SALORD3'.
            CLEAR t_processed_ord.
            READ TABLE t_processed_ord
                  INTO t_processed_ord
                 INDEX e_row_id-index.
          Call VA03 To View Sales Order Line Item Details
            PERFORM call_va03 USING t_processed_ord-salord3.
          WHEN 'SALORD4'.
            CLEAR t_flagged_ord.
            READ TABLE t_flagged_ord
                  INTO t_flagged_ord
                 INDEX e_row_id-index.
          Call VA03 To View Sales Order Line Item Details
            PERFORM call_va03 USING t_flagged_ord-salord4.
          WHEN 'SORTL1'.
            CLEAR t_pre_prod_ord.
            READ TABLE t_pre_prod_ord
                  INTO t_pre_prod_ord
                 INDEX e_row_id-index.
        Call ZSD11 for Customer Search Term
            PERFORM call_zsd11_cust_code USING t_pre_prod_ord-sortl1.
          WHEN 'SORTL2'.
            CLEAR t_delinquent_ord.
            READ TABLE t_delinquent_ord
                  INTO t_delinquent_ord
                 INDEX e_row_id-index.
          Call ZSD11 for Customer Search Term
            PERFORM call_zsd11_cust_code USING t_delinquent_ord-sortl2.
          WHEN 'SORTL3'.
            CLEAR t_processed_ord.
            READ TABLE t_processed_ord
                  INTO t_processed_ord
                 INDEX e_row_id-index.
          Call ZSD11 for Customer Search Term
            PERFORM call_zsd11_cust_code USING t_processed_ord-sortl3.
          WHEN 'SORTL4'.
            CLEAR t_flagged_ord.
            READ TABLE t_flagged_ord
                  INTO t_flagged_ord
                 INDEX e_row_id-index.
          Call ZSD11 for Customer Search Term
            PERFORM call_zsd11_cust_code USING t_flagged_ord-sortl4.
          WHEN 'IHREZ_E1'.
            CLEAR t_pre_prod_ord.
            READ TABLE t_pre_prod_ord
                  INTO t_pre_prod_ord
                 INDEX e_row_id-index.
          Call ZSD11 for Mill Order
            PERFORM call_zsd11_millorder USING t_pre_prod_ord-ihrez_e1.
          WHEN 'IHREZ_E2'.
            CLEAR t_delinquent_ord.
            READ TABLE t_delinquent_ord
                  INTO t_delinquent_ord
                 INDEX e_row_id-index.
          Call ZSD11 for Mill Order
            PERFORM call_zsd11_millorder USING t_delinquent_ord-ihrez_e2.
          WHEN 'IHREZ_E3'.
            CLEAR t_processed_ord.
            READ TABLE t_processed_ord
                  INTO t_processed_ord
                 INDEX e_row_id-index.
          Call ZSD11 for Mill Order
            PERFORM call_zsd11_millorder USING t_processed_ord-ihrez_e3.
          WHEN 'IHREZ_E4'.
            CLEAR t_flagged_ord.
            READ TABLE t_flagged_ord
                   INTO t_flagged_ord
                  INDEX e_row_id-index.
          Call ZSD11 for Mill Order
            PERFORM call_zsd11_millorder USING t_flagged_ord-ihrez_e4.
          WHEN 'NOTES1'.
            CLEAR t_pre_prod_ord.
            READ TABLE t_pre_prod_ord
                  INTO t_pre_prod_ord
                 INDEX e_row_id-index.
          Call zsd00087 program to edit CSI Memo Text
            PERFORM edit_notes USING t_pre_prod_ord-salord1.
          WHEN 'NOTES2'.
            CLEAR t_delinquent_ord.
            READ TABLE t_delinquent_ord
                  INTO t_delinquent_ord
                 INDEX e_row_id-index.
          Call zsd00087 program to edit CSI Memo Text
            PERFORM edit_notes USING t_delinquent_ord-salord2.
          WHEN 'NOTES3'.
            CLEAR t_processed_ord.
            READ TABLE t_processed_ord
                  INTO t_processed_ord
                 INDEX e_row_id-index.
          Call zsd00087 program to CSI Memo Text
            PERFORM edit_notes USING t_processed_ord-salord3.
          WHEN 'NOTES4'.
            CLEAR t_flagged_ord.
            READ TABLE t_flagged_ord
                  INTO t_flagged_ord
                 INDEX e_row_id-index.
          Call zsd00087 program to CSI Memo Text
            PERFORM edit_notes USING t_flagged_ord-salord4.
        ENDCASE.                           " CASE E_COLUMN_ID ...
      ENDMETHOD.                           " HANDLE_HOTSPOT
      METHOD handle_top_of_page.
        PERFORM write_report_header.
      ENDMETHOD.                           " METHOD HANDLE_TOP_OF_PAGE
    */ Begin of Modification - Request No. DV2K904687
      METHOD handle_toolbar.
        DATA: ls_toolbar  TYPE stb_button.
      append a separator to normal toolbar
        CLEAR ls_toolbar.
        MOVE 3 TO ls_toolbar-butn_type.
        APPEND ls_toolbar TO e_object->mt_toolbar.
        CLEAR ls_toolbar.
      append a button for Change Delivery Priority
        MOVE 'CHNG_PRIO' TO ls_toolbar-function.
        MOVE 'Change SO Delivery Priority'(048)
             TO ls_toolbar-quickinfo.
        MOVE 'Change SO Priority'(049) TO ls_toolbar-text.
        MOVE 0 TO ls_toolbar-butn_type.
        APPEND ls_toolbar TO e_object->mt_toolbar.
      ENDMETHOD.                           " handle_toolbar
      METHOD handle_user_command.
        DATA: t_sel_row  TYPE lvc_t_roid,
              gs_sel_row TYPE lvc_s_roid,
              gs_flagged_ord LIKE t_flagged_ord,
              lv_lines   TYPE i.
        CASE e_ucomm.
          WHEN 'CHNG_PRIO'.
            REFRESH t_sel_row.
            CLEAR e_ucomm.
            CALL METHOD gv_grid_flagged_ord->get_selected_rows
              IMPORTING
                et_row_no = t_sel_row.
            CLEAR: t_flagged_ord,
                   gv_vbeln,
                   gv_posnr,
                   gv_del_prio.
            DESCRIBE TABLE t_sel_row LINES lv_lines.
            IF lv_lines GT 1.
              MESSAGE i001 WITH 'Select only one row'(043).
            ELSEIF lv_lines EQ 1.
              READ TABLE t_sel_row INTO gs_sel_row INDEX 1.
              READ TABLE t_flagged_ord INTO gs_flagged_ord
                   INDEX gs_sel_row-row_id.
              IF sy-subrc EQ 0.
                SPLIT gs_flagged_ord-salord4 AT '-' INTO gv_vbeln gv_posnr.
                gv_del_prio = gs_flagged_ord-priority.
                CLEAR: s_item, s_item[].
                p_sonum    = gv_vbeln.
                p_delpr    = gv_del_prio.
                s_item-low = gv_posnr.
                APPEND s_item TO s_item.
                CLEAR  s_item.
              ENDIF.                       " IF sy-subrc EQ 0
            ENDIF.                         " IF lv_lines GT 1
            IF lv_lines LE 1.
              CALL SELECTION-SCREEN '1100' STARTING AT 30 2
                                           ENDING   AT 110 7.
              LEAVE TO SCREEN 100.
            ENDIF.
        ENDCASE.                           " CASE e_ucomm
      ENDMETHOD.                           " handle_user_command
    */ End of Modification - Request No. DV2K904687
    ENDCLASS.                              " LCL_EVENT_RECEIVER
    " IMPLEMENTATION
    Form  WRITE_REPORT_HEADER                                            *
    This subroutine displays Report Header which includes                *
    Report Name, Executed by, Execution date, Execution Time             *
    There are no parameters to be passed to this subroutine              *
    FORM write_report_header.
      DATA lv_rep_tit(72) TYPE c.
      FORMAT COLOR COL_KEY.
      MOVE sy-title TO lv_rep_tit.
      CONDENSE lv_rep_tit.
      SKIP 1.
      WRITE: /3  sy-repid,
              25 'California Steel Industries, Inc.'(040),
              75 'Page'(041),
              80(4) sy-pagno.
      WRITE: /3  sy-uzeit,
              25 lv_rep_tit,
              75 sy-datum.
      FORMAT RESET.
    ENDFORM.                               " WRITE_REPORT_HEADER
    At selection-output                                                  *
    AT SELECTION-SCREEN OUTPUT.
      CLEAR sy-ucomm.
      IF sy-dynnr EQ '0500'.
      Initialize layout variant for report-1
        CLEAR gs_var_pre_prod_ord.
        gs_var_pre_prod_ord-report = sy-cprog.
        gs_var_pre_prod_ord-handle = c_handle1.
        PERFORM initialize_layoutvariant CHANGING gs_var_pre_prod_ord.
        p_var1 = gs_var_pre_prod_ord-variant.
      Initialize layout variant for report-2
        CLEAR gs_var_delinquent_ord.
        gs_var_delinquent_ord-report = sy-cprog.
        gs_var_delinquent_ord-handle = c_handle2.
        PERFORM initialize_layoutvariant CHANGING gs_var_delinquent_ord.
        p_var2 = gs_var_delinquent_ord-variant.
      Initialize layout variant for report-3
        CLEAR gs_var_processed_ord.
        gs_var_processed_ord-report = sy-cprog.
        gs_var_processed_ord-handle = c_handle3.
        PERFORM initialize_layoutvariant CHANGING gs_var_processed_ord.
        p_var3 = gs_var_processed_ord-variant.
      Initialize layout variant for report-4
        CLEAR gs_var_flagged_ord.
        gs_var_flagged_ord-report = sy-cprog.
        gs_var_flagged_ord-handle = c_handle4.
        PERFORM initialize_layoutvariant CHANGING gs_var_flagged_ord.
        p_var4 = gs_var_flagged_ord-variant.
    */ Begin of Modification - Request No. DV2K904687
      ELSEIF sy-dynnr EQ '1100'.
        DATA t_exclude  TYPE TABLE OF sy-ucomm.
        SET PF-STATUS 'MENU_1100'.
      To use your own GUI status for a selection screen
        CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
          EXPORTING
            p_status  = 'MENU_1100'
          TABLES
            p_exclude = t_exclude.
      ENDIF.                               " IF sy-dynnr EQ '0500'
    */ End of Modification - Request No. DV2K904687
    At Selection Screen                                                  *
    AT SELECTION-SCREEN.
    */ Begin of Modification - Request No. DV2K904687
      CASE sy-dynnr.
        WHEN '1100'.
          IF sy-ucomm IS INITIAL.
            CLEAR sy-ucomm.
            LEAVE TO SCREEN 1100.
          ENDIF.                           " IF sy-ucomm IS INITIAL
          CASE sy-ucomm.
            WHEN 'SAVE'.
              CLEAR sy-ucomm.
            Change Delivery Priority using BAPI method
              PERFORM change_del_priority.
              CLEAR: sy-ucomm,
                     gv_vbeln,
                     gv_posnr,
                     gv_del_prio,
                     p_sonum,
                     s_item,
                     s_item[],
                     p_delpr.
              LEAVE TO SCREEN 0.
            WHEN 'CANCEL'.
              CLEAR: sy-ucomm,
                     gv_vbeln,
                     gv_posnr,
                     gv_del_prio,
                     p_sonum,
                     s_item,
                     s_item[],
                     p_delpr.
              LEAVE TO SCREEN 0.
          ENDCASE.                         " CASE sy-ucomm
        WHEN '0500'.
          IF sy-ucomm EQ 'CRET'.
            LEAVE TO SCREEN 100.
          ELSEIF sy-ucomm IS INITIAL.
            LEAVE TO SCREEN 500.
          ENDIF.                           " IF SY-UCOMM EQ 'CRET'
      ENDCASE.                             " CASE sy-dynnr
    */ End of Modification - Request No. DV2K904687
    Selection Screen: Validations                                        *
    AT SELECTION-SCREEN ON s_pernr.
    Validate Employee Number
      PERFORM validate_employee_number.
    AT SELECTION-SCREEN ON s_kunnr.
    Validate Customer Number
      IF NOT s_kunnr IS INITIAL.
        PERFORM validate_customer_number.
      ENDIF.                               " IF NOT S_KUNNR IS INITIAL
    AT SELECTION-SCREEN ON s_sortl.
    Validate Search Term
      IF NOT s_sortl IS INITIAL.
        PERFORM validate_search_term.
      ENDIF.                               " IF NOT S_SORTL IS INITIAL
    AT SELECTION-SCREEN ON s_kondm.
    Validate Product
      IF NOT s_kondm IS INITIAL.
        PERFORM validate_product.
      ENDIF.                               " IF NOT S_KONDM IS INITIAL
    Validate p_var1
    AT SELECTION-SCREEN ON p_var1.
      CLEAR gs_var_pre_prod_ord.
      gs_var_pre_prod_ord-report  = sy-cprog.
      gs_var_pre_prod_ord-handle  = c_handle1.
      gs_var_pre_prod_ord-variant = p_var1.
      IF p_var1 IS NOT INITIAL.
        PERFORM validate_variant CHANGING gs_var_pre_prod_ord.
      ENDIF.                               " IF P_VAR1 IS NOT INITIAL
    Validate p_var2
    AT SELECTION-SCREEN ON p_var2.
      CLEAR gs_var_delinquent_ord.
      gs_var_delinquent_ord-report  = sy-cprog.
      gs_var_delinquent_ord-handle  = c_handle2.
      gs_var_delinquent_ord-variant = p_var2.
      IF p_var2 IS NOT INITIAL.
        PERFORM validate_variant CHANGING gs_var_delinquent_ord.
      ENDIF.                               " IF P_VAR2 IS NOT INITIAL
    Validate p_var3
    AT SELECTION-SCREEN ON p_var3.
      CLEAR gs_var_processed_ord.
      gs_var_processed_ord-report  = sy-cprog.
      gs_var_processed_ord-handle  = c_handle3.
      gs_var_processed_ord-variant = p_var3.
      IF p_var3 IS NOT INITIAL.
        PERFORM validate_variant CHANGING gs_var_processed_ord.
      ENDIF.                               " IF P_VAR3 IS NOT INITIAL
    Validate p_var4
    AT SELECTION-SCREEN ON p_var4.
      CLEAR gs_var_flagged_ord.
      gs_var_flagged_ord-report  = sy-cprog.
      gs_var_flagged_ord-handle  = c_handle4.
      gs_var_flagged_ord-variant = p_var4.
      IF p_var4 IS NOT INITIAL.
        PERFORM validate_variant CHANGING gs_var_flagged_ord.
      ENDIF.                               " IF P_VAR4 IS NOT INITIAL
    Selection Screen: Value Request for ALV GRID Variants                *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var1.
      CLEAR gs_var_pre_prod_ord.
      gs_var_pre_prod_ord-report = sy-cprog.
      gs_var_pre_prod_ord-handle = c_handle1.
      PERFORM f4_variant CHANGING gs_var_pre_prod_ord
                                  gv_exit.
      IF gv_exit NE c_true.
        p_var1 = gs_var_pre_prod_ord-variant.
      ENDIF.                               " IF GV_EXIT NE c_true
    F4 help for variant p_var2
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var2.
      CLEAR:
        gs_var_delinquent_ord,
        gv_exit.
      gs_var_delinquent_ord-report = sy-cprog.
      gs_var_delinquent_ord-handle = c_handle2.
      PERFORM f4_variant CHANGING gs_var_delinquent_ord
                                  gv_exit.
      IF gv_exit NE c_true.
        p_var2 = gs_var_delinquent_ord-variant.
      ENDIF.                               " IF GV_EXIT NE c_true
    F4 help for variant p_var3
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var3.
      CLEAR:
        gs_var_processed_ord,
        gv_exit.
      gs_var_processed_ord-report = sy-cprog.
      gs_var_processed_ord-handle = c_handle3.
      PERFORM f4_variant CHANGING gs_var_processed_ord
                                  gv_exit.
      IF gv_exit NE c_true.
        p_var3 = gs_var_processed_ord-variant.
      ENDIF.                               " IF GV_EXIT NE c_true
    F4 help for variant p_var4
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var4.
      CLEAR:
        gs_var_flagged_ord,
        gv_exit.
      gs_var_flagged_ord-report = sy-cprog.
      gs_var_flagged_ord-handle = c_handle4.
      PERFORM f4_variant CHANGING gs_var_flagged_ord
                                  gv_exit.
      IF gv_exit NE c_true.
        p_var4 = gs_var_flagged_ord-variant.
      ENDIF.                               " IF GV_EXIT NE c_true
    Form  validate_employee_number                                       *
    This subroutine validates Employee Number                            *
    There are no parameters to need be passed to this subroutine         *
    FORM validate_employee_number.
      DATA lv_pernr LIKE vbpa-pernr.
      SELECT SINGLE pernr
        INTO lv_pernr
        FROM vbpa
       WHERE pernr IN s_pernr.
      IF sy-subrc NE 0.
        MESSAGE e001 WITH text-010.
      ENDIF.                               " IF SY-SUBRC NE 0
      CLEAR lv_pernr.
    ENDFORM.                               " VALIDATE_EMPLOYEE_NUMBER
    Form  validate_customer_number                                       *
    This subroutine validates Customer Number                            *
    There are no parameters need to be passed to this subroutine         *
    FORM validate_customer_number.
      SELECT SINGLE kunnr
        INTO t_common_data-kunnr
        FROM kna1
       WHERE kunnr IN s_kunnr.
      IF sy-subrc NE 0.
        MESSAGE e001 WITH text-011.
      ENDIF.                               " IF SY-SUBRC NE 0
      CLEAR t_common_data-kunnr.
    ENDFORM.                               " VALIDATE_CUSTOMER_NUMBER
    Form  validate_search_term                                           *
    This subroutine validates Search Term                                *
    There are no parameters need to be passed to this subroutine         *
    FORM validate_search_term.
      SELECT SINGLE sortl
        INTO t_customer_code-sortl
        FROM kna1
       WHERE sortl IN s_sortl.
      IF sy-subrc NE 0.
        MESSAGE e001 WITH text-012.
      ENDIF.                               " IF SY-SUBRC NE 0
      CLEAR t_customer_code-sortl.
    ENDFORM.                               " VALIDATE_SEARCH_TERM
    Form  validate_product                                               *
    This subroutine validates Product                                    *
    There are no parameters need to be passed to this subroutine         *
    FORM validate_product.
      SELECT SINGLE kondm
        INTO t_

  • ALV Grid: event for user return in ALV Grid Control

    Hi developers,
    i'm wanna do something after a user has pressed the return button in a alv grid control. For that i need probably a event. But i can not find a proper event in the documentation. Could one of you guys help me?
    Best regards christian

    Hi Christian
    ALV grid is an encapsulated object, so it seems there is no way, you ought to implement the data_changed event. So if you want to make bulk data input and after trigger the event by pressing the return key, you should make the ALV Grid get your changes after pressing the key but not after a cell change of a modified cell.
    To set this attribute:
    CALL METHOD gr_alvgrid->register_edit_event
         EXPORTING i_event_id = cl_gui_alv_grid=>mc_evt_enter .
    This way "data_changed" event will be triggered whenever you press the return key while editing.
    For some more information you can also refer to the tutorial <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an%20easy%20reference%20for%20alv%20grid%20control.pdf">"An Easy Reference for ALV Grid Control"</a>.
    Regards
    *--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

  • Problem in handling double click in the second alv grid control

    Hi all,
    I have a screen. In the screen , I have 2 custom container and each custom container has 1 alv grid control.
    I need to handle double click event for both of alv grid controls in my screen.
    I defined 2 local event handler class for each alv grid and defined 2 handle_double_click event.
    In the first Alv grid double click works fine , everything is ok, world is peaceful.
    But in the second alvgrid, the row parameters (E_ROW, E_COLUMN, ES_ROW_NO) comes initial so i cannot handle it.
    All i need is to call a different transaction (displaying the equipment-IE03) when user double-click on a field in the second alv grid control. I tried to use hotspot_click event too but it does'nt give the row id either.
    I read some posts in the forms ([Double click event of alv grid control|Double click event of alv grid control]).
    I tried everything but nothing works.
    Please help. Your answers will be appreciated.

    Hello Eagle
    I am not sure where the problem lies in your case but sample report ZUS_SDN_THREE_ALV_GRIDS_01 shows that you can always find out the current cell after the double-click event (in any case you have the current cell already as IMPORTING parameters of the event):
    *& Report  ZUS_SDN_THREE_ALV_GRIDS_01
    *& Flow logic of screen '0100' (no screen elements, ok-code => GD_OKCODE):
    **    PROCESS BEFORE OUTPUT.
    **      MODULE STATUS_0100.
    **    PROCESS AFTER INPUT.
    **      MODULE USER_COMMAND_0100.
    *& Thread: problem in handling double click in the second alv grid control
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1172052"></a>
    REPORT  zus_sdn_three_alv_grids_01.
    DATA:
      gd_okcode        TYPE ui_func,
      gd_repid         TYPE syst-repid,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_splitter      TYPE REF TO cl_gui_splitter_container,
      go_splitter_2    TYPE REF TO cl_gui_splitter_container,
      go_cell_top      TYPE REF TO cl_gui_container,
      go_cell_bottom   TYPE REF TO cl_gui_container,
      go_cell_left     TYPE REF TO cl_gui_container,
      go_cell_right    TYPE REF TO cl_gui_container,
      go_grid1         TYPE REF TO cl_gui_alv_grid,
      go_grid2         TYPE REF TO cl_gui_alv_grid,
      go_grid3         TYPE REF TO cl_gui_alv_grid.
    DATA:
      gt_outtab        TYPE STANDARD TABLE OF vbak,
      gt_outtab_2      TYPE STANDARD TABLE OF vbap,
      gt_outtab_3      TYPE STANDARD TABLE OF vbep.
    **PARAMETERS:
    **  p_bukrs          TYPE bukrs  DEFAULT '1000'.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-DATA:
          ms_row      TYPE lvc_s_row,
          ms_col      TYPE lvc_s_col.
        CLASS-METHODS:
          handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
            IMPORTING
              e_row
              e_column
              es_row_no
              sender.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_double_click.
    *   define local data
        DATA:
          ls_outtab      TYPE vbak,
          ls_outtab_2    TYPE vbap,
          ls_outtab_3    TYPE vbep.
        "   Initialize class data
        CLEAR: ms_row,
               ms_col.
        CASE sender.
          WHEN go_grid1.
            ms_row = e_row.
            ms_col = e_column.
    *       Triggers PAI of the dynpro with the specified ok-code
            CALL METHOD cl_gui_cfw=>set_new_ok_code
              EXPORTING
                new_code = 'GET_ITEMS'
    *          IMPORTING
    *            rc       =
          WHEN go_grid2.
            ms_row = e_row.
            ms_col = e_column.
    *       Triggers PAI of the dynpro with the specified ok-code
            CALL METHOD cl_gui_cfw=>set_new_ok_code
              EXPORTING
                new_code = 'GET_SCHEDULE_LINES'
    *          IMPORTING
    *            rc       =
          WHEN go_grid3.
    **        READ TABLE gt_vbap INTO ls_vbap INDEX e_row-index.
    **        CHECK ( ls_vbap-matnr IS NOT INITIAL ).
    **        SET PARAMETER ID 'MAT' FIELD ls_vbap-matnr.
    **        CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
          WHEN OTHERS.
            RETURN.
        ENDCASE.
      ENDMETHOD.                    "handle_double_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      SELECT        * FROM  vbak INTO TABLE gt_outtab UP TO 100 ROWS.
      PERFORM init_controls.
    * Display data
      CALL METHOD go_grid1->set_table_for_first_display
        EXPORTING
          i_structure_name = 'VBAK'
        CHANGING
          it_outtab        = gt_outtab
        EXCEPTIONS
          OTHERS           = 4.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      REFRESH: gt_outtab_2.
      CALL METHOD go_grid2->set_table_for_first_display
        EXPORTING
          i_structure_name = 'VBAP'
        CHANGING
          it_outtab        = gt_outtab_2    " empty !!!
        EXCEPTIONS
          OTHERS           = 4.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      REFRESH: gt_outtab_3.
      CALL METHOD go_grid3->set_table_for_first_display
        EXPORTING
          i_structure_name = 'VBEP'
        CHANGING
          it_outtab        = gt_outtab_3    " empty !!!
        EXCEPTIONS
          OTHERS           = 4.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Link the docking container to the target dynpro
      gd_repid = syst-repid.
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = gd_repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * NOTE: dynpro does not contain any elements
      CALL SCREEN '0100'.
    * Flow logic of dynpro:
    *PROCESS BEFORE OUTPUT.
    *  MODULE STATUS_0100.
    *PROCESS AFTER INPUT.
    *  MODULE USER_COMMAND_0100.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.  " contains push button "ORDERS"
    *  SET TITLEBAR 'xxx'.
    * Refresh display of detail ALV list
      CALL METHOD go_grid2->refresh_table_display
    *    EXPORTING
    *      IS_STABLE      =
    *      I_SOFT_REFRESH =
        EXCEPTIONS
          OTHERS         = 2.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Refresh display of detail ALV list
      CALL METHOD go_grid3->refresh_table_display
    *    EXPORTING
    *      IS_STABLE      =
    *      I_SOFT_REFRESH =
        EXCEPTIONS
          OTHERS         = 2.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      CASE gd_okcode.
        WHEN 'BACK' OR
             'END'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
        " Double-click on first or second ALV grid
        WHEN 'GET_ITEMS'  OR
             'GET_SCHEDULE_LINES'.
          PERFORM get_details.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  INIT_CONTROLS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM init_controls .
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent = cl_gui_container=>screen0
          ratio  = 90
        EXCEPTIONS
          OTHERS = 6.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Create splitter container
      CREATE OBJECT go_splitter
        EXPORTING
          parent            = go_docking
          rows              = 1
          columns           = 2
    *      NO_AUTODEF_PROGID_DYNNR =
    *      NAME              =
        EXCEPTIONS
          cntl_error        = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Get cell container
      CALL METHOD go_splitter->get_container
        EXPORTING
          row       = 1
          column    = 1
        RECEIVING
          container = go_cell_left.
      CALL METHOD go_splitter->get_container
        EXPORTING
          row       = 1
          column    = 2
        RECEIVING
          container = go_cell_right.
    * Create 2nd splitter container
      CREATE OBJECT go_splitter_2
        EXPORTING
          parent            = go_cell_left
          rows              = 2
          columns           = 1
    *      NO_AUTODEF_PROGID_DYNNR =
    *      NAME              =
        EXCEPTIONS
          cntl_error        = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Get cell container
      CALL METHOD go_splitter_2->get_container
        EXPORTING
          row       = 1
          column    = 1
        RECEIVING
          container = go_cell_top.
      CALL METHOD go_splitter_2->get_container
        EXPORTING
          row       = 2
          column    = 1
        RECEIVING
          container = go_cell_bottom.
    * Create ALV grids
      CREATE OBJECT go_grid1
        EXPORTING
          i_parent = go_cell_top
        EXCEPTIONS
          OTHERS   = 5.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CREATE OBJECT go_grid2
        EXPORTING
          i_parent = go_cell_bottom
        EXCEPTIONS
          OTHERS   = 5.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CREATE OBJECT go_grid3
        EXPORTING
          i_parent = go_cell_right
        EXCEPTIONS
          OTHERS   = 5.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Set event handler
      SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid1.
      SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid2.
      SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid3.
    ENDFORM.                    " INIT_CONTROLS
    *&      Form  GET_DETAILS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM get_details .
    * define local data
      DATA: ls_row      TYPE lvc_s_row,
            ls_col      TYPE lvc_s_col.
      data: ls_outtab   type vbak,
            ls_outtab_2 type vbap,
            ls_outtab_3 type vbep.
      BREAK-POINT.
      CASE gd_okcode.
        WHEN 'GET_ITEMS'.
          CALL METHOD go_grid1->get_current_cell
            IMPORTING
    *          e_row     =
    *          e_value   =
    *          e_col     =
              es_row_id = ls_row
              es_col_id = ls_col
    *          es_row_no =
          read TABLE gt_outtab into ls_outtab index ls_row-index.
          refresh: gt_outtab_2,
                   gt_outtab_3.
          SELECT        * FROM  vbap into TABLE gt_outtab_2
                 WHERE  vbeln  = ls_outtab-vbeln.
        WHEN 'GET_SCHEDULE_LINES'.
          CALL METHOD go_grid2->get_current_cell
            IMPORTING
    *          e_row     =
    *          e_value   =
    *          e_col     =
              es_row_id = ls_row
              es_col_id = ls_col
    *          es_row_no =
          READ TABLE gt_outtab_2 into ls_outtab_2 index ls_row-index.
          refresh: gt_outtab_3.
          SELECT        * FROM  vbep into TABLE gt_outtab_3
                 WHERE  vbeln  = ls_outtab_2-vbeln
                 AND    posnr  = ls_outtab_2-posnr.
        WHEN OTHERS.
          RETURN.
      ENDCASE.
      IF ( lcl_eventhandler=>ms_row = ls_row  AND
           lcl_eventhandler=>ms_col = ls_col ).
        MESSAGE 'Current cell identical'  TYPE 'I'.
      ELSE.
        MESSAGE 'Current cell NOT identical'  TYPE 'I'.
      ENDIF.
    ENDFORM.                    " GET_DETAILS
    Regards
      Uwe

  • How do you gracefully error/exit an ALV Grid Controls

    I have a report that uses ALV grid controls.  Inside the screens, I am opening a file, and need to give an error if the file does not successfully open.  I do not have any problem doing this, BUT when I error, it takes me totally out of the program, and I really just want to get back to the report selection screen.  I have not been successful in finding out how to do this.  Any help is very much appreciated!!  Thanks!

    Here is how some of the code looks....this is the initial call into the first screen of the ALV grid.  From the screen 100 of the ALV Grid, I want to be able to hit the green back arrow button and go back to the report selection criteria so that the user can easily change a file name in case they entered it wrong, etc.  Here is the code:
    START-OF-SELECTION.
      IF NOT p_ofile IS INITIAL.
        CONCATENATE p_opath p_ofile INTO p_ofile.
      ENDIF.
      IF NOT p_sfile IS INITIAL.
        CONCATENATE p_spath p_sfile INTO p_sfile.
      ENDIF.
      IF NOT p_ifile IS INITIAL.
        CONCATENATE p_ipath p_ifile INTO p_ifile.
      ENDIF.
      IF NOT p_ofile2 IS INITIAL.
        CONCATENATE p_opath p_ofile2 INTO p_ofile2.
      ENDIF.
      IF NOT p_sfile2 IS INITIAL.
        CONCATENATE p_spath p_sfile2 INTO p_sfile2.
      ENDIF.
      IF NOT p_ifile2 IS INITIAL.
        CONCATENATE p_ipath p_ifile2 INTO p_ifile2.
      ENDIF.
      IF NOT p_ofile3 IS INITIAL.
        CONCATENATE p_opath p_ofile3 INTO p_ofile3.
      ENDIF.
      IF NOT p_sfile3 IS INITIAL.
        CONCATENATE p_spath p_sfile3 INTO p_sfile3.
      ENDIF.
      IF NOT p_ofile4 IS INITIAL.
        CONCATENATE p_opath p_ofile4 INTO p_ofile4.
      ENDIF.
      IF NOT p_sfile4 IS INITIAL.
        CONCATENATE p_spath p_sfile4 INTO p_sfile4.
      ENDIF.
      IF NOT p_ofile5 IS INITIAL.
        CONCATENATE p_opath p_ofile5 INTO p_ofile5.
      ENDIF.
      IF NOT p_ofile6 IS INITIAL.
        CONCATENATE p_opath p_ofile6 INTO p_ofile6.
      ENDIF.
      IF NOT p_ofile7 IS INITIAL.
        CONCATENATE p_opath p_ofile7 INTO p_ofile7.
      ENDIF.
      IF NOT p_ofile8 IS INITIAL.
        CONCATENATE p_opath p_ofile8 INTO p_ofile8.
      ENDIF.
      SELECT * FROM zgedwsostmg INTO TABLE xzgedwsostmg.
      SELECT SINGLE delimiter_hex FROM zgedwflcnfg
          INTO g_delimiter_hex
          WHERE kappl = 'V1'.
      g_hex_value = g_delimiter_hex.
    END-OF-SELECTION.
      PERFORM load_header_table.
      SET SCREEN 100.
    Screen 100 Code
    PROCESS BEFORE OUTPUT.
      MODULE status_0100.
      MODULE create_objects.
    PROCESS AFTER INPUT.
      MODULE pai_100 at exit-command.
    MODULE pai_100 INPUT.
      CASE ok_code.
        WHEN 'BACK'.
          g_back = 'X'.
          PERFORM exit_program.
         exit.
        WHEN 'EXIT'.
          PERFORM exit_program.
        WHEN 'CANC'.
          PERFORM exit_program.
      ENDCASE.
      CLEAR ok_code.
    ENDMODULE.                 " PAI  INPUT
    FORM exit_program.
      CALL METHOD g_custom_container1->free.
      IF NOT g_custom_container2 IS INITIAL.
        CALL METHOD g_custom_container2->free.
      ENDIF.
      CALL METHOD cl_gui_cfw=>flush.
      IF sy-subrc NE 0.
    add your handling, for example
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  titel = g_repid
                  txt2  = sy-subrc
                  txt1  = 'Error in Flush'(500).
      ENDIF.
    LEAVE PROGRAM.
    set screen 0.
    leave screen.
      leave screen.
    leave to screen 1000.
    CALL SELECTION-SCREEN 1000.
    leave to list-processing.
    exit.
    leave to screen 0.
    ENDFORM.                    " exit_program
    As you can see by all the commented lines, I have tried several ways to make this work, but without success.  Thanks again for any help!!

  • Urgent :  how to select the rows in the ALV Grid Control

    How to select the rows in the ALV Grid control,
    I am facing the situation where i need to select the row/rows in the Grid control and then to lock the entries,
    If anyone have the solution please help me out
    <b>Its very Urgent</b>

    Hi Bharath,
    Go through this hope u can understand.
    SEL_MODE. Selection mode, determines how rows can be selected. Can have the following values:
    A Multiple columns, multiple rows with selection buttons.
    B Simple selection, listbox, Single row/column
    C Multiple rows without buttons
    D Multiple rows with buttons and select all ICON
    Setting and getting selected rows (Columns) and read line contents
    You can read which rows of the grid that has been selected, and dynamic select rows of the grid using methods get_selected_rows and set_selected_rows. There are similar methods for columns.
    Note that the grid table always has the rows in the same sequence as displayed in the grid, thus you can use the index of the selected row(s) to read the information in the rows from the table. In the examples below the grid table is named gi_sflight.
    Data declaration:
    DATA:
    Internal table for indexes of selected rows
    gi_index_rows TYPE lvc_t_row,
    Information about 1 row
    g_selected_row LIKE lvc_s_row.
    Example 1: Reading index of selected row(s) and using it to read the grid table
      CALL METHOD go_grid->get_selected_rows
        IMPORTING
          et_index_rows = gi_index_rows.
      DESCRIBE TABLE gi_index_rows LINES l_lines.
      IF l_lines = 0.
        CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
             EXPORTING
                  textline1 = 'You must choose a valid line'.
        EXIT.
      ENDIF.
      LOOP AT gi_index_rows INTO g_selected_row.
         READ TABLE gi_sflight INDEX g_selected_row-index INTO g_wa_sflight.
        ENDIF.
      ENDLOOP.
    Example 2: Set selected row(s).
      DESCRIBE TABLE gi_index_rows LINES l_lines.
      IF l_lines > 0.
        CALL METHOD go_grid->set_selected_rows
            exporting
              it_index_rows = gi_index_rows.
      ENDIF.
    Reward points if helpful.
    Thanks
    Naveen khan

  • Problem with alv grid control editable

    Hello all. I ask your help with this question because I did not find the answer in the forum. Sorry for my pour english.
    I have an alv grid control (OO) with the standards buttons 'insert a line', 'delete a line', 'copy a line'.
    My problem is I want to catch the event of these buttons, because after I register the events mc_evt_enter y mc_evt_modifies, when I push the button to insert a new line the alv grid show the new line and then get a dump with error: Field symbol has not yet been assigned.
    My problem is that no event is launched when I push the button. I tried to catch the event before command but it does not happen.
    It is like these standard buttons works apart and it is not possible to find out what they are doing.
    I have read the manual easy reference for alv grid control, and I created the class lcl_event_handler exactly equal.
    I have tried to debug the code in order to find the error but I can find out where it has been done.
    Thank you in advance. If anybody needs to see my code I will send you or post you.

    David,
    What you need to do for that is to enable the editing field by field. You will have to add a field STYLE type LVC_T_STYL to the DATA table. This nested internal table will hold the information for each field of the row, whether the column is editable or not. So, if you have 5 columns, then the nested internal table will have 5 rows for each row of the main internal table.
    Once this is done, you will have to append a blank row to the table, making all the fields editable and REFRESH the display.
    Regards,
    Ravi
    Note: Please mark the answers as helpful if they help.

Maybe you are looking for

  • Notification options are greyed out!!

    Dear Expert, When I directly goto Transaction QA11 -> Menu-> Inspection processing - > Notification----> worklist/creation/change/display, then I am able to use all the Notification options. But if I directly goto Transaction QE51N and double click t

  • SAP MRS -  Multi Resource Planning Tool

    Hi All, I am looking for 'introductionary' information on the SAP MRS tool. There is a thread already on this tool but it does not give basic data about functionality and implementaion etc.. (below) MRS (Multi Resource Scheduling) Does anyone have a

  • Best practice for preparation of install of Leopard from Tiger

    Hi all, I am about to upgrade my iMac with an Archive and Install of Leopard 10.5 from Tiger 10.4.11. I've done this dozens of times on other machines, but I never really thought about the best way to prepare for an install, I have already backed up

  • My display is different on iphone, My display is different on iphone

    I have tried to list my itunes music folder the way I want, but some artists are listed in capitals

  • DMVPN spoke to spoke not established

    In the topology attached I am advertising tunnel ip and loopbacks for the specific hub and spokes in their eigrp , there is connectivity between all but still Eigrp routes are not coming and its flapping.ISAKMP is on , tunnel is also up.I am also att