Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

problem with f4 in alv-grid

alberto_colonna
Participant
0 Kudos

Hello,

I have created an alv-grid with the class cl_gui_alv_grid.

Now I tried to create f4-help for some of the fields in the alv.

The f4-Button is displayed. When I click on it, the f4-window is also displayed but i cannot

choose any value there.

Can you help me?

Kind regards

Alberto

Here is a part of my code:

wa_fieldcat-fieldname = 'OTYPE'.

wa_fieldcat-ref_table = 'ZUSER_ORG_LEVEL'.

wa_fieldcat-style = cl_gui_alv_grid=>mc_style_enabled.

wa_fieldcat-key = 'X'.

wa_fieldcat-f4availabl = 'X'.

APPEND wa_fieldcat TO lt_fieldcat.

wa_fieldcat-fieldname = 'OID'.

wa_fieldcat-ref_table = 'ZUSER_ORG_LEVEL'.

wa_fieldcat-style = cl_gui_alv_grid=>mc_style_enabled.

wa_fieldcat-key = 'X'.

APPEND wa_fieldcat TO lt_fieldcat.

wa_fieldcat-fieldname = 'DATEFROM'.

wa_fieldcat-ref_table = 'ZUSER_ORG_LEVEL'.

wa_fieldcat-style = cl_gui_alv_grid=>mc_style_enabled.

wa_fieldcat-key = 'X'.

APPEND wa_fieldcat TO lt_fieldcat.

ls_f4-fieldname = 'DATEFROM'.

ls_f4-register = 'X' .

ls_f4-getbefore = 'X' .

APPEND ls_f4 TO lt_f4 .

wa_fieldcat-fieldname = 'DATETO'.

wa_fieldcat-ref_table = 'ZUSER_ORG_LEVEL'.

wa_fieldcat-style = cl_gui_alv_grid=>mc_style_enabled.

wa_fieldcat-key = 'X'.

APPEND wa_fieldcat TO lt_fieldcat.

wa_fieldcat-fieldname = 'GUID'.

wa_fieldcat-no_out = 'X'.

APPEND wa_fieldcat TO lt_fieldcat.

wa_fieldcat-fieldname = 'ORGLEVELSET'.

wa_fieldcat-no_out = 'X'.

APPEND wa_fieldcat TO lt_fieldcat.

CREATE OBJECT go_container

EXPORTING

container_name = 'BCALV_GRID_DEMO_0100_CONT1'.

IF sy-subrc <> 0.

MESSAGE e060(bc400).

ENDIF.

CREATE OBJECT go_alv_grid

EXPORTING

i_parent = go_container.

IF sy-subrc <> 0.

MESSAGE e060(bc400).

ENDIF.

ENDIF.

CALL METHOD go_alv_grid->register_f4_for_fields

EXPORTING

it_f4 = lt_f4[].

CALL METHOD go_alv_grid->set_table_for_first_display

EXPORTING

i_structure_name = 'ZUSER_ORG_LEVEL'

CHANGING

it_outtab = gt_sflight

it_fieldcatalog = lt_fieldcat.

IF sy-subrc <> 0.

MESSAGE e060(bc400).

ENDIF.

CALL METHOD go_alv_grid->set_ready_for_input

EXPORTING

i_ready_for_input = 1.

1 REPLY 1

former_member125661
Contributor
0 Kudos

Checkout demo program- BCALV_GRID_EDIT . It is a good example. You might have to set wa_fieldcat-edit = 'X' in the field catalog for the particular field u r doing F4 on.