cancel
Showing results for 
Search instead for 
Did you mean: 

F4 help in Web Dynpro

Former Member
0 Kudos

Hi,

I have a requirement wherein I need to have F4 help on a field (Storage location- LGORT) based on the plant . I do not have this filed Plant on the screen but can fetch that in the code. I have created a Ztable which will have all the data related to the plant and storage location. The fields of the table are WERKS, LGORT and LGOBE.

The F4 help that I need for storage location (LGORT) on the screen should have data from this table based on the plant.

Thanks

Suraj

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Set the search help type as Automatic and use the following method to dynamically build your search help value list, based on the current value for plant (run the method every time the user switches focus to a new plant):

method populate_search_help .

data lo_nd_main type ref to if_wd_context_node.

data lo_el_main type ref to if_wd_context_element.

data: lo_node_info type ref to if_wd_context_node_info.

data: lt_value_table type wdy_key_value_table,

lv_key_value type wdy_key_value.

lo_nd_main = wd_context->get_child_node( name = wd_this->wdctx_main ).

  • Presuming you have an assistance class, and your table containing plant,

  • lgort and LGOBE resides there...

  • Move correct values to the value help table

field-symbols <fs_record> type z_plant_lgort_structure. " <-- line type of your Z-table

loop at wd_assist->z_plant_lgort_table " <--- your Z-table containing the values

assigning <fs_record>

where werks = lv_werks. "Presuming lv_werks is the correct plant

move <fs_record>-lgort to lv_key_value-field.

move <fs_record>-lgobe to lv_key_value-text).

append lv_key_value to lt_value_table.

endloop.

  • Set the search help value table

lo_nd_main = wd_context->path_get_node( path = `MAIN` ).

lo_node_info = lo_nd_main->get_node_info( ).

lo_node_info->set_attribute_value_set(

exporting name = `LGORT` " <--- LGORT is the field name in your view

value_set = lt_value_table ).

endmethod.

Regards,

Trond