cancel
Showing results for 
Search instead for 
Did you mean: 

a ALV with some editable fields which have dictionary search help

Former Member
0 Kudos

Hi all:

There is a requirement to implement an ALV with some editable fields which have dictionary search help, do you have any idea?

thank you very much

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi - yes it can be done.

1st in your object select the component SALV_WD_TABLE (ALV component) * do all the bindings of your component to your VIEW, Component usage interface, etc.

When you are declaring your context node attributes if you add a TYPE Data element that has a search help bind to the data element it will be accessible in your ALV or in the Attribute there's a INPUT HELP that option that you can add the search help there but you need to have your ALV input enable

for example:



data: lr_input_field  Type Ref To cl_salv_wd_uie_input_field,
lt_column Type salv_wd_t_column_ref,
ls_colum Type salv_wd_s_column_ref,
lv_value Type Ref To cl_salv_wd_config_table,
l_col_name type string,
lr_cmp_usage Type Ref To if_wd_component_usage,
lo_interfacecontroller Type Ref To iwci_salv_wd_table.

lr_cmp_usage = wd_this->wd_cpuse_alv( ).  *ALV is the name you enter for your component usage when declaring component SALV_WD_TABLE at the beginning.
if lr_cmp_usage->has_active_component( ) IS INITIAL.
lr_cmp_usage->create_component( ).
endif.

lo_interfacecontroller = wd_this->wd_cpifc_alv( ). *once again your ALV name
lv_value = lo_interfacecontroller->get_model( ).
lt_columns = lv_value->if_salv_wd_column_settings~get_columns( ).

Loop at lt_columns into ls_column.
l_col_name = ls_column-r_column->get_id( ).
create object lr_input_field
exporting
value_fieldname = l_col_name.
ls_column-r_column->set_cell_editor( value = lr_input_field ). *this will made all your columns input fields
endloop.

hope this help!

Jason PV

Former Member
0 Kudos

thank you very much for your reply, it really helps. just one thing I am wondering about is the following , " there's a INPUT HELP that option that you can add the search help there but you need to

have your ALV input enable", you mean to add a input help , but to ALV or cl_salv_wd_uie_input_field?because in the class of cl_salv_wd_uie_input_field, I couldn't find a method to

add a help, could you please explain it futher?

**********************************************************************************

there's a INPUT HELP that option that you can add the search help there but you need to

have your ALV input enable

Former Member
0 Kudos

Sorry for the bad grammar, now that I'm reading again is kind of difficult to understand

I meant that when you are declaring your context node and the node attributes, if the field that you are adding as an attribute has a search help by deafult then your ALV will display the search help for example:

I want to add a field for DATES in my ALV with searh help, my field DATES has data element DATUM that has by default search help CALENDAR so when I add to the context node an attribute DATES TYPE DATUM it will automatically get the search help but for the user to select the search help in the ALV you need to have your ALV input enable (and you do it with the code that I wrote).

now if you have a field XYZ that doesnt have a search help by default you can go to the CONTEXT node that you are creating and when you add the ATTRIBUTE XYZ TYPE ZYX in the ATTRIBUTE properties there's an option to add search helps so you can also add search help in that area.

Basically I'm explaining 2 different ways to add search help to your ALV fields in the CONTEXT node.

The code is just to make your ALV input enable.

hope is more clear now!

Please provide points if its helpful,

thanks!

Jason PV

Answers (0)