Home > Default > F4 Help on Date Field after ALV is generated

F4 Help on Date Field after ALV is generated

November 30Hits:0
Advertisement
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

Answers

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

Read other 7 answers

Tags:

Related Articles

  • F4 Help on Date Field after ALV is generatedNovember 30

    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_

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

    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 fin

  • Show text in the column other than contains in actual data field WD ALVNovember 30

    Hi, I want to show the data in the ALV column other than contains in the actual field for this column. Fot this purpose I use method   SET_TEXT_FIELDNAME of the interface IF_SALV_WD_COLUMN_REF. Unfortunately, I still see the contents of the actual fi

  • Sorting not working correctly for date field in alv reportOctober 11

    Hi All, My report displays many rows also containing date type fields of bldat,budat . When I sort the report selecting field of type bldat budat the sorting is not correct for the year. Ex: Invoice doc dat 01-25-2011 01-21-2011 02-02-2011 10-25-2010

  • Date Field in Hierarchical ALVOctober 11

    Hello Friends, I have a few fields in my Hierarchical ALV output which are initially hidden. When I choose to display these fields by changing the Layout the date fields come out in the form MMDDYYYY I need those fields as  MM/DD/YYYY The date fields

  • Validation of data in editable ALV report output for particular fieldOctober 11

    Hi Experts, I have one input enabled field in ALV output. How to validate the data once user enters  in that field and press enter? Is it possible to capture the value, hit the enter after user enters the data? Thanks, Surya PrakashHalo Prakash, 1 Fi

  • Average value for a Date Field in an OO Alv Grid.October 11

    Hi Abapers. I've been searching for some info about averages in OO Alv grid lists but cannot find an answer to what I'm really need. The question is that, for getting an average, a 'C' value must be set in the field DO_SUM of the fieldcatalog structu

  • Editable field in alv data formatOctober 11

    i have a editable field on ALV which is of date format and i need when user enter a date the value will be updated in the database table . note that i am using alv list and the field catalog is of date format dat 8 the update is not done pleaseee hel

  • Date field not updated when select on F4 value on editable ALV GridOctober 11

    Can some one look into this to see what was wrong. I have a report that display fields extracted from a ZTable and display on an ALV Editable Grid. The data are displayed as read only mode for these fields: Field A -   type char20 and have a search h

  • Alv + date field problemNovember 30

    Hi All I have a screen with a date field and an alv grid. When I hit the f4 help on the date field the date does not appear. When I test this screen in the screen painter the date picker shows up, but when I run the program it does not, it is like so

Copyright (C) 2019 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 14 q. 1.838 s.