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: 

F4 help on alv

former_member2492
Active Participant
0 Kudos

Hello can anyone help me,I want to add an F4 search help on an alv column ,in this case status.

I have seen some examples and I changed from REUSE_ALV_GRID_DISPLAY to REUSE_ALV_GRID_DISPLAY_LVC

 gs_fieldcat_lvc-fieldname = 'STATUS'.
 gs_fieldcat_lvc-tabname = 'LT_ZMM'.
 gs_fieldcat_lvc-domname = 'ZMM_STATUS'.
 gs_fieldcat_lvc-f4availabl = 'X'.
 gs_fieldcat_lvc-ref_table = 'ZMM_STAT'.
 append gs_fieldcat_lvc to gt_fieldcat_lvc.


 call function 'REUSE_ALV_GRID_DISPLAY_LVC'
 exporting
 i_callback_program = sy-repid
 i_structure_name = 'ZMM_REQ'
 it_excluding = gs_fieldcat
 it_fieldcat_lvc = gt_fieldcat_lvc
 tables
 t_outtab = lt_zmm
 exceptions
 program_error = 1
 others = 2.

MESSAGE: NO INPUT HELP available
1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor

When you build your own field catalog in REUSE_ALV_GRID_DISPLAY_LVC, to indicate your own F4 help you have to fill F4_AVAILABL = 'X' and REF_TABLE is to be the data element (yes I know it seems incoherent) for which you assigned a search help (SE11).

If you want to execute a dedicated ABAP code when F4 is pressed, you must switch to the class CL_GUI_ALV_GRID.

By the way, you define at the same time as the field catalog, you pass I_STRUCTURE_NAME = 'ZMM_REQ' (this is a shortcut to default the field catalog from a DDIC structure or table). You have to choose between the two, either I_STRUCTURE_NAME or IT_FIELDCAT_LVC.

By the way, you should not fill gs_fieldcat_lvc-tabname at all. You fill it only when it's to display hierarchical-sequential ALV (with two tables).

15 REPLIES 15

for that matter I already have BCALV_TEST_GRID_F4_HELP

former_member557245
Participant
*Hi Jonathan,
*Try This!!

gs_fieldcat_lvc-REF_FIELD = 'pass the field of ZMM_STAT'.

0 Kudos

I passed it ,now the message(MESSAGE:NOINPUTHELP available) does not show.I mean nothing shows.does it matter that ref_field and field are the same?in this case re_field would be the same as field

The table column mentioned by REF_TABLE + REF_FIELD is to have a search help assigned to the column in the ABAP Dictionary.

(or REF_TABLE alone is to be a data element, but still there must be a search help assigned)

former_member199306
Participant
0 Kudos

Sandra_Rossi
Active Contributor

When you build your own field catalog in REUSE_ALV_GRID_DISPLAY_LVC, to indicate your own F4 help you have to fill F4_AVAILABL = 'X' and REF_TABLE is to be the data element (yes I know it seems incoherent) for which you assigned a search help (SE11).

If you want to execute a dedicated ABAP code when F4 is pressed, you must switch to the class CL_GUI_ALV_GRID.

By the way, you define at the same time as the field catalog, you pass I_STRUCTURE_NAME = 'ZMM_REQ' (this is a shortcut to default the field catalog from a DDIC structure or table). You have to choose between the two, either I_STRUCTURE_NAME or IT_FIELDCAT_LVC.

By the way, you should not fill gs_fieldcat_lvc-tabname at all. You fill it only when it's to display hierarchical-sequential ALV (with two tables).

0 Kudos

is there a way to pass the structure and add the f4 help using this function module?

Jonathan Blavatsky If you want to keep the structure ZMM_REQ, then you may directly assign a search help on the ZMM_REQ-STATUS column (create a search help and assign it via SE11).F4 on the ALV column STATUS will then display the search help.

0 Kudos

sandra.rossi somehow when I create a elementary search help it does not show,is this smth on my side?can you please send me a link on how this is done.even after creating it and assiging it to the column it still does not show,while standart collective search helps show perfectly

See that the DDIC search helps are automatically proposed - I can't say what you did differently:

SELECT * FROM spfli INTO TABLE @DATA(spfli_s).
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
  EXPORTING
   i_structure_name = 'SPFLI'
  TABLES
    t_outtab        = spfli_s
  EXCEPTIONS
    OTHERS          = 2.

Sorry, I don't have a blog post how to create a search help from scratch. But it probably exists if you search it.

0 Kudos

Please show all information (I don't see the data element).

0 Kudos

the data Element is the one covered with partially black,its the same name.

0 Kudos

and the search help too?

0 Kudos

nevermind ,stupid mistake,I had it in another package