Application Development and Automation 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: 

ALV on F4 dont show search help "button" if ref_table is initial

oliver_am
Active Participant
0 Kudos
721

Hello, all.

I need to create a custom search help by code in my ALV.

I know there are reports like
BCALV_TEST_GRID_F4_HELP
BCALV_EDIT_08

The problem is the field is a field defined in my program in my internal table (no relation with a dictionary field) and It seems that is necessary to create the field in the field catalog with the reference of a field from a dictinary table, if not the "button" of the search help is not displayed, and there is no on_f4 event triggered...

You can try by yourself, execute any of theese programs:

in a normal execution you can see the "button" to trigger the f4 event.

But, if you, by debug, remove the REF_TABLE from the field catalog... there is no button

Do you know how can I define my field to display this button to trigger the on_f4 event?

Thanks in advance.

7 REPLIES 7

Eduardo-CE
Active Participant
647

Hello Oliver,

You need to register the fields using this method:

    lw_f4-fieldname  = 'NUCTA'.
lw_f4-register = 'X'.
lw_f4-chngeafter = 'X'.
INSERT lw_f4 INTO TABLE lt_f4.
FREE: lw_f4.

CALL METHOD go_grid->register_f4_for_fields
EXPORTING
it_f4 = lt_f4.

Register the onF4 event into your ALV and implement your search help there.

BCALV_TEST_GRID_F4_HELP its a great example.

Best regards.

0 Kudos
647

Hi, Eduardo.

Yes, I know it.
I was testing with this report, and this register is done. But, as I said, if the field in the fieldcatalog dont have any value in the field REF_TABLE the "button" for the search help is not visible.

647

oliver.am

No problem for me. You can display values without REF_TABLE.

0 Kudos
647

Hi Sandra.

It's strange, Report BCALV_EDIT_08 if I remove this value by debug is not working:


We have an old SAP version, SAP_ABAP 701 .

0 Kudos
647

oliver.am

Weird. No issue at my side, with SAP GUI 7.70, ABAP 7.52 SP0:

Sandra_Rossi
Active Contributor
0 Kudos
647

So, you're talking about CL_GUI_ALV_GRID.

oliver_am
Active Participant
0 Kudos
647

Yes, Sandra, sorry, I was talking about CL_GUI_ALV_GRID