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 Member
0 Kudos

Hi,

I want to have a F4 help on a column in an ALV grid display.

The exact requirement is: In the tcode IW33, the unloading point ABLAD is having a search help as a custom table.

I want to display the same search help values as F4 help in 'Unloading points' column of my ALV. How to do this? There is no 'F4AVAILABL' field available in the field catalog i have used(SLIS_FIELDCAT_ALV).

vishy.

1 ACCEPTED SOLUTION

Abhijit74
Active Contributor

Hi,

Try to add like this.. for example

For standard field already have an search help, we can use below code when building the field catalog.

ls_fcat-ref_table = 'BSEG'.

ls_fcat-ref_field = 'SHKZG'.

For those fields that we need custom F4 help.

1. DATA: lt_f4 TYPE lvc_t_f4,

ls_f4 TYPE lvc_s_f4.

2. Filled F4 table and register it to the alv grid instance

ls_f4-fieldname = u2018CDNMu2019. u201D field need to have F4 help

ls_f4-register = u2018Xu2019.

ls_f4-getbefore = u2018Xu2019.

ls_f4-chngeafter = u2018Xu2019.

ls_f4-internal = u201D.

INSERT ls_f4 INTO TABLE lt_f4.

CHECK NOT lt_f4 IS INITIAL.

CALL METHOD grf_grid_0100->register_f4_for_fields

EXPORTING

it_f4 = lt_f4.

3. In the event handler implemtation, use function module u2018F4IF_INT_TABLE_VALUE_REQUESTu2019 to pop a screen for custom F4 help.

After user selected an line, program use the selected line to update the internal table and refresh the table to update the changes to the frontend.

  • create search help

CALL FUNCTION u2018F4IF_INT_TABLE_VALUE_REQUESTu2019

EXPORTING

retfield = p_retfield

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = p_dynprofield

window_title = p_window_title

value_org = u2018Su2019

TABLES

value_tab = pt_value

field_tab = pt_field

return_tab = pt_ret

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

READ TABLE lt_ret INTO lw_ret INDEX 1.

IF sy-subrc = 0.

READ TABLE gt_result_0100 INDEX l_row INTO lw_result_0100.

lw_result_0100-cdnm = lw_ret-fieldval.

MODIFY gt_result_0100 INDEX l_row FROM lw_result_0100.

CALL METHOD grf_grid_0100->refresh_table_display.

Thanks,

Abhijit

Edited by: Abhijit Mandal on Jan 25, 2010 6:16 PM

7 REPLIES 7

Former Member

In Field Catalog give Reference field name and reference table.

This will give F4 help for ALV

Former Member
0 Kudos

Hi Vishwanath ,

Try to use LVC_S_FCAT fieldcatalog for this requirement.

F4AVAILABL of LVC_S_FCAT can be used for this. There you can specify any F4 help you want.

Hope this will help you.

Regards,

Nikhil

Former Member
0 Kudos

Hi ,

Look on below reports for better understanding on F4 help in ALV grid,

BCALV_TEST_GRID_F4_HELP

set handler g_handler->on_f4 for alv_grid

If you are using OOPS ALV , then

For F4 Help there is a field available in the field catalogue - F4AVAILABL

Try this :

wa_fcat-F4AVAILABL = 'X'.

Manas M.

Abhijit74
Active Contributor

Hi,

Try to add like this.. for example

For standard field already have an search help, we can use below code when building the field catalog.

ls_fcat-ref_table = 'BSEG'.

ls_fcat-ref_field = 'SHKZG'.

For those fields that we need custom F4 help.

1. DATA: lt_f4 TYPE lvc_t_f4,

ls_f4 TYPE lvc_s_f4.

2. Filled F4 table and register it to the alv grid instance

ls_f4-fieldname = u2018CDNMu2019. u201D field need to have F4 help

ls_f4-register = u2018Xu2019.

ls_f4-getbefore = u2018Xu2019.

ls_f4-chngeafter = u2018Xu2019.

ls_f4-internal = u201D.

INSERT ls_f4 INTO TABLE lt_f4.

CHECK NOT lt_f4 IS INITIAL.

CALL METHOD grf_grid_0100->register_f4_for_fields

EXPORTING

it_f4 = lt_f4.

3. In the event handler implemtation, use function module u2018F4IF_INT_TABLE_VALUE_REQUESTu2019 to pop a screen for custom F4 help.

After user selected an line, program use the selected line to update the internal table and refresh the table to update the changes to the frontend.

  • create search help

CALL FUNCTION u2018F4IF_INT_TABLE_VALUE_REQUESTu2019

EXPORTING

retfield = p_retfield

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = p_dynprofield

window_title = p_window_title

value_org = u2018Su2019

TABLES

value_tab = pt_value

field_tab = pt_field

return_tab = pt_ret

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

READ TABLE lt_ret INTO lw_ret INDEX 1.

IF sy-subrc = 0.

READ TABLE gt_result_0100 INDEX l_row INTO lw_result_0100.

lw_result_0100-cdnm = lw_ret-fieldval.

MODIFY gt_result_0100 INDEX l_row FROM lw_result_0100.

CALL METHOD grf_grid_0100->refresh_table_display.

Thanks,

Abhijit

Edited by: Abhijit Mandal on Jan 25, 2010 6:16 PM

Former Member
0 Kudos

In OO ALVs, is it possible to display F4 using a field of a table different from that which has been used to create ALV?

In my scenario, I have ABLAD field (Unloading point) being displayed as an ALV output. But, F4 for this field has to be available from a different Z field of a custom table. How is it possible?

Thanks

Vishy

Edited by: vishwanath vedula on Jan 28, 2010 1:06 PM

Edited by: vishwanath vedula on Jan 28, 2010 1:07 PM

0 Kudos

It worked for me. If anyone is wondering which event to program, as mentioned in point 3, it is the ONF4 event of CL_GUI_ALV_GRID. Thanks Abhijit!

Former Member
0 Kudos

Included a search help in the Data element of the required column field.