ALV - Label on a cell

Hi,
I don't remind if it's possible, maybe you can help me...
With an ALV ( in OO or not), how can I have a LABEL on a cell ?
For instance, the cell value is "test" and when my mouse is on this cell my label could be "My long text for my test is a beautifull text :-)".
Regards.
Mickael

Hi Mickael,
I'm not sure, if you can create 'labels' for text, but you can create labels (quickinfo) for icons like this:
move: ICON_GREEN_LIGHT to your_field,
         '\Qokay@' to your_field+3.
The text between '\Q' and '@' will appear as quickinfo, if the column 'your_field' is declared icon in the fieldcatalogue.
Hope this helps, kind regards, Kathrin!

Similar Messages

  • ALV Grid Drag & Drop - Cell-specific

    Hi ABAPers,
    I've referred SAP Standard program / SDN forum and got some logic for ALV Drag & Drop for row-specific, Column-specific and for Trees. But I didn't get for Cell-specific.
    My requirement is :
    If the user drags a particular cell to another cell in an ALV-grid, then that Cell value should be copied to the 'Dropped-Cell' in the ALV Grid and should be saved to that particular Internal Table.I have referred the SAP standard program BCALV_DND_03 which does from a different tree to a cell. My requirement is from the same ALV grid Table.
    I've also referred BCALV_DND_04 which is useful. But here, it does it for the whole row.
    Can anyone please help me in this?
    Thanks a lot.
    Best Regards,
    Sowmya

    TOP INCLUDE:
    DATA: BEGIN OF g_t_plan_alv_m OCCURS 0,
             header,
             count(5).
            INCLUDE STRUCTURE g_ze6spw_plan_alv.
    DATA:    handle_style         TYPE lvc_t_styl,
             handle_dragdrop      TYPE lvc_t_drdr,
             tabcolor             TYPE lvc_t_scol.
    DATA: END OF g_t_plan_alv_m.
    CLASS cl_gui_resources DEFINITION LOAD.
    CLASS lcl_events_dragdrop DEFINITION DEFERRED.
    DATA:
         BEGIN OF g_ty_s_outtab OCCURS 0,
           header,
             count(5).
            INCLUDE STRUCTURE g_ze6spw_plan_alv.
    DATA:     handle_style         TYPE lvc_t_styl,
             handle_dragdrop      TYPE lvc_t_drdr,
             tabcolor             TYPE lvc_t_scol,
           END   OF g_ty_s_outtab.
    DATA: g_field TYPE lvc_fname.
    DATA:
          gr_events              TYPE REF TO lcl_events_dragdrop,
          gr_dragdrop            TYPE REF TO cl_dragdrop,
          gr_dragdrop_background TYPE REF TO cl_dragdrop.
    CLASS lcl_events_dragdrop DEFINITION.
      PUBLIC SECTION.
        DATA: m_grid TYPE i.
        METHODS:
         ondrag               FOR EVENT ondrag
                              OF cl_gui_alv_grid
                              IMPORTING e_row
                                        e_column
                                        es_row_no
                                        e_dragdropobj,
         ondrop               FOR EVENT ondrop
                              OF cl_gui_alv_grid
                              IMPORTING e_row
                                        e_column
                                        es_row_no
                                        e_dragdropobj,
         ondropcomplete       FOR EVENT ondropcomplete
                              OF cl_gui_alv_grid
                              IMPORTING e_row
                                        e_column
                                        es_row_no
                                        e_dragdropobj,
         ondropgetflavor      FOR EVENT ondropgetflavor
                              OF cl_gui_alv_grid
                              IMPORTING e_row
                                        e_column
                                        es_row_no
                                        e_dragdropobj
                                        e_flavors.
    ENDCLASS.                    "LCL_DRAGDROP DEFINITION
    *       CLASS lcl_dragdrop_obj DEFINITION
    CLASS lcl_dragdrop_obj DEFINITION.
      PUBLIC SECTION.
        DATA: line  LIKE g_ty_s_outtab,
              index TYPE i.
    ENDCLASS.                    "lcl_dragdrop_obj DEFINITION
    CLASS lcl_events_dragdrop IMPLEMENTATION.
      METHOD ondrag.
        PERFORM event_ondrag USING e_row
                                   e_column
                                   e_dragdropobj.
      ENDMETHOD.                    "ondrag
      METHOD ondrop.
        PERFORM event_ondrop USING e_row
                                   e_column
                                   e_dragdropobj.
      ENDMETHOD.                    "ondrop
      METHOD ondropcomplete.
        PERFORM event_ondropcomplete USING e_row
                                           e_column
                                           e_dragdropobj.
      ENDMETHOD.                    "ondropcomplete
      METHOD ondropgetflavor.
        PERFORM event_ondropgetflavor USING e_row
                                            e_column
                                            es_row_no
                                            e_dragdropobj
                                            e_flavors.
      ENDMETHOD.                    "ondropgetflavor
    ENDCLASS.  "LCL_objdragdropapp IMPLEMENTATION
    FORM set_drag_drop.
      DATA:  l_effect                     TYPE i,
             l_dragdrop_handle            TYPE i,
             ls_dragdrop                  TYPE lvc_s_dd01,
             ls_drag_cell                 TYPE lvc_s_drdr,
             lt_drag_cells                TYPE lvc_t_drdr,
             ls_fcat                      TYPE lvc_s_fcat,
             l_field                      TYPE lvc_fname,
             l_source                     TYPE char1,
             l_target                     TYPE char1,
             l_alv_exclude_tab            TYPE ui_functions,
             l_variant                    TYPE disvariant.
      FIELD-SYMBOLS: <fs_brcp>  TYPE zreceipt,
                     <fs_bisu>  TYPE z_supply.
      CREATE OBJECT gr_dragdrop.
      CREATE OBJECT gr_dragdrop_background.
      CREATE OBJECT gr_events.
      SET HANDLER gr_events->ondrag
                  FOR g_plan_alv.
      SET HANDLER gr_events->ondrop
                  FOR g_plan_alv.
      SET HANDLER gr_events->ondropcomplete
                  FOR g_plan_alv.
      SET HANDLER gr_events->ondropgetflavor
                  FOR g_plan_alv.
      LOOP AT g_t_plan_alv_m.
        MOVE-CORRESPONDING g_t_plan_alv_m TO g_ty_s_outtab.
        APPEND g_ty_s_outtab.
      ENDLOOP.
      l_effect = cl_dragdrop=>move + cl_dragdrop=>copy.
      CALL METHOD gr_dragdrop->add
        EXPORTING
          flavor     = 'Line'                                   "#EC NOTEXT
          dragsrc    = c_on
          droptarget = c_on
          effect     = l_effect.
      CALL METHOD gr_dragdrop->get_handle
        IMPORTING
          handle = l_dragdrop_handle.
      ls_dragdrop-cntr_ddid = l_dragdrop_handle. "auch bei leerem Grid
      ls_dragdrop-grid_ddid = space.
      ls_dragdrop-col_ddid  = space.
      ls_dragdrop-row_ddid  = space.
      ls_dragdrop-fieldname = 'HANDLE_DRAGDROP'.
      g_plan_layo-s_dragdrop = ls_dragdrop.
      LOOP AT g_t_mat_index.
    *Bulk Issues
            CONCATENATE c_plan_alvm c_bisu g_t_mat_index-index INTO l_field.
            ASSIGN (l_field) TO <fs_bisu>.
            CLEAR l_field.
    *Bulk Receipts
            CONCATENATE c_plan_alvm c_brcp g_t_mat_index-index INTO l_field.
            ASSIGN (l_field) TO <fs_brcp>.
            CLEAR l_field.
        ls_drag_cell-fieldname  = <fs_brcp>."l_field.
        ls_drag_cell-dragdropid = l_dragdrop_handle.
        INSERT ls_drag_cell INTO TABLE lt_drag_cells.
        CLEAR ls_drag_cell.
        ls_drag_cell-fieldname  = <fs_bisu>."l_field. 9th May
        ls_drag_cell-dragdropid = l_dragdrop_handle.
        INSERT ls_drag_cell INTO TABLE lt_drag_cells.
        CLEAR ls_drag_cell.
      ENDLOOP.
      DATA: l_index   TYPE i,
            l_erg     TYPE i.
      LOOP AT g_t_plan_alv_m.
        l_index = sy-tabix.
        l_erg = sy-tabix MOD 2.
        IF l_erg EQ 0.
          g_t_plan_alv_m-handle_dragdrop = lt_drag_cells.
          g_t_plan_alv_m-tabcolor        = lt_tabcolor.
          MODIFY g_t_plan_alv_m INDEX l_index "FROM ls_outtab
                           TRANSPORTING handle_dragdrop
                                        tabcolor.
        ENDIF.
      ENDLOOP.
      LOOP AT g_t_plan_alv_m.
        l_index = sy-tabix.
        l_erg = sy-tabix MOD 2.
        IF l_erg EQ 0.
          g_t_plan_alv_m-handle_dragdrop = lt_drag_cells.
          g_t_plan_alv_m-tabcolor        = lt_tabcolor.
          MODIFY g_t_plan_alv_m INDEX l_index "FROM ls_outtab
                           TRANSPORTING handle_dragdrop
                                        tabcolor.
        ENDIF.
      ENDLOOP.
      CALL METHOD g_plan_alv->set_table_for_first_display
        EXPORTING
          is_variant           = l_variant
          i_save               = g_save
          is_layout            = g_plan_layo
          it_toolbar_excluding = l_alv_exclude_tab[]
        CHANGING
          it_outtab            = g_t_plan_alv_m[]"gt_outtab_source[]
          it_fieldcatalog      = g_t_plan_fcat[].
    ENDFORM.                    " DRAGDROP
    FORM event_ondrag  USING    e_row         TYPE lvc_s_row
                                e_column      TYPE lvc_s_col
                                e_dragdropobj TYPE REF TO
                                                cl_dragdropobject. "#EC
      DATA:
            l_obj     TYPE REF TO lcl_dragdrop_obj.
      CREATE OBJECT l_obj.
      READ TABLE g_t_plan_alv_m INDEX e_row-index. "9thMay
      IF sy-subrc EQ 0.
        l_obj->line           = g_t_plan_alv_m."ls_outtab.
        l_obj->index          = e_row-index.
        e_dragdropobj->object = l_obj.
      ENDIF.
    ENDFORM.                    " EVENT_ONDRAG
    FORM event_ondrop  USING    e_row         TYPE lvc_s_row
                                e_column      TYPE lvc_s_col
                                e_dragdropobj TYPE REF TO
                                                 cl_dragdropobject. "#EC
      DATA: l_obj     TYPE REF TO lcl_dragdrop_obj,
            ls_outtab LIKE g_ty_s_outtab.
      CREATE OBJECT l_obj.
      IF e_row-index IS INITIAL.
        e_row-index = 1.
      ENDIF.
      CATCH SYSTEM-EXCEPTIONS move_cast_error = 1.
        l_obj ?= e_dragdropobj->object.
        ls_outtab = l_obj->line.
        MODIFY g_t_plan_alv_m INDEX e_row-index.
      ENDCATCH.
      IF sy-subrc <> 0.
        CALL METHOD e_dragdropobj->abort.
      ENDIF.
    ENDFORM.                    " EVENT_ONDROP
    *&      Form  EVENT_ONDROPCOMPLETE
    *      -->P_E_ROW  text
    *      -->P_E_COLUMN  text
    *      -->P_E_DRAGDROPOBJ  text
    FORM event_ondropcomplete  USING    e_row         type lvc_s_row
                                          e_column      type lvc_s_col
                                          e_dragdropobj type ref to
                                                  cl_dragdropobject."#EC
      data: l_obj      type ref to lcl_dragdrop_obj,
            ls_stable  type lvc_s_stbl,
            lr_grid    type ref to cl_gui_alv_grid.
      ls_stable-row = c_on."con_true.
      ls_stable-col = c_on."con_true.
      catch system-exceptions move_cast_error = 1.
        l_obj ?= e_dragdropobj->object.
      endcatch.
              lr_grid ?= e_dragdropobj->droptargetctrl.
              call method lr_grid->refresh_table_display
                exporting
                  is_stable = ls_stable.
    ENDFORM.                    " EVENT_ONDROPCOMPLETE
    *&      Form  EVENT_ONDROPGETFLAVOR
    *      -->P_E_ROW  text
    *      -->P_E_COLUMN  text
    *      -->P_ES_ROW_NO  text
    *      -->P_E_DRAGDROPOBJ  text
    *      -->P_E_FLAVORS  text
    FORM event_ondropgetflavor  USING    p_e_row
                                         p_e_column
                                         p_es_row_no
                                         p_e_dragdropobj
                                         p_e_flavors.
    ENDFORM.                    " EVENT_ONDROPGETFLAVOR

  • OO ALV - How to highlight cell after value change

    Hi All,
    I have an OO ALV with an input enable column and would like to highlight a cell in a different color when the user changes it's value.
    I am using pr_data_changed->get_cell_value to check the cells value has changed and pr_data_changed->modify_cell to update the cell with the new value.
    The output table has a field called CELLCOLOR of type LVC_T_SCOL which I am using to highlight the cell in red:
             lw_cellcolor-fname = 'THISFIELD' .
             lw_cellcolor-color-col = '7'.
    The ALV layout is also correclty set using:   layout-ctab_fname = 'CELLCOLOR'
    All the above is working fine and the changed cell is highlighted HOWEVER it only works if I call METHOD g_grid->refresh_table_display
    Is there anyway to highlight the cell without calling method refresh_table_display??????
    I do not like to call method refresh_table_display in an ALV event. The main reason is if a user changes a cells value and at the same time selects the row for update then the method refresh_table_display wipes out the row selection marker.
    So Is there anyway to highlight the cell without calling method refresh_table_display??????
    All your help appreciated
    Che

    Try this way
    In the PAI use
    call method get_selected_rows
    This will get you the row index of the selected rows from the screen for example I_ROW
    In PBO
    call method g_grid->set_selected_rows
    exporting
      it_row_no = i_rows[].
    then call refresh_table_first_display
    So this one will keep row selection after the refresh_table_first_display method

  • Changing the ALV Label

    hi gurus,
    i hv to change the label of  field name EXNUM from AT1 to HECS in alv display... HOW I WILL DO THIS.. PLZ HELP ME
    iam using the code.
    PERFORM append_fldcat :
                              USING 'EXNUM' 'T_J_1IEXCDTL' 'J_1IEXCDTL'
    key space no_hot CHANGING fld_cat.
    FORM append_fldcat USING par_fldname par_tabname par_reftabname par_key
    par_seltext p_hotspot CHANGING pit_fldcat
    TYPE slis_t_fieldcat_alv.
      CLEAR ls_fieldcat.
      ls_fieldcat-tabname = par_tabname.
      ls_fieldcat-fieldname = par_fldname  .
      ls_fieldcat-ref_tabname = par_reftabname.
      ls_fieldcat-key = par_key .
      ls_fieldcat-seltext_m = par_seltext.
      ls_fieldcat-hotspot = p_hotspot.
        APPEND ls_fieldcat TO pit_fldcat.
    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
           EXPORTING
                i_callback_program       = repid
               I_CALLBACK_PF_STATUS_SET = 'STANDARD'
                 i_callback_user_command  = 'LINE_SELECTED'
                is_layout                = gs_layout
               it_special_groups        = gt_sp_group
                it_fieldcat              = gt_fieldcat[]
                it_events                = gt_events[]
                i_tabname_header         = 'FLD_HEADER'
                i_tabname_item           = 'T_J_1IEXCDTL'
               IS_PRINT                 = GS_PRINT
                is_keyinfo               = gs_keyinfo
               IS_VARIANT               = GS_VARIANT
                i_default                = 'X'
                i_save                   = 'A'
           TABLES
                t_outtab_header          = fld_header
                t_outtab_item            = t_j_1iexcdtl
                EXCEPTIONS
                program_error            = 1
                OTHERS                   = 2.
    ENDFORM.                    "alv_output

    Hi Manish,
    Since you have the fieldname, just search the fieldcatalog table (gt_fieldcat) for that field's entry. Then, change the description to HECS. Something like this:
    loop at gt_fieldcat into wa_fieldcat where fieldname = 'EXNUM'.
    or you can also say "loop at gt_fieldcat into wa_fieldcat where seltext_m = 'AT1'.
    wa_fieldcat-seltext_m = 'HECS'.
    modify gt_fieldcat from wa_fieldcat index sy-tabix.
    endloop.
    Hope this helps! Please revert if you need anything else!!
    Cheers,
    Shailesh
    Always provide feedback for helpful answers!!

  • ALV Object Model - Merged Cells

    Hi all
       When utilizing ALV Object Model, how do I display cells as merged when they have the same content?
       Can someone help me out?
       Thank you very much!

    Hello Yun
    In dialog cells are merged automatically as soon as you sort the column containing repeated values.
    Thus, when you call method SET_TABLE_FOR_FIRST_DISPLAY you should additionally provide parameter IT_SORT with the appropriate entries.
    For example, you want to sort your ALV list according to COL_A (1st) and COL_B (2nd):
    ls_sort-spos = 1.
    ls_sort-fieldname = 'COL_A'.
    ls_sort-up        = 'X'.  " sort ascending
    append ls_sort to lt_sort.
    ls_sort-spos = 2.
    ls_sort-fieldname = 'COL_B'.
    ls_sort-up        = 'X'.  " sort ascending
    append ls_sort to lt_sort.
    Regards
      Uwe

  • ALV color a particular cell on meeting certain condition

    hi all
         i am working with ALV , my requirement is to color a particular cell if condition mate.
    like .
       i have two fields in my ITAB  PlanedCost and ActualCost
    If ACTUALCOST is >= 80% of PLANEDCOST then
    ACTUALCOST cell must come in RED COLOR.
    how to do so .
    please guide me.

    Hi Rock,
            I tried a program to color a cell based on its value, but it is not working. Am pasting the code below and please can u exactly tell me what is the problem it.
    *& Report  ZSAPCOLV
    REPORT  zsapcolv.
    TABLES:mara.
    TYPES:BEGIN OF ty_mara,
          matnr TYPE mara-matnr,
          mtart TYPE mara-mtart,
          color1(4),
         END OF ty_mara.
    DATA:it_mara TYPE STANDARD TABLE OF ty_mara,
         it_color  TYPE TABLE  OF lvc_s_scol,
         wa_mara TYPE ty_mara,
         wa_color    TYPE lvc_s_scol,
         is_layout   TYPE lvc_s_layo.
    DATA: t_newtable TYPE REF TO data,
    t_newline  TYPE REF TO data.
    FIELD-SYMBOLS: <dyntab> TYPE STANDARD TABLE,
                   <wa_dyntab> TYPE ANY,
                   <gfs_wa> TYPE ANY.
    TYPES: BEGIN OF ty_cmara,
        matnr TYPE mara-matnr,
         mtart TYPE mara-mtart,
       tabcolor TYPE lvc_t_scol,
    END OF ty_cmara.   " Cell color
    DATA:it_cmara TYPE STANDARD TABLE OF ty_cmara.
    DATA:
          gr_table     TYPE REF TO cl_salv_table,
          gr_functions TYPE REF TO cl_salv_functions,
          gr_display   TYPE REF TO cl_salv_display_settings.
    DATA:   it_fcat TYPE lvc_t_fcat,
            wa_fcat TYPE lvc_s_fcat.
    DATA:it_fcat1 TYPE lvc_t_fcat, "with cell color
         it_fcat2 TYPE lvc_t_fcat,
    wa_fieldcat LIKE LINE OF it_fcat1,
    wa_cellcolors TYPE lvc_s_scol,
    wa_is_layout TYPE lvc_s_layo.
    FIELD-SYMBOLS:<t_cellcolors> TYPE lvc_t_scol,
    <w_field> TYPE ANY.
    DATA:t_line  TYPE REF TO data .
    *-----design selection screen for plant and material type.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-b01.
    SELECT-OPTIONS:
                     s_matnr     FOR mara-matnr.    "material type
    SELECTION-SCREEN END OF BLOCK b1.
    START-OF-SELECTION.
      PERFORM fetch_data.
      PERFORM display_data.
    *&      Form  fetch_data
    FORM fetch_data .
      DATA:wa_cmara TYPE ty_cmara.
      DATA: ls_tabcolor TYPE lvc_s_scol.
      SELECT
    FROM mara
        INTO CORRESPONDING FIELDS OF TABLE it_mara WHERE matnr IN s_matnr.
      CHECK sy-subrc EQ 0.
      PERFORM build_catalog USING '1' 'MATNR' 'Material number' 'Material Number' ' ' '18'.
      PERFORM build_catalog USING '1' 'MTART' 'Material type' 'Material type' ' ' '10'.
      it_fcat1[] = it_fcat[].
       wa_fieldcat-fieldname = 'T_CELLCOLORS'.
       wa_fieldcat-ref_field = 'COLTAB'.
       wa_fieldcat-ref_table = 'CALENDAR_TYPE'.
      APPEND wa_fieldcat TO it_fcat.
      cl_alv_table_create=>create_dynamic_table( EXPORTING it_fieldcatalog = it_fcat
                                                  IMPORTING ep_table = t_newtable ).
      ASSIGN t_newtable->* TO <dyntab>.
      CREATE DATA t_line LIKE LINE OF <dyntab>.
      ASSIGN t_line->* TO <gfs_wa>.
      PERFORM fill_data.
    ENDFORM.                    " fetch_data
    *&      Form  build_catalog
    FORM build_catalog  USING    p_pos TYPE lvc_colpos
                           p_field TYPE lvc_fname
                           p_reptext TYPE reptext
                           p_coltext TYPE coltext
                           p_check TYPE lvc_checkb
                           p_len TYPE lvc_outlen.
      wa_fcat-col_pos    = p_pos.
      wa_fcat-fieldname  = p_field.
      wa_fcat-reptext    = p_reptext.
      wa_fcat-checkbox   = p_check.
      wa_fcat-outputlen  = p_len.
      wa_fcat-emphasize = '6'.
      IF p_check = 'X'.
        wa_fcat-edit = 'X'.
      ENDIF.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
    ENDFORM.                    " catalog
    *&      Form  fill_data
    FORM fill_data .
      FIELD-SYMBOLS: <wa_tmp> TYPE ANY,
                     <v_fld> TYPE ANY,
                     <color> TYPE ANY,
                     <wa_color> TYPE lvc_s_scol.
      DATA: v_fld(20).
      DATA : lv_cnt TYPE i,
             t_newline1  type ref to data,
             lv_cnt1 TYPE i.
        FIELD-SYMBOLS: <ta_color> TYPE lvc_t_scol.
         DATA : field(15) TYPE c,
             col TYPE lvc_s_scol.
      create data t_newline1 LIKE <wa_color>.
      LOOP AT it_mara INTO wa_mara.
        lv_cnt1 = lv_cnt1 + 1.
        LOOP AT it_fcat INTO wa_fcat.
          UNASSIGN <wa_tmp>.
          ASSIGN COMPONENT wa_fcat-fieldname OF STRUCTURE <gfs_wa> TO <wa_tmp>.
          CONCATENATE 'WA_MARA-' wa_fcat-fieldname INTO v_fld.
          ASSIGN (v_fld) TO <v_fld>.
          CHECK sy-subrc EQ 0.
          IF <v_fld> = '000000000000000004'.
             col-fname = wa_fcat-fieldname.
             col-color-col = '5' .
             col-color-int = '0' .
              "ASSIGN COMPONENT wa_fcat-fieldname OF STRUCTURE <gfs_wa> TO <ta_color>.
               ASSIGN COMPONENT 'T_CELLCOLORS' OF STRUCTURE <gfs_wa> TO <ta_color> .
               APPEND col TO <ta_color>.
            <wa_tmp> = <v_fld>.
            lv_cnt = lv_cnt + 1.
          ENDIF.
          IF lv_cnt = 1.
            APPEND <gfs_wa> TO <dyntab>.
          ELSE.
            MODIFY <dyntab> INDEX lv_cnt1 FROM <gfs_wa>.
          ENDIF.
        ENDLOOP.
        lv_cnt = 0.
        CLEAR wa_mara.
      ENDLOOP.
    ENDFORM.                    " fill_data
    *&      Form  display_data
    FORM display_data .
    IF <dyntab> IS NOT INITIAL.
       LOOP AT <dyntab> INTO <gfs_wa>.
         ASSIGN COMPONENT 'MATNR' OF STRUCTURE <gfs_wa> TO <w_field>.
         ASSIGN COMPONENT 'T_CELLCOLORS' OF STRUCTURE <gfs_wa> TO <t_cellcolors> .
         CLEAR wa_cellcolors.
        "wa_cellcolors-fname = 'MATNR'.
         "IF <w_field> = '000000000000000004'.
           "FORMAT INTENSIFIED COLOR = 6.
           wa_cellcolors-fname = 'MATNR'.
           wa_cellcolors-color-col = '7'.
           wa_cellcolors-color-int = '1'.
           "wa_cellcolors-color-inv = '1'.
           "wa_cellcolors-NOKEYCOL = ''.
          "ELSE.
          "wa_cellcolors-color-col = '5'.
        "ENDIF.
         APPEND wa_cellcolors TO <t_cellcolors>.
         MODIFY <dyntab> FROM <gfs_wa>.
       ENDLOOP.
      cl_salv_table=>factory( IMPORTING r_salv_table = gr_table CHANGING t_table = <dyntab> ).
      gr_functions = gr_table->get_functions( ).
      gr_functions->set_all( abap_true ).
      gr_display = gr_table->get_display_settings( ).
      gr_display->set_striped_pattern( cl_salv_display_settings=>true ).
      gr_display->set_list_header( 'MARA DATA' ).
      gr_table->display( ).
      "ENDIF.
    ENDFORM.                    " display_data

  • ALV question: Changes in cells not updated in itab

    Hi experts,
    Please help this newbie here. I have problem with updating my internal table with multiple cells changes in my ALV. I've used the FM 'GET_GLOBALS_FROM_SLVC_FULLSCR' and the method 'CHECK_CHANGED_DATA'. When I debugged, I could see the changes being captured in ref1.
    How can I make sure that the changes were already updated into the itab new_antrag after I presses the button command 'EX_SEND'? The original program is leave program RPTARQUIATEST.
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
                                                      RS_SELFIELD LIKE SLIS_SELFIELD
    Data: ref1 type ref to cl_gui_alv_grid.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        IMPORTING
          E_GRID = ref1.
    call method ref1->check_changed_data.
    read table new_antrag index rs_selfield-index into wa_new_antrag.
    case r_ucomm.
      when 'EX_SEND'.
          perform before_prepare using rs_selfield
                                                new_antrag
                                       changing
                                                wa_new_antrag.
          perform request_check using req
                                                pernr
                                                modus
                                                check_command
                                                g_check_mode
                                        changing
                                                checked_req
                                                messages.
          perform request_exec using wa_new_antrag-request_id
                                                pernr
                                                modus
                                                c_cmd_exec_cmd
                                        changing
                                                exec_req
                                                messages.
          perform after_exec using exec_req.
      endcase.
    ENDFORM.
    Please help. Points will be awarded for constructive solutions which help in the problem solving. Thank you.
    Cheers,
    Damien

    Hi,
    where you are filling itab new_*  there write condition like  on ehich field you are expecting changes check with condition .
    after put sy-subrc variable if operation success fields are chnged with necessary changes.
    It can help you .
    try it once where you have written code for new_* table.
    reward points if usefull

  • Buttons in ALV Grid cell need focus to be clicked :-(

    Hi,
    I have an ALV Grid with single cells displayed as buttons (dependend on the data in the corresponding row). Unfortunatelly the button-cells need focus to be clicked. So you need two clicks: one to get the focus to the desired cell and one to really click the button.
    Any ideas how to make this work with one single click ? (Setting a hotspot does not work, cause hotspots have the same problem.)
    Regards,
    Tobi

    Hello Tobias
    The proposal by Naimesh is valid for CL_GUI_ALV_GRID, too. You may have a look at sample report ZUS_SDN_ALVGRID_EVENTS_HOTSPOT. Put the focus on any non-button cell and next click on any customer button.
    *& Report  ZUS_SDN_ALVGRID_EVENTS_HOTSPOT
    *& Thread: Buttons in ALV Grid cell need focus to be clicked :-(
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1009251"></a>
    REPORT  zus_sdn_alvgrid_events_hotspot.
    DATA:
      gd_okcode        TYPE ui_func,
      gt_fcat          TYPE lvc_t_fcat,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_grid1         TYPE REF TO cl_gui_alv_grid.
    DATA:
      go_table              TYPE REF TO cl_salv_table,
      go_grid_adapter       TYPE REF TO cl_salv_grid_adapter.
    DATA:
      gt_knb1          TYPE STANDARD TABLE OF knb1.
    PARAMETERS:
      p_bukrs      TYPE bukrs  DEFAULT '2000'  OBLIGATORY.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
          handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
            IMPORTING
              e_row_id
              e_column_id
              es_row_no
              sender,  " grid instance that raised the event
          handle_button_click FOR EVENT button_click OF cl_gui_alv_grid
            IMPORTING
              es_col_id
              es_row_no
              sender.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_hotspot_click.
    *   define local data
        DATA:
          ls_knb1     TYPE knb1,
          ls_col_id   TYPE lvc_s_col.
        READ TABLE gt_knb1 INTO ls_knb1 INDEX e_row_id-index.
        CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
        CASE e_column_id-fieldname.
          WHEN 'KUNNR'.
            SET PARAMETER ID 'KUN' FIELD ls_knb1-kunnr.
            SET PARAMETER ID 'BUK' FIELD ls_knb1-bukrs.
            CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
          WHEN 'ERNAM'.
    *        SET PARAMETER ID 'USR' FIELD ls_knb1-ernam.
    *        NOTE: no parameter id available, yet simply show the priciple
            CALL TRANSACTION 'SU01' AND SKIP FIRST SCREEN.
          WHEN OTHERS.
    *       do nothing
        ENDCASE.
    *   Set active cell to field BUKRS otherwise the focus is still on
    *   field KUNNR which will always raise event HOTSPOT_CLICK
        ls_col_id-fieldname = 'BUKRS'.
        CALL METHOD go_grid1->set_current_cell_via_id
          EXPORTING
            is_row_id    = e_row_id
            is_column_id = ls_col_id.
      ENDMETHOD.                    "handle_hotspot_click
      METHOD handle_button_click.
    *   define local data
        DATA:
          ls_knb1     TYPE knb1.
        READ TABLE gt_knb1 INTO ls_knb1 INDEX es_row_no-row_id.
        CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
        SET PARAMETER ID 'KUN' FIELD ls_knb1-kunnr.
        SET PARAMETER ID 'BUK' FIELD ls_knb1-bukrs.
        CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
      ENDMETHOD.                    "handle_button_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      SELECT        * FROM  knb1 INTO TABLE gt_knb1
             WHERE  bukrs  = p_bukrs.
    **  TRY.
    **      CALL METHOD cl_salv_table=>factory
    ***      EXPORTING
    ***      LIST_DISPLAY   = IF_SALV_C_BOOL_SAP=>FALSE
    ***      R_CONTAINER    =
    ***      CONTAINER_NAME =
    **        IMPORTING
    **          r_salv_table   = go_table
    **        CHANGING
    **          t_table        = gt_knb1.
    **    CATCH cx_salv_msg .
    **  ENDTRY.
    **  go_table->display( ).
    **  go_table->get_metadata( ).
    **  EXIT.
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent = cl_gui_container=>screen0
          ratio  = 90
        EXCEPTIONS
          OTHERS = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Create ALV grid
      CREATE OBJECT go_grid1
        EXPORTING
          i_parent = go_docking
        EXCEPTIONS
          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.
    * Set event handler
      SET HANDLER:
        lcl_eventhandler=>handle_hotspot_click FOR go_grid1,
        lcl_eventhandler=>handle_button_click  FOR go_grid1.
    * Build fieldcatalog and set hotspot for field KUNNR
      PERFORM build_fieldcatalog_knb1.
    * Display data
      CALL METHOD go_grid1->set_table_for_first_display
        CHANGING
          it_outtab       = gt_knb1
          it_fieldcatalog = gt_fcat
        EXCEPTIONS
          OTHERS          = 4.
      IF sy-subrc <> 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
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = syst-repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * ok-code field = GD_OKCODE
      CALL SCREEN '0100'.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.
    *  SET TITLEBAR 'xxx'.
    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.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  BUILD_FIELDCATALOG_KNB1
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_fieldcatalog_knb1 .
    * define local data
      DATA:
        ls_fcat        TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
    *     I_BUFFER_ACTIVE              =
          i_structure_name             = 'KNB1'
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
    *     I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = gt_fcat
        EXCEPTIONS
          inconsistent_interface       = 1
          program_error                = 2
          OTHERS                       = 3.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP AT gt_fcat INTO ls_fcat
              WHERE ( fieldname = 'KUNNR'  OR
                      fieldname = 'ERNAM'  OR
                      fieldname = 'BUKRS' ).
        IF ( ls_fcat-fieldname = 'BUKRS' ).
          ls_fcat-style = cl_gui_alv_grid=>mc_style_button.
          " column appears as button
        ELSEIF ( ls_fcat-fieldname = 'KUNNR' ).
          ls_fcat-style = cl_gui_alv_grid=>mc_style_button.
          ls_fcat-hotspot = abap_true.
        ELSE.
          ls_fcat-hotspot = abap_true.
        ENDIF.
        MODIFY gt_fcat FROM ls_fcat.
      ENDLOOP.
    ENDFORM.                    " BUILD_FIELDCATALOG_KNB1
    Regards
      Uwe

  • Fill colors to ALV cells

    Hi All,
    How can I display multiple colors to different cells in an ALV ?.
    Please help..
    Thanks in advance,
    sudeep v d..

    Hi Sudeep,
    In the below mentioned link a topic Color of ALV output, columns, and cells has been mentioned in the section '4.17.3 Appearance of ALV Output'.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/db22242d-0701-0010-28a2-aeaa1fefd706
    Best regards,
    Suresh

  • Freely-programmed value help for a single ALV cell

    Greetings everyone,
    I have a freely-programmed value help that works beautifully when attached to the context element of a single field, but now I'm needing to use it in an ALV for a specific cell.  Is there a way to shut off the dropdown for all of the rows (cells) in the column where I don't need it?  Or, is there an appropriate workaround that can deliver the same results?
    I've found several posts that address similar issues, but nothing for this exact problem.
    Thanks,
    Jason Block

    I take it from reading your description what you want is a little more complicated than just controlling the read-only property on the input field. If I read you properly you still want to have all the cells in a column to be open for input, just on some of them you want to disable the value help.  Is that correct?  See these screen shots for clarification:
    If you focus on the the input field in the first row, you get the value help:
    http://www.flickr.com/photos/tjung/2714133068/
    However if you go to the second row and focus on the same input field in this column, you don't get the value help:
    http://www.flickr.com/photos/tjung/2714133094/
    If this is what you want, then buckel up because this was a challenging one.  The problem is that the value help specification is not done at the UI element level, but instead at the context attribute level.  Therefore it can't be as simple as controlling a property on the inputField itself.  What you will need to do is extend the context node that you have bound to the ALV.  You need to add a second version of the attribute that is bound to your input field.  In this second version you can set the value help specification to Disabled:
    http://www.flickr.com/photos/tjung/2713320505
    Notice from the screen shot that I also added another attirbute called CVAR (type STRING).  We will need that later.  It will be used to store which cell variant show be used on a particular row.
    Now we must go to the place in your code where you fill the context node with data.  You will need to copy the data from your primary attribute to your secondary one.  In my case I was copying the values from CARRID to CARRID2.  Of course for update, you would need to merge the data back together before saving it back to the database.  I also set a simple odd/even pattern of controller in the cell variant.  I assume you will have some actual business logic that controls this:
    data odd type boolean value abap_true.
       loop at lt_f_r_sflight[] assigning <ls_f_r_sflight>.
        clear ls_c_r_sflight.
        move-corresponding <ls_f_r_sflight> to ls_c_r_sflight.
        move <ls_f_r_sflight>-carrid to ls_c_r_sflight-carrid2.
        if odd = abap_true.
          odd = abap_false.
        else.
          odd = abap_true.
          ls_c_r_sflight-cvar = 'NOVH'.
        endif.
        insert ls_c_r_sflight into table lt_c_r_sflight[].
      endloop.
      lo_r_sflight->bind_table( lt_c_r_sflight[] ).
    Next is the logic in the initialization of the ALV.  We will need to create two input fields - each bound to the different context attributes. We will make the one the primary cell editor.  The other will become the cell editor of the cell variant.  We then tell the column where it can get its cell variant value from:
    DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
      lo_cmp_usage =   wd_this->wd_cpuse_alv( ).
      IF lo_cmp_usage->has_active_component( ) IS INITIAL.
        lo_cmp_usage->create_component( ).
      ENDIF.
      DATA l_salv_wd_table TYPE REF TO iwci_salv_wd_table.
      l_salv_wd_table = wd_this->wd_cpifc_alv( ).
      DATA l_table TYPE REF TO cl_salv_wd_config_table.
      l_table = l_salv_wd_table->get_model( ).
      l_table->if_salv_wd_table_settings~set_read_only( abap_false ).
      DATA input1 TYPE REF TO cl_salv_wd_uie_input_field.
      DATA l_column TYPE REF TO cl_salv_wd_column.
      l_column = l_table->if_salv_wd_column_settings~get_column( 'CARRID' ).
      CREATE OBJECT input1
        EXPORTING
          value_fieldname = 'CARRID'.
      l_column->set_cell_editor( input1 ).
      DATA input2 TYPE REF TO cl_salv_wd_uie_input_field.
      CREATE OBJECT input2
        EXPORTING
          value_fieldname = 'CARRID2'.
      DATA l_cv TYPE REF TO cl_salv_wd_cv_standard.
      CREATE OBJECT l_cv.
      l_cv->set_key( 'NOVH' ).
      l_cv->set_editor(  input2 ).
      l_column->add_cell_variant( l_cv ).
      l_column->set_sel_cell_variant_fieldname( 'CVAR' ).

  • Editable cell in ALV OO with F4 Help

    Hi Abapers,
    i have an ALV with an editable cell wich an F4 help is available on it. When clicking on the F4 button i'm getting the list of possible values but when choosing a value it is not updating the alv cell. (F4 help is on a Z* field wich i created already with its matchcode).
    Does anyone have a piece of code wich can help ?
    Thanks in advance,
    Soufiane

    Hi,
    Check the following code:
    *Type pools for alv
    TYPE-POOLS : slis.*structure for t582a tbale
    TYPES : BEGIN OF ty_table,
            infty TYPE infty,
            pnnnn TYPE pnnnn_d,
            zrmkz TYPE dzrmkz,
            zeitb TYPE dzeitb,
            dname TYPE dianm,
             davo TYPE davo,
            davoe TYPE davoe,
            END OF ty_table.*Structure for infotype text
    TYPES : BEGIN OF ty_itext,
            infty TYPE infty,
            itext TYPE intxt,
            sprsl TYPE sprsl,
            END OF ty_itext.*Structure for output display
    TYPES : BEGIN OF ty_output,
            infty TYPE infty,
            itext TYPE intxt,
            pnnnn TYPE pnnnn_d,
            zrmkz TYPE dzrmkz,
            zeitb TYPE dzeitb,
            dname TYPE dianm,
            davo TYPE davo,
            davoe TYPE davoe,
           END OF ty_output.*internal table and work area declarations
    DATA : it_table TYPE STANDARD TABLE OF ty_table INITIAL SIZE 0,
           it_output TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0,
           it_pbo TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0,
           it_ittext TYPE STANDARD TABLE OF ty_itext INITIAL SIZE 0,
           wa_table TYPE ty_table,
           wa_output TYPE ty_output,
           wa_ittext TYPE ty_itext.*Data declarations for dropdown lists for f4
    DATA: it_dropdown TYPE lvc_t_drop,
          ty_dropdown TYPE lvc_s_drop,
    *data declaration for refreshing of alv
          stable TYPE lvc_s_stbl.*Global variable declaration
    DATA: gstring TYPE c.
    *Data declarations for ALV
    DATA: c_ccont TYPE REF TO cl_gui_custom_container,         "Custom container object
          c_alvgd         TYPE REF TO cl_gui_alv_grid,         "ALV grid object
          it_fcat            TYPE lvc_t_fcat,                  "Field catalogue
          it_layout          TYPE lvc_s_layo.                  "Layout*ok code declaration
    DATA:
      ok_code       TYPE ui_func.
    initialization eventINITIALIZATION.start of selection event
    START-OF-SELECTION.*select the infotypes maintained
      SELECT infty
              pnnnn
              zrmkz
              zeitb
              dname
              davo
              davoe
              FROM t582a UP TO 10 ROWS
              INTO CORRESPONDING FIELDS OF TABLE it_table.* *Select the infotype texts
      IF it_table[] IS NOT INITIAL.
        SELECT itext
                 infty
                 sprsl
                 FROM t582s
                 INTO CORRESPONDING FIELDS OF TABLE it_ittext
                 FOR ALL ENTRIES IN it_table
                 WHERE infty = it_table-infty
                 AND sprsl = 'E'.
      ENDIF.
    *Apppending the data to the internal table of ALV output
      LOOP AT it_table INTO wa_table.    wa_output-infty = wa_table-infty.
        wa_output-pnnnn = wa_table-pnnnn.
        wa_output-zrmkz = wa_table-zrmkz.
        wa_output-zeitb = wa_table-zeitb.
        wa_output-dname = wa_table-dname.
        wa_output-davo = wa_table-davo.
        wa_output-davoe = wa_table-davoe.* For texts    READ TABLE it_ittext INTO wa_ittext WITH KEY infty = wa_table-infty.
        wa_output-itext = wa_ittext-itext.
        APPEND wa_output TO it_output.
        CLEAR wa_output.  ENDLOOP.* Calling the ALV screen with custom container  CALL SCREEN 0600.*On this statement double click  it takes you to the screen painter SE51.
    *Enter the attributes
    *Create a Custom container and name it CCONT and OK code as OK_CODE.
    *Save check and Activate the screen painter.
    *Now a normal screen with number 600 is created which holds the ALV grid.
    PBO of the actual screen ,
    Here we can give a title and customized menus
    *create 2 buttons with function code 'SAVE' and 'EXIT'.
    GIVE A SUITABLE TITLE&---------------------------------------------------------------------
    *&      Module  STATUS_0600  OUTPUT
          text
    MODULE status_0600 OUTPUT.
      SET PF-STATUS 'DISP'.
      SET TITLEBAR 'ALVF4'.
    ENDMODULE.                 " STATUS_0600  OUTPUT
    calling the PBO module ALV_GRID.
    *&      Module  PBO  OUTPUT
          text
    MODULE pbo OUTPUT.*Creating objects of the container
      CREATE OBJECT c_ccont
           EXPORTING
              container_name = 'CCONT'.*  create object for alv grid
      create object c_alvgd
      exporting
      i_parent = c_ccont.*  SET field for ALV
      PERFORM alv_build_fieldcat.* Set ALV attributes FOR LAYOUT
      PERFORM alv_report_layout.
      CHECK NOT c_alvgd IS INITIAL.* Call ALV GRID  CALL METHOD c_alvgd->set_table_for_first_display
        EXPORTING
          is_layout                     = it_layout
          i_save                        = 'A'
        CHANGING
          it_outtab                     = it_output
          it_fieldcatalog               = it_fcat
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.ENDMODULE.                 " PBO  OUTPUT&----
    *&      Form  alv_build_fieldcat
          text
         <--P_IT_FCAT  text
    *subroutine to build fieldcatFORM alv_build_fieldcat.  DATA lv_fldcat TYPE lvc_s_fcat.
      CLEAR lv_fldcat.  lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '1'.
      lv_fldcat-fieldname = 'INFTY'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 8.
      lv_fldcat-scrtext_m = 'Infotype'.
      lv_fldcat-icon = 'X'.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.  lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '2'.
      lv_fldcat-fieldname = 'PNNNN'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 15.
      lv_fldcat-scrtext_m = 'Structure'.
      lv_fldcat-icon = ''.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.  lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '3'.
      lv_fldcat-fieldname = 'ITEXT'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 60.
      lv_fldcat-scrtext_m = 'Description'.
      lv_fldcat-icon = ''.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '5'.
      lv_fldcat-fieldname = 'ZRMKZ'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 1.
      lv_fldcat-scrtext_m = 'PERIOD'.
      lv_fldcat-icon = ''.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.  lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '6'.
      lv_fldcat-fieldname = 'ZEITB'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 5.
      lv_fldcat-scrtext_m = 'Time constraint'.
      lv_fldcat-edit = 'X'.
    *To avail the existing F4 help these are to
    *be given in the field catalogue
      lv_fldcat-f4availabl = 'X'.
      lv_fldcat-ref_table = 'T582A'.
      lv_fldcat-ref_field = 'ZEITB'.  APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.  lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '7'.
      lv_fldcat-fieldname = 'DNAME'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 15.
      lv_fldcat-scrtext_m = 'Dialogmodule'.
      lv_fldcat-icon = ''.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.  lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '8'.
      lv_fldcat-fieldname = 'DAVO'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 15.
      lv_fldcat-scrtext_m = 'Start'.
      lv_fldcat-edit = 'X'.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.  lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '9'.
      lv_fldcat-fieldname = 'DAVOE'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 15.
      lv_fldcat-scrtext_m = 'End'.
      lv_fldcat-icon = ''.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
    *To create drop down for the field 'DAVO'
    with our own f4 help
      ty_dropdown-handle = '1'.
      ty_dropdown-value = ' '.
      APPEND ty_dropdown TO it_dropdown.
      ty_dropdown-handle = '1'.
      ty_dropdown-value = '1'.
      APPEND ty_dropdown TO it_dropdown.
      ty_dropdown-handle = '1'.
      ty_dropdown-value = '2'.
      APPEND ty_dropdown TO it_dropdown.
      ty_dropdown-handle = '1'.
      ty_dropdown-value = '3'.
      APPEND ty_dropdown TO it_dropdown.  CALL METHOD c_alvgd->set_drop_down_table
        EXPORTING
          it_drop_down = it_dropdown.
      LOOP AT it_fcat INTO lv_fldcat.
        CASE lv_fldcat-fieldname.
    To assign dropdown in the fieldcataogue
          WHEN 'DAVO'.
            lv_fldcat-drdn_hndl = '1'.
            lv_fldcat-outputlen = 15.
            MODIFY it_fcat FROM lv_fldcat.
        ENDCASE.
      ENDLOOP.ENDFORM.                    " alv_build_fieldcat&----
    *&      Form  alv_report_layout
          text
         <--P_IT_LAYOUT  text
    *Subroutine for setting alv layout
    FORM alv_report_layout.
      it_layout-cwidth_opt = 'X'.
      it_layout-col_opt = 'X'.
      it_layout-zebra = 'X'.ENDFORM.                    " alv_report_layout* PAI module of the screen created. In case we use an interactive ALV or
    *for additional functionalities we can create OK codes
    *and based on the user command we can do the coding.
    *&      Module  PAI  INPUT
          text
    MODULE pai INPUT.*To change the existing values and refresh the grid
    *And only values in the dropdown or in the default
    *F4 can be given , else no action takes place for the dropdown
    *and error is thrown for the default F4 help and font changes to red
    and on still saving, value is not changed  c_alvgd->check_changed_data( ).Based on the user input
    *When user clicks 'SAVE;
      CASE ok_code.    WHEN 'SAVE'.*A pop up is called to confirm the saving of changed data
          CALL FUNCTION 'POPUP_TO_CONFIRM'
            EXPORTING
              titlebar       = 'SAVING DATA'
              text_question  = 'Continue?'
              icon_button_1  = 'icon_booking_ok'
            IMPORTING
              answer         = gstring
            EXCEPTIONS
              text_not_found = 1
              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.*When the User clicks 'YES'
          IF ( gstring = '1' ).
            MESSAGE 'Saved' TYPE 'S'.
    *Now the changed data is stored in the it_pbo internal table
            it_pbo = it_output.
    *Subroutine to display the ALV with changed data.
            PERFORM redisplay.
          ELSE.
    *When user clicks NO or Cancel
            MESSAGE 'Not Saved'  TYPE 'S'.
          ENDIF.
    **When the user clicks the 'EXIT; he is out
        WHEN 'EXIT'.
          LEAVE PROGRAM.
      ENDCASE.  CLEAR: ok_code.ENDMODULE.                 " PAI  INPUT
    *&      Form  REDISPLAY
          text
    -->  p1        text
    <--  p2        text
    FORM redisplay .*Cells of the alv are made non editable after entering OK to save  CALL METHOD c_alvgd->set_ready_for_input
        EXPORTING
          i_ready_for_input = 0.*Row and column of the alv are refreshed after changing values  stable-row = 'X'.
      stable-col = 'X'.*REfreshed ALV display with the changed values
    *This ALV is non editable and contains new values
      CALL METHOD c_alvgd->refresh_table_display
        EXPORTING
          is_stable = stable
        EXCEPTIONS
          finished  = 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.ENDFORM.                    " REDISPLAY
    Regards,
    Bhaskar

  • History list in an ALV editable cell

    Hello
    I am trying to have a history list in my ALV editable cells as per described in the ALV Grid SAP documentation but I am unable to do so.  The documentation indicates that u201Cif the cursor is on the first item cell you can use Backspace to call up a history listu201D.
    I created a screen containing regular standard fields in the upper portion of the screen and I added an ALV grid (split into 3 sections) in the low part of the screen.  The ALV contain several editable cells.  The history list works very well for the regular fields on the screen but I cannot get the history list working for any of the editable cells in the ALV.
    I have defined the field catalog for the editable cells as follows (including the AUTO_VALUE field):
      CLEAR wa_fieldcat.
      wa_fieldcat-fieldname = 'SERNR'.
      wa_fieldcat-reptext   = text-002.
      wa_fieldcat-edit      = 'X'.
      wa_fieldcat-auto_value = 'X'.
      wa_fieldcat-checkbox  = ' '.
      wa_fieldcat-hotspot   = ' ' .
      wa_fieldcat-dd_outlen = ' '.
      wa_fieldcat-icon      = ' '.
      wa_fieldcat-no_zero   = 'X'.           
      APPEND wa_fieldcat TO it_fieldcat_notif.
    I then generate the 3 splitted ALV as follows:
      zlayout_header-grid_title = 'Repair Order and Delivery'.
      zlayout_header-no_toolbar = 'X'.
      zlayout_header-stylefname = 'CELLTAB'.
      CALL METHOD ob_grid1->set_table_for_first_display
        EXPORTING
          is_variant       =  ls_vari
          i_default        = ' '
          i_save           = 'A'
          is_layout        = zlayout_header
        CHANGING
          it_fieldcatalog  = it_fieldcat_repair
          it_outtab        = t_repair[].
      zlayout_header-grid_title = 'Notification'.
      zlayout_header-no_toolbar = 'X'.
      zlayout_header-stylefname = 'CELLTAB'.
      CALL METHOD ob_grid2->set_table_for_first_display
        EXPORTING
          is_variant       =  ls_vari
          i_default        = ' '
          i_save           = 'A'
          is_layout       = zlayout_header
        CHANGING
          it_fieldcatalog = it_fieldcat_notif
          it_outtab       = t_notif[].
      zlayout_header-grid_title = 'Service Order'.
      zlayout_header-no_toolbar = 'X'.
      zlayout_header-stylefname = 'CELLTAB'.
      CALL METHOD ob_grid3->set_table_for_first_display
        EXPORTING
          is_variant       =  ls_vari
          i_default        = ' '
          i_save           = 'A'
          is_layout       = zlayout_header
        CHANGING
          it_fieldcatalog = it_fieldcat_service
          it_outtab       = t_service[].
    I searched forums and OSS notes but I could not find any more information (except for the ALV Grid u2013 SAP Documentation) about the history list for editable ALV cells.  Currently, our application utilizes table controls in the lower part of the screen and the history list works well for the cells in the table control.  However, when I replace the table control for an ALV grid, I can no longer use the history list for those cells.
    Any help would be appreciated.

    Looks like the 2006 OSS note 825068 indicates the history list function is not supported for ALV grid.

  • Set alv cells Obligatory

    Hi All,
    I created an ALV GRID with editable cells but i'm not finding how to make thows cells obligatory.
    Help me please !!!!
    Regards.
    iMedix

    hi,
        Check the final internal table once user does action on grid eg: save or update and throw error( if desired fields left blank) of mandatory fields..
    Thanks,
    Gaurav.

  • ALV Grid editing cell cursor position

    Hello !
    i hope i can get the answer to my question here.
    i have an alv-grid with editable cells
    when i click in one cell (it is a textfield) where there is no more written text it marks the hole cell and when i start to write, it overwrites the whole text.
    i would like the cursor to be placed at the end of the field in this case.
    when i click in the cell where there is written text it is ok - it puts the cursor to the clicked position.
    thanks very much for your help
    Helmut

    Hi, i am also facing same probelm.
    after  call method sender->refresh_table_display.
    i am using
    call method sender->set_current_cell_via_id
          exporting
            is_row_id    = l_rowid
            is_column_id = l_colid.
    this will simply select the cell. i am not able to see curser in end or front of the cell.Can anybody please suggest me how to it.
    Thanks
    Sudhakar

  • ALV - How to hide yellow color in first cell

    Hello ALV experts!
    I am using 7 ALV layouts in one screen with one main screen and 6 small layouts with nine cells each. My objective is to enter data data in main ALV which updates the cells in the remaining ALV layouts.
    In all the six ALV alyouts, I am getting the first cell with yellow color (highlighted) which makes screen look awkward. Do you have any idea how to hide that color. ALso I would apprecaite if any of you know how to make the column fixed (when you pull the vertcal line between columns, it should not move).
    I am using OOPS ALV grid control.
    thanks!
    Senthil

    Hi,
    TO fix a column, in the filedcatalogfor the particular column which u want to fix give as
    DATA: fcat LIKE LVC_S_FCAT.
    fcat-fieldname  = 'MATNR'.
    fcat-<b>FIX_COLUMN = 'X'.</b>
    Hope this helps.

Maybe you are looking for

  • Error in installing oracle 9ids

    hi, i try installing oracle 9ids this error occured "Invalid staging area. There are no top level components for windows 98 available for installation in this staging area." please help

  • How to track user visit my page via search engine(google)

    hi there, is it possible to track that an user visited my page via search engine ( i.e google) using servlet? what will request.getHeader("user-agent"); return if an user comes via search engine. will it return as "google" or just the browser name. i

  • Is DTS supported in SQL server 2008 R2 with Compatibility level 100?

    We have a DTS package which executes one stored procedure. We have recently switched SQL server compatibility level from 80 to 100.  On Compatibility level 80 it was working fine. When i switched the level to 100, and executes DTS it shows successful

  • Z Infocube based on existing Infocube

    Hello Experts, I have a requirement in which I have to create a Z infocube by creating Z infoobjects in (say systemB) based on Infoobjects used in Infocube which is in another system (say systemA). I dont have any kind of access to the existing infoc

  • Why does 'Switch to Fluid Grid View' toggle button not working?

    I don't see the grids in the Fluid Grid Layout and nothing happens this button's On/Off stages. Also getting an error 'Could not find Dreamweaver Fluid Grid style sheet.' when inserting any element as Fluid Element. Please help, thanks.