Skip to Content
author's profile photo Former Member
Former Member

Custom F4 help using CL_SALV_TABLE class

Hi experts,

I am displaying a report using the CL_SALV_TABLE class. I need to display the F4 search help for all the output fields.

I am using the SET_F4 and SE_DDIC_REFERENCE for the standard fields and its working correctly. See code below:

I am appending all the fields that require F4 help into GT_f4 table as there are >50 fields in the output.

LOOP AT gt_f4 INTO gs_f4.

gr_ddic-field = gs_f4-fname.

gr_ddic-table = gs_f4-tname.

TRY.

gr_column ?= gr_columns->get_column( gr_ddic-field ).

gr_column->set_ddic_reference( gr_ddic ).

gr_column->set_f4( if_salv_c_bool_sap=>true ).

CATCH cx_salv_not_found.

ENDTRY.

CLEAR gs_f4.

ENDLOOP.

But for the payment terms KNB1-ZTERM, as there is no standard serch help, I am not able to display the same in the ALV. Can anyone let me know how I can achieve this custom F4?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Oct 12, 2010 at 09:19 PM

    It looks like it is not possible with the SALV.

    But if you use the ALV Grid, you can method REGISTER_F4_FOR_FIELDS to register the behavior of the F4 help. You need to set the Register for the field:

    data: lt_f4 type LVC_t_F4,
          lwa_f4 like line of lt_f4.
    lwa_f4-FIELDNAME = 'ZTERM'.
    lwa_f4-REGISTER = 'X'.
    APPEND LWA_F4 TO LT_F4.
    

    Set the event handler for the event ONF4. Inside the event handler method you should call the FM FI_F4_ZTERM. You should also set the to let the ALV framework know that you had already handled the F4 on your own.

    method handle_on_F4.
    *  ... call FM
    *
      ER_DATA->M_EVENT_HANDLED = 'X' 
    endmethod.
    

    Here is one of the workaround to get the ALV grid object from the SALV. http://help-abap.blogspot.com/2008/12/salv-table-10-editable-salv-model.html. Do read the comments as well...

    Regards,

    Naimesh Patel

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.