F4 Help on Date Field after ALV is generated

Hi all,
Now this might sound very simple question, but Im having some difficulty in this.
My idea is to have an F4 on a date field after the ALV Grid report is executed. From the forum search, Ive got such answers as
l_fieldcat-edit         = 'X'.
l_fieldcat-F4AVAILABL = 'X'.
Now the problem with this is that Im getting an error saying:
The data object "l_fieldcat does not have a component called "F4AVAILABL".
And then I tried this:
l_fieldcat-fieldname    = 'DDATE'.
l_fieldcat-ref_tabname = 'ZCST001'.
Now at the report output when I press F4 on the date field it gives me a dump saying:
Field symbol has not yet been assigned.
Error in the ABAP Application Program
The current ABAP program "CL_GUI_ALV_GRID===============CP" had to be terminated because it has come across a statement that unfortunately cannot be executed.
So Im kinda stuck now. Appreciate your suggestions.
PS: Im on ECC6.
PPS:The intended F4 on field is a custom field in a custom table.
pk

Run This:
report ztest.
TYPE-POOLS : slis.
tables:mara,makt.
data: begin of it_final occurs 0,
matnr like mara-matnr,
ERSDA like mara-ERSDA,
end of it_final.
DATA: it_fieldcat     TYPE slis_t_fieldcat_alv,
      wa_fieldcat     TYPE slis_fieldcat_alv,
      wa_layout       TYPE slis_layout_alv,
      g_repid         TYPE sy-repid.
START-OF-SELECTION.
select matnr ERSDA into table it_final from mara up to 10 rows.
  g_repid = sy-repid.
  PERFORM f_populate_fieldcat.
*  PERFORM fill_zpayroll.
  PERFORM f_call_alv.
*&      Form  f_populate_fieldcat
*       text
*  -->  p1        text
*  <--  p2        text
form f_populate_fieldcat .
"Mat Number
  CLEAR wa_fieldcat.
  wa_fieldcat-tabname     = it_final.
  wa_fieldcat-fieldname   = 'MATNR'.
  wa_fieldcat-seltext_l   = 'MAT No.'.
  wa_fieldcat-outputlen   = 15.
  APPEND wa_fieldcat TO it_fieldcat.
  "Creation date
  CLEAR wa_fieldcat.
  wa_fieldcat-tabname     = it_final.
  wa_fieldcat-fieldname   = 'ERSDA'.
  wa_fieldcat-edit         = 'X'.
wa_fieldcat-REF_TABname = 'MARA'.
wa_fieldcat-REF_FIELDname = 'ERSDA'.
  wa_fieldcat-seltext_l   = 'Creation date '.
  wa_fieldcat-outputlen   = 15.
  APPEND wa_fieldcat TO it_fieldcat.
endform.                    " f_populate_fieldcat
*&      Form  f_call_alv
*       text
*  -->  p1        text
*  <--  p2        text
form f_call_alv .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program     = g_repid
      i_callback_top_of_page = 'TOP-OF-PAGE'
      is_layout              = wa_layout
      it_fieldcat            = it_fieldcat[]
      I_SAVE = 'A'
    TABLES
      t_outtab               = it_final
    EXCEPTIONS
      program_error          = 1
      OTHERS                 = 2.
  IF sy-subrc <> 0.
    EXIT.
  ENDIF.
endform.                    " f_call_alv
In custom table date field must be referenced to DATS.
P.S.I hope you already solved
Cheers

Similar Messages

  • How to display date field in ALV in format 'YYYY-MM-DD'?

    Hi experts,
    I am not getting displayed the date field in ALV in the format 'YYYY-MM-DD' if it is different than my user setting's format (DD.MM.YYYY).
    Tried with the edit mask
    LVC_S_FCAT-EDIT_MASK = '____-__-__'  but it does not work.
    I could not find the conversion routine for this. Is it possible to write customer conversion routine?
    I have to use DATE field, otherwise if I display this format in CHAR10 field , sorting in ALV does not work for this field.
    PLEASE ANY HELP!
    Kind regards,
    Danijela

    Hi,
    Use FM FORMAT_DATE_4_OUTPUT.
    TYPE-POOLS : slis, KKBLO.
    TYPES: BEGIN OF t_data,
           sel     TYPE char1,
           matnr   TYPE matnr,
           bldat   type char10,
           END OF t_data.
    DATA: it_tab TYPE STANDARD TABLE OF t_data,
          it_fcat TYPE slis_t_fieldcat_alv.
    DATA: wa_tab TYPE t_data,
          wa_fcat TYPE slis_fieldcat_alv,
          wa_layout type SLIS_LAYOUT_ALV.
    data: lv_repid    TYPE syrepid.
    data : lv_date    type NLEI-IBGDT,
           lv_outdate type RN1DATUM-DATEX,
           lv_format  type RN1DATUM-FORMAT value 'YYYY-MM-DD'.
    lv_repid = sy-repid.
    lv_date = sy-datum.
    CALL FUNCTION 'FORMAT_DATE_4_OUTPUT'
      EXPORTING
        datin         = lv_date
        format        =  lv_format
    IMPORTING
       DATEX         = lv_outdate.
       move lv_outdate to wa_tab-bldat.
    wa_tab-matnr = '0000001'.
    APPEND wa_tab TO it_tab.
    lv_date = sy-datum + 1.
    CALL FUNCTION 'FORMAT_DATE_4_OUTPUT'
      EXPORTING
        datin         = lv_date
        format        =  lv_format
    IMPORTING
       DATEX         = lv_outdate.
       move lv_outdate to wa_tab-bldat.
    wa_tab-matnr = '0000002'.
    APPEND wa_tab TO it_tab.
    lv_date = sy-datum + 2.
    CALL FUNCTION 'FORMAT_DATE_4_OUTPUT'
      EXPORTING
        datin         = lv_date
        format        =  lv_format
    IMPORTING
       DATEX         = lv_outdate.
       move lv_outdate to wa_tab-bldat.
    wa_tab-matnr = '0000003'.
    APPEND wa_tab TO it_tab.
    wa_fcat-fieldname = 'SEL'.
    wa_fcat-ref_fieldname = 'XCHPF'.
    wa_fcat-ref_tabname = 'MARA'.
    wa_fcat-edit = 'X'.
    wa_fcat-checkbox = 'X'.
    APPEND  wa_fcat TO  it_fcat.
    CLEAR :  wa_fcat.
    wa_fcat-fieldname = 'MATNR'.
    wa_fcat-ref_fieldname = 'MATNR'.
    wa_fcat-ref_tabname = 'MARA'.
    APPEND  wa_fcat TO  it_fcat.
    CLEAR :  wa_fcat.
    wa_fcat-fieldname = 'BLDAT'.
    wa_fcat-ref_fieldname = 'BLDAT'.
    wa_fcat-ref_tabname = 'BKPF'.
    APPEND  wa_fcat TO  it_fcat.
    call 'REUSE_ALV_GRID_DISPLAY'' after this
    Edited by: Ankur Parab on Oct 1, 2009 2:50 PM
    Edited by: Ankur Parab on Oct 1, 2009 2:51 PM

  • How to add F1 help for a field on ALV grid

    Hi All,
    When we execute a program, the output is displayed using ALV grid.
    on the ALV grid, if we press F1 on a field, it should popup the help document.
    How to add F1 help for a field on ALV grid.
    Thank you all in advance.

    fill field LVC_S_FCAT-ROLLNAME of your fieldcatalog in method SET_TABLE_FOR_FIRST_DISPLAY
    A.

  • Search help for date field in Editable ALV

    Hello Friends,
    I am using editable alv using 'reuse_* '.
    I have used date as input field. While creating fieldcatlog also i have  declared dat as a mkpf-budat.
    But i am not getting serach help for date in output.
    Is it possible with reuse or i have to go by object oriented ?

    Hi,
    Just pass the Edit option of the fieldcatalog for those specific fields...
    fcat-edit = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = sy-cprog
          i_callback_pf_status_set = 'PF_STATUS_SET'
          i_callback_user_command  = 'USER_COMMAND'    "<----  pass this
          i_callback_top_of_page   = 'TOP'
          is_layout                = it_layout
          it_fieldcat              = it_fcat
          i_default                = 'X'
          i_save                   = 'A'
          it_events                = it_event
        TABLES
          t_outtab                 = it_final
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
    *&      Form  USER_COMMAND
    *       text
    *      -->R_UCOMM      text
    *      -->RS_SELFIELD  text
    FORM user_command USING r_ucomm LIKE sy-ucomm
                            rs_selfield TYPE slis_selfield.
      CASE r_ucomm.
        WHEN '&DATA_SAVE'.                "<-------check this
          PERFORM save_data.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND

  • Help for date field not working after upgrade

    hi experts,
    In our BSP application for a page we had an inputfield (date).
    Onvaluehelp for input field we were calling the saphelpdate function.
    however after upgrade this functionality is not working properly as no pop up comes after clicking on the icon.
    we have upgraded to SPS 16 recently.
    please help me.
    regards,
    Arvind.

    Hi, I try upper case but nothing happen. This is all my code by far, I hope you can help me:
    DATA: BEGIN OF T_PCONT OCCURS 0,
          PCONT LIKE ZPSPERMISOS-PSOBKEY,
    END OF T_PCONT.
    DATA: BEGIN OF T_FIELDS OCCURS 0.
            INCLUDE STRUCTURE help_value.
    DATA END OF T_FIELDS.
    DATA: BEGIN OF T_VALUES OCCURS 0,
          VALUE(60) TYPE c.
    DATA: END OF T_VALUES.
    DATA: N TYPE i.
    SELECTION-SCREEN BEGIN OF BLOCK  b20 WITH FRAME TITLE text-b02.
      SELECT-OPTIONS:
        P_CONT FOR  ZPSPERMISOSH-PSOBKEY OBLIGATORY NO-EXTENSION NO INTERVALS,
        P_INT  FOR  ZPSPERMISOSH-PARTNER OBLIGATORY NO-EXTENSION NO INTERVALS,
        P_FEC  FOR  ZPSPERMISOSH-ZFINICN NO-EXTENSION NO INTERVALS,    
        P_RAZ  FOR  ZPSPERMISOSH-ZRAZONFINIC NO-EXTENSION NO INTERVALS.
    SELECTION-SCREEN END OF BLOCK b20.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_CONT-LOW.
      PERFORM P_HELP_P_CONT USING P_CONT-LOW.
    *&      Form  P_HELP_P_CONT
    FORM P_HELP_P_CONT  USING P_P_CONT.
      DESCRIBE TABLE T_PCONT LINES N.
      IF N EQ 0.
        T_FIELDS-FIELDNAME  = 'PSOBKEY'.
        T_FIELDS-TABNAME    = 'ZPSPERMISOS'.
        T_FIELDS-SELECTFLAG = 'X'.
        APPEND T_FIELDS.
        CLEAR T_FIELDS.
        SELECT PSOBKEY FROM ZPSPERMISOS
        INTO  TABLE T_PCONT.
        SORT T_PCONT BY PCONT.
      CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE'
        EXPORTING
          CUCOL        = 10
          CUROW        = 1
          TABNAME      = 'T_PCONT'
          FIELDNAME    = 'PCONT'
        IMPORTING
          SELECT_VALUE = P_P_CONT
        TABLES
          FIELDS       = T_FIELDS
          VALUETAB     = T_VALUES.
    ENDFORM.                    " P_HELP_P_CONT
    Edited by: J. Garibaldi on Nov 25, 2009 11:14 AM
    Edited by: J. Garibaldi on Nov 25, 2009 11:16 AM

  • Reg : F4 help for custom fields in ALV report

    hi friends..
    in my internal table i have fields including 1 custom field..
    DATA : BEGIN OF i_final OCCURS 0,
      pernr LIKE p0000-pernr,
      begda LIKE p0000-begda,
      plans LIKE ZPOSITION-plans,  (custom)
      werks LIKE pspar-werks,
      end of i_final.
    i want to display this i_final table in alv. for that i genetrate one fieldcatalog
    PERFORM fcat USING:
                      'I_FINAL' 'PERNR' 'P0000' 'PERNR' '15' 'X' '',
                      'I_FINAL' 'BEGDA' 'P0000' 'BEGDA' '10' 'X' '',
                      'I_FINAL' 'PLANS' 'ZPOSITION' 'PLANS' '8' 'X' '',
                      'I_FINAL' 'WERKS' 'PSPAR' 'WERKS' '14' 'X' ''.
    in custom table zposition, i maintain serch help for custom field "PLANS".
    then i used reuse_alv_grid_display.. for all the std fields along wit custom fields
    i got f4 all std fields but for my custom i am not getting the f4 help
    how can i get the F$ help for this custom fields Zposition-plans..
    plz give some idea

    Hi
    In that Ztable against the field
    PLANS give the check table name as  <b>T528B</b>
    then it will automatically give the search help
    or you can create your own search help(elementary) and add to that field
    Reward if useful
    regards
    Anji

  • F4 help for a field in alv grid

    hello friends,
                        i want to make one of the fields of my alv grid as editable and i want f4 help option also available for it, can v do it, if yes how??? pls explain through code
                  thanks

    check this example
    REPORT  ztest440.
    TABLES : mara.
    TYPES: BEGIN OF t_mara,
            matnr TYPE mara-matnr,
            lvorm TYPE mara-lvorm,
            mtart TYPE mara-mtart,
            mbrsh TYPE mara-mbrsh,
            matkl TYPE mara-matkl,
            meins TYPE mara-meins,
            brgew TYPE mara-brgew,
            ntgew TYPE mara-ntgew,
            gewei TYPE mara-gewei,
           END OF t_mara.
    TYPES: BEGIN OF t_equk,
            matnr TYPE equk-matnr,
            werks TYPE equk-werks,
            bdatu TYPE equk-bdatu,
            vdatu TYPE equk-vdatu,
            qunum TYPE equk-qunum,
           END OF t_equk.
    CLASS : lcl_alv_grid DEFINITION DEFERRED.
    DATA : gi_mara TYPE STANDARD TABLE OF t_mara,
           gi_equk TYPE STANDARD TABLE OF t_equk,
           gs_mara TYPE t_mara,
           gs_equk TYPE t_equk.
    *-- Global data definitions for ALV
    *--- ALV Grid instance reference
    DATA : gw_alvgrid  TYPE REF TO cl_gui_alv_grid,
           gw_alvgrid1 TYPE REF TO cl_gui_alv_grid .
    *--- Custom container instance reference
    DATA gw_container      TYPE REF TO cl_gui_custom_container.
    DATA gw_event_handler  TYPE REF TO lcl_alv_grid.
    DATA gw_event_handler1 TYPE REF TO lcl_alv_grid.
    DATA gw_container1     TYPE REF TO cl_gui_custom_container.
    *--- Field catalog table
    DATA : gi_fieldcat  TYPE lvc_t_fcat,
           gi_fieldcat1 TYPE lvc_t_fcat,
           gs_fieldcat  TYPE lvc_s_fcat,
           gs_fieldcat1 TYPE lvc_s_fcat.
    *--- Layout structure
    DATA : gs_layout  TYPE lvc_s_layo,
           gs_layout1 TYPE lvc_s_layo.
          CLASS lcl_alv_grid DEFINITION
    CLASS lcl_alv_grid DEFINITION.
      PUBLIC SECTION.
        METHODS :
      Handle_double_click
          handle_double_click
             FOR EVENT double_click OF cl_gui_alv_grid
                IMPORTING e_row e_column,
      Handle_double_click
          handle_onf4
             FOR EVENT onf4 OF cl_gui_alv_grid
                IMPORTING e_fieldname,
      Handle_double_click
          handle_hotspot_click
             FOR EVENT hotspot_click OF cl_gui_alv_grid
                IMPORTING e_row_id.
      PRIVATE SECTION.
    ENDCLASS.                          " lcl_alv_grid DEFINITION
                    CLASS LCL_ALV_GRID IMPLEMENTATION                   *
    CLASS lcl_alv_grid IMPLEMENTATION.
                        METHOD handle_double_click                      *
      METHOD handle_double_click.
        READ TABLE gi_mara INTO gs_mara INDEX e_row.
        IF sy-subrc = 0.
          SELECT matnr
                 werks
                 bdatu
                 vdatu
                 qunum
            FROM equk
            INTO TABLE gi_equk
           WHERE matnr = gs_mara-matnr.
          IF sy-dbcnt NE 0.
            SORT gi_equk BY matnr werks bdatu.
          ENDIF.
          CALL SCREEN 0002.
        ENDIF.
      ENDMETHOD.                    "handle_double_click
                        METHOD handle_onf4                              *
      METHOD handle_onf4.
        PERFORM f4_help USING e_fieldname.
      ENDMETHOD.                    "handle_double_click
                        METHOD handle_double_click                      *
      METHOD handle_hotspot_click.
        READ TABLE gi_mara INTO gs_mara INDEX e_row_id.
        IF sy-subrc = 0.
          SELECT matnr
                 werks
                 bdatu
                 vdatu
                 qunum
            FROM equk
            INTO TABLE gi_equk
           WHERE matnr = gs_mara-matnr.
          IF sy-dbcnt NE 0.
            SORT gi_equk BY matnr werks bdatu.
          ENDIF.
          CALL SCREEN 0002.
        ENDIF.
      ENDMETHOD.                    "handle_hotspot_click
    ENDCLASS.                          " lcl_alv_grid IMPLEMENTATION
                      SELECTION SCREEN DEFINITION                       *
    SELECTION-SCREEN BEGIN OF BLOCK b1.
    SELECT-OPTIONS : s_matnr FOR mara-matnr NO INTERVALS,
                     s_mtart FOR mara-mtart NO INTERVALS.
    SELECTION-SCREEN END OF BLOCK b1.
                           START-OF-SELECTION                           *
    START-OF-SELECTION.
      SELECT matnr
             lvorm
             mtart
             mbrsh
             matkl
             meins
             brgew
             ntgew
             gewei
             FROM mara
             INTO TABLE gi_mara
             WHERE matnr IN s_matnr
               AND mtart IN s_mtart.
      IF sy-dbcnt NE 0.
        SORT gi_mara BY matnr.
      ENDIF.
      CALL SCREEN 0001.
    *&      Module  STATUS_0001  OUTPUT
          text
    MODULE status_0001 OUTPUT.
      SET PF-STATUS '0001'.
      SET TITLEBAR  '001'.
      PERFORM build_alv_display.
    ENDMODULE.                 " STATUS_0001  OUTPUT
    *&      Module  USER_COMMAND_0001  INPUT
          text
    MODULE user_command_0001 INPUT.
      CASE sy-ucomm.
        WHEN 'EXIT'.
          LEAVE TO SCREEN 0.
        WHEN 'SAVE'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0001  INPUT
    *&      Form  build_alv_display
          text
    -->  p1        text
    <--  p2        text
    FORM build_alv_display .
      PERFORM build_fieldcat.
      PERFORM build_layout.
      PERFORM create_alv_grid.
      PERFORM display_alv_grid.
    ENDFORM.                    " build_alv_display
    *&      Form  build_fieldcat
          text
    -->  p1        text
    <--  p2        text
    FORM build_fieldcat .
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'MATNR'.
      gs_fieldcat-tabname   = 'MARA'.
      gs_fieldcat-coltext   = 'Material Number'.
      gs_fieldcat-outputlen = '18'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '1'.
      gs_fieldcat-hotspot   = 'X'.
      APPEND gs_fieldcat TO gi_fieldcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'LVORM'.
      gs_fieldcat-tabname   = 'MARA'.
      gs_fieldcat-coltext   = 'Deletion'.
      gs_fieldcat-outputlen = '8'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '2'.
      gs_fieldcat-checkbox  = 'X'.
      APPEND gs_fieldcat TO gi_fieldcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'MTART'.
      gs_fieldcat-tabname   = 'MARA'.
      gs_fieldcat-coltext   = 'Material Type'.
      gs_fieldcat-outputlen = '13'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '3'.
      APPEND gs_fieldcat TO gi_fieldcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'MBRSH'.
      gs_fieldcat-tabname   = 'MARA'.
      gs_fieldcat-coltext   = 'Industry sector'.
      gs_fieldcat-outputlen = '15'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '4'.
      APPEND gs_fieldcat TO gi_fieldcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'MATKL'.
      gs_fieldcat-tabname   = 'MARA'.
      gs_fieldcat-coltext   = 'Material group'.
      gs_fieldcat-outputlen = '14'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '5'.
      APPEND gs_fieldcat TO gi_fieldcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'MEINS'.
      gs_fieldcat-tabname   = 'MARA'.
      gs_fieldcat-coltext   = 'Base Unit of Measure'.
      gs_fieldcat-outputlen = '20'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '6'.
      APPEND gs_fieldcat TO gi_fieldcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'BRGEW'.
      gs_fieldcat-tabname   = 'MARA'.
      gs_fieldcat-coltext   = 'Gross weight'.
      gs_fieldcat-outputlen = '13'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '7'.
      APPEND gs_fieldcat TO gi_fieldcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'NTGEW'.
      gs_fieldcat-tabname   = 'MARA'.
      gs_fieldcat-coltext   = 'Net weight'.
      gs_fieldcat-outputlen = '13'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '8'.
      APPEND gs_fieldcat TO gi_fieldcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'GEWEI'.
      gs_fieldcat-tabname   = 'MARA'.
      gs_fieldcat-coltext   = 'Weight Unit'.
      gs_fieldcat-outputlen = '11'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '9'.
      APPEND gs_fieldcat TO gi_fieldcat.
    ENDFORM.                    " build_fieldcat
    *&      Form  build_layout
          text
    -->  p1        text
    <--  p2        text
    FORM build_layout .
      gs_layout-sel_mode   = 'A'.
      gs_layout-edit       = ' '.
      gs_layout-no_toolbar = ' '.
      gs_layout-grid_title = 'Material Data'.
      gs_layout-no_headers = ' '.
      gs_layout-weblook    = 'X'.
    ENDFORM.                    " build_layout
    *&      Form  create_alv_grid
          text
    -->  p1        text
    <--  p2        text
    FORM create_alv_grid .
      IF gw_container IS INITIAL.
        CREATE OBJECT gw_container
            EXPORTING
               container_name = 'CC_ALV'.
    Display ALV grid
        IF gw_alvgrid IS INITIAL.
          CREATE OBJECT gw_alvgrid
             EXPORTING
                i_parent = gw_container.
        ENDIF.
      ENDIF.
      IF gw_event_handler IS INITIAL.
        CREATE OBJECT gw_event_handler.
        SET HANDLER gw_event_handler->handle_double_click
                FOR gw_alvgrid.
        SET HANDLER gw_event_handler->handle_onf4
                FOR gw_alvgrid.
        SET HANDLER gw_event_handler->handle_hotspot_click
                FOR gw_alvgrid.
      ENDIF.
    ENDFORM.                    " create_alv_grid
    *&      Form  display_alv_grid
          text
    -->  p1        text
    <--  p2        text
    FORM display_alv_grid .
      CALL METHOD gw_alvgrid->set_table_for_first_display
        EXPORTING
          i_buffer_active    = ' '
          i_bypassing_buffer = ' '
          i_structure_name   = 'T_MARA'
          is_layout          = gs_layout
        CHANGING
          it_outtab          = gi_mara[]
          it_fieldcatalog    = gi_fieldcat[]
        EXCEPTIONS
          OTHERS             = 0.
    ENDFORM.                    " display_alv_grid
    *&      Module  STATUS_0002  OUTPUT
          text
    MODULE status_0002 OUTPUT.
      SET PF-STATUS '0002'.
      SET TITLEBAR '002'.
      PERFORM build_alv_display1.
    ENDMODULE.                 " STATUS_0002  OUTPUT
    *&      Module  USER_COMMAND_0002  INPUT
          text
    MODULE user_command_0002 INPUT.
      CASE sy-ucomm.
        WHEN 'EXIT'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0002  INPUT
    *&      Form  build_alv_display1
          text
    -->  p1        text
    <--  p2        text
    FORM build_alv_display1 .
      PERFORM build_fieldcat1.
      PERFORM build_layout1.
      PERFORM create_alv_grid1.
      PERFORM display_alv_grid1.
    ENDFORM.                    " build_alv_display1
    *&      Form  build_fieldcat2
          text
    -->  p1        text
    <--  p2        text
    FORM build_fieldcat1.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'MATNR'.
      gs_fieldcat-tabname   = 'EQUK'.
      gs_fieldcat-coltext   = 'Material Number'.
      gs_fieldcat-outputlen = '18'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '1'.
      gs_fieldcat-f4availabl = 'X'.
      APPEND gs_fieldcat TO gi_fieldcat1.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'WERKS'.
      gs_fieldcat-tabname   = 'EQUK'.
      gs_fieldcat-coltext   = 'Plant'.
      gs_fieldcat-outputlen = '4'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '2'.
      APPEND gs_fieldcat TO gi_fieldcat1.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'BDATU'.
      gs_fieldcat-tabname   = 'EQUK'.
      gs_fieldcat-coltext   = 'Valid Untill'.
      gs_fieldcat-outputlen = '12'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '3'.
      APPEND gs_fieldcat TO gi_fieldcat1.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'VDATU'.
      gs_fieldcat-tabname   = 'EQUK'.
      gs_fieldcat-coltext   = 'Valid From'.
      gs_fieldcat-outputlen = '10'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '4'.
      APPEND gs_fieldcat TO gi_fieldcat1.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'QUNUM'.
      gs_fieldcat-tabname   = 'EQUK'.
      gs_fieldcat-coltext   = 'Quota'.
      gs_fieldcat-outputlen = '10'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '5'.
      APPEND gs_fieldcat TO gi_fieldcat1.
    ENDFORM.                    " build_fieldcat2
    *&      Form  build_layout2
          text
    -->  p1        text
    <--  p2        text
    FORM build_layout1.
      gs_layout1-sel_mode   = 'A'.
      gs_layout1-edit       = ' '.
      gs_layout1-no_toolbar = ' '.
      gs_layout1-grid_title = 'Quota Header Data'.
      gs_layout1-no_headers = ' '.
    ENDFORM.                    " build_layout1
    *&      Form  create_alv_grid2
          text
    -->  p1        text
    <--  p2        text
    FORM create_alv_grid1.
      IF gw_container1 IS INITIAL.
        CREATE OBJECT gw_container1
            EXPORTING
               container_name = 'CC_ALV1'.
    Display ALV grid
        IF gw_alvgrid1 IS INITIAL.
          CREATE OBJECT gw_alvgrid1
             EXPORTING
                i_parent = gw_container1.
        ENDIF.
      ENDIF.
      IF gw_event_handler1 IS INITIAL.
        CREATE OBJECT gw_event_handler1.
        SET HANDLER gw_event_handler1->handle_onf4
                FOR gw_alvgrid1.
      ENDIF.
    ENDFORM.                    " create_alv_grid1
    *&      Form  display_alv_grid2
          text
    -->  p1        text
    <--  p2        text
    FORM display_alv_grid1 .
      DATA : li_f4 TYPE lvc_t_f4,
             ls_f4 TYPE lvc_s_f4.
      CALL METHOD gw_alvgrid1->set_table_for_first_display
        EXPORTING
          i_buffer_active    = ' '
          i_bypassing_buffer = ' '
          i_structure_name   = 'T_EQUK'
          is_layout          = gs_layout1
        CHANGING
          it_outtab          = gi_equk[]
          it_fieldcatalog    = gi_fieldcat1[]
        EXCEPTIONS
          OTHERS             = 0.
      IF li_f4[] IS INITIAL.
        MOVE 'MATNR' TO ls_f4-fieldname.
        MOVE 'X'     TO ls_f4-register.
        MOVE 'X'     TO ls_f4-getbefore.
        APPEND ls_f4 TO li_f4.
        CLEAR  ls_f4.
        CALL METHOD gw_alvgrid1->register_f4_for_fields
          EXPORTING
            it_f4 = li_f4.
      ENDIF.
    ENDFORM.                    " display_alv_grid1
    *&      Form  f4_help
          text
         -->P_FIELDNAME  text
    FORM f4_help  USING    p_fieldname.
      TYPES : BEGIN OF t_values,
                matnr TYPE mara-matnr,
              END OF t_values.
      DATA : li_fields        TYPE TABLE OF dfies,
             li_select_values TYPE TABLE OF ddshretval,
             li_values        TYPE TABLE OF t_values,
             ls_fields        TYPE dfies,
             ls_values        TYPE t_values.
      REFRESH : li_fields,
                li_select_values.
      SELECT matnr
        FROM equk
        INTO TABLE li_values.
      CASE p_fieldname.
        WHEN 'MATNR'.
          ls_fields-tabname    = 'EQUK'.
          ls_fields-fieldname  = 'MATNR'.
          APPEND ls_fields TO li_fields.
          CLEAR ls_fields.
          SORT li_values BY matnr.
          DELETE ADJACENT DUPLICATES FROM li_values COMPARING matnr.
          CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
            EXPORTING
              retfield   = 'MATNR'
            TABLES
              value_tab  = li_values
              field_tab  = li_fields
              return_tab = li_select_values.
          IF sy-subrc = 0.
           LOOP AT li_select_values WHERE fieldname = 'MATNR'.
             clear gs_mara.
             gs_mara in
          ENDIF.
      ENDCASE.
    ENDFORM.                                                    " f4_help

  • How to add a search help for a field in alv?

    HI!Everyone ,
    i want to add a search help created by myself for one field in alv,
    and i want to use this function "HELP_VALUES_GET_WITH_TABLE".
    can anyone help me ?
    thanks!

    HI,Vijay.
    My code like this :
          PERFORM build_fcat.
          PERFORM build_objects.
          PERFORM layo_build.
          PERFORM set_drdn_table .
          CALL METHOD alv_grid->set_table_for_first_display
            EXPORTING
             i_structure_name = 'STU_S'
              is_layout        = s_layo
            CHANGING
              it_outtab        = itab_out
            it_fieldcatalog  = i_fcat
            ."Period
          IF sy-subrc <> 0.
            EXIT.
          ENDIF.
    for example, there is a field 'UNAME' IN Structure 'STU_S',
    i want to add a search help for 'UNAME'.
    the 'UNAME'  is not users in SAP R/3 , i want to add some data by myself or from a table .

  • How to pass custom search help(F4 help) for a field in ALV output?

    Hi,
    I want to activate the F4 help in ALV output for a field for which we do not have search help assigned at table ,data element and domain level.
    In field catalog i have enabled it by below line.
    ls_fcat-F4AVAILABL = 'X'.
    but because there are no standard input help available it is giving message as "No input help is available".
    so how to pass our custom search help (g_search) for any field in ALV output.
    I am using object oriented ALV grid display.
    Thanks!!!
    Rajesh Gupta.

    hi,
    check this out:
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/b3d5e890-0201-0010-c0ac-bba85ec2ae8d
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/acdefb13-0701-0010-f1a2-8eeefa7d3780
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b3d5e890-0201-0010-c0ac-bba85ec2ae8d?quicklink=index&overridelayout=true

  • Eventing on dictionary search help on date field

    Hi Experts,
    In my WDABAP application I have a Date input field. I have used dictionary search help into this field to display calender searc help.
    Now on select of the date from the calender I want to trigger one event which will enable some other fields in the application.
    Can you please tell me how to implement this on select event of the date.
    Thanks
    Sonia.

    Hi,
      Since you are using an Input Field , only event possible is "On Enter" event.This event is triggered when  "enter" key is pressed by the user after selecting a value in the input field.So may be you can use this and proceed further.
    Although it may not serve you the actual requirement that you have to achieve , because input field does not have any event for "On select".
    [On Enter|http://help.sap.com/erp2005_ehp_04/helpdata/EN/14/0ce74114a1da6fe10000000a1550b0/frameset.htm] this link might help
    Cheers,
    Aditya.

  • CR XI uses the wrong data field after save/close-open

    I have a quite complex CR XI report (35 sections).  It has 2 embedded sub-reports, connects via ODBC to Sybase, and uses a long and complex SQL statement as a Database Command.  After a fairly small number of edits and saves (I guess between 10 and 20), I can no longer save it correctly.  For example, if I add a particular text field from the command to be displayed.  Run the report in the designer then all is well.  But if I save the report and re-open it then the data field that I added has been replaced by another, totally different field.  This process is repeatable!
    I tried removing some unneeded fields from the Command SQL and that causes a DIFFERENT field to replace the one I select.
    If I re-create the entire report from scratch (copy and paste from the u201Cbadu201D one) then the problem goes away for a few edits and saves; but then returns.
    This is getting very frustrating, because it takes me the best part of a day to copy the report to a new one, including copying all of the formatting and formulae, and ensuring that every field and every section has the correct properties (suppress, new page etc) applied to it.  In order to minimise the risk of it becoming corrupt I u201Csaveu201D infrequently, which can add to the frustration when things go wrong!
    Has anyone got ANY ideas? 
    What can I do to prevent the corruptions?
    Is there a better way to clone the report?
    Does anyone know if CR 2008 would be any better?

    Don,
    Thanks again for your help.  I think that you are misunderstanding the problem a bit.  When I have the report open in the designer I can put the correct field on the designer surface (eg by dragging a field called u201CCustomerNameu201D from the Command in the u201CField Exploreru201D to an appropriate location).  The report then functions perfectly when I refresh (F5) and view it in the u201CPreviewu201D tab, and I see the appropriate names.  However If I close the designer and then re-open it, a DIFFERENT field, u201CCustomerBalanceu201D, is displayed both in the design view and the preview tab, and of course I see the numeric data for that incorrect field in the preview, where I expect to see a name.  The same (incorrect) data is shown when the report is run and displayed via the web browser interface (not within the CR designer).
    I have run and edited the same report on different PCs with the latest CR XI installed and on my PC with many different loads (eg just after re-boot and later in the day with many applications running) all with identical results, so I am confident that it is not resource related.
    Similarly I donu2019t think it can be ODBC related, because it appears to occur when the report is saved, closed or opened.  I am not saving data with the report.  I have now tried using the DataDirect driver, but it will not connect to the Sybase ASA database on a remote server, because it complains that procedure sp_server_info is not found.  This is only supported by Sybase ASE (not ASA).
    There are a lot of conditional fields and sections and page breaks  within the report, these are suppressed with an appropriate formula, but the underlying SQL is just passed one parameter and this is used to select an appropriate single data set (there is no hierarchical grouping or drill-down in this report).  The error is there consistently whatever parameter value is used (i.e. it always displays a value in place of a name in the example above).
    I have still not tried your stored procedure idea, partly because that will require another day to re-write the report.  I might combine that with Jasonu2019s idea and make all display all data via formulae as a first step and then replace the underlying data with a stored procedure.
    I have discovered a temporary work-around though.  I have added more sub-reports (all take the same parameter value) and replaced whole sections with those sub reports, so I was able to remove quite a few data fields from the main SQL query, because these are now queried separately in the sub-reports.  Itu2019s all working at the moment!
         Jonathan

  • F4 help for Date field and Validation

    Hi Friends,
    I am new to BSP programming .I knew getting F4 help in normal ABAP.But i don't know in BSP .
    I want simple steps to get F4 for a field on Page as well as date field .
    and How to valid those entered dates.
    Presently i am using length 10 character variable for DATE without F4 help and No validation.
    I think you guys will help me out.
    Thanks,
    Venkat.O

    Welcome to SDN.
    for F4 help with validation for dates you can use the following code.
    <htmlb:inputField id         = "wf_ad_date"
                                    type       = "date"
                                    showHelp   = "TRUE"
                                    value = "<%= sy-datum  %>"
                                    visible    = "true"
                                    disabled   = "false"
                                    required   = "true"
                                    maxlength  = "10"
                                    size       = "10"
                                    doValidate = "true"
                                    design     = "standard" />
    For other type of fields check out this weblog by Thomas Jung
    <a href="/people/thomas.jung3/blog/2005/08/22/bsp-value-input-help-popups-version-30 Value Input Help Popups Version 3.0</a>
    Regards
    Raja

  • F4 help for date field in ITS

    hi all;
    I was working on ESS Leave Request, i am using the standard program SAPMWS20000081H and the service template WS20000081.
    Now in the EP view i am unable to get the F4 help for the date field 'Absence From' & 'Absence To'. i have checked the data element used it is 'DATS'.
    How to get the F4 help in the view, please help me its of high priority.

    Hi, I can tell you what we have done.  I can see that the original template displays the "Absence from" field this way :
    <tr>     <td>`SAP_TemplateEditableField("FromDay", fieldLabel=ABSENCEFROM030150.label, fieldLabelWidth="170", name="ABSENCEFROM030150", value=ABSENCEFROM030150, size="10", maxlength="10", marginTop=9, inspectionText=ABSENCEFROMDAY,  align="",
    required="", width="", onchange="update_checkn(this.SAP_value, this)" )` </td>
         </tr>
    We modified the template to display it like this :
    <tr><td> `SAP_Field("ABSENCEFROM030150","ABSENCEFROM030150", DynproLabelWidth="170")` </td></tr>
    We did the same for ABSENCETO040150. So you can play around with the template to generate the F4 button. ( Note that we also added the ~webgui parameter in the service file and set it to 1, this in order to generate the calendar ). Good luck !

  • Need help on date field

    hai,
    in selection screen, i am having the date field as select-options.
    if i give low value, it should automatically display the high value, how to do this.
    thanks.

    Hi,
    U can use AT SELECTION-SCREEN event as follows :
    AT SELECTION-SCREEN on S_DATE
    if not S_DATE-LOW is initial.
    S_DATE-OPTION = 'BT'.
    S_DATE-HIGH = SY-DATUM.
    MODIFY S_DATE.
    Endif.
    This shud help u.
    Regards,
    Himanshu
    Message was edited by:
            Himanshu Aggarwal
    Message was edited by:
            Himanshu Aggarwal

  • F4 help on date field on screen

    Hi ,
    I created a screen using dialog programming . I have a date field there which is defined as
    zscreenfield-zdate.
    The format for this field in Element list is DATS .
    How do i get a drop down on the date field on the screen .
    Please advise
    Thanks !
    Edited by: Hari  G  Krishna on Mar 5, 2008 4:20 PM

    Hi there,
    In your custom table, for  the date field use the dataelement "STRMN",, that should automatically gives you the search help for the date.
    let me know if you have further queries,
    <REMOVED BY MODERATOR>
    Thanks-
    Rahul
    Edited by: Alvaro Tejada Galindo on Mar 5, 2008 4:32 PM

Maybe you are looking for

  • Reg: Table size adjustments in adf 11g application.

    Hi All, We have developed an application in ADF 11g. In this we fetching the tables from the database. When viewed, the size is not appropriate. We need to adjust the width and height of the tables as default. Can anyone help us regarding this. Thank

  • How to send email to a group of recipients at the same time?

    I have been trying to set up a group in Mail, and think that I've done it correctly as all the cards are in the group when I look (I opened Address book, created a group, dragged across the email addresses I wanted in that group). However, when I typ

  • Where can I find the "Shared Variable Properties" VI to be used in my program for configuring SV remotely?

    I was using the "configure Alarms" and "configure Logging" VIs to design two user interfaces to make use of these VIs when I came across a problem.  In both VIs you can enable logging of alarms.  So which one is valid?  Which one has priority?  Then

  • Search / Find problem with Mac Notes

    The 'command f' function is greyed out on my new version of 'Mac Notes' that comes with Lion. As per the image below. why can't i use that 'Find' function? There is another search function in Notes but this just does a broad brush search to see if an

  • Hooking up an iMac to a telly

    Hi all, The college I work at is going over to Mac from PC editing systems. What's the cheapest way to connect a new intel iMac to a television so that you can monitor video editing in Final Cut? (I don't want to go via a camcorder). Thanks, Sean