SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software
Development resources, articles, tutorials, code samples, tools and downloads for SAP HANA and ABAP, HANA Database, SQLScript, SAP UI5, Screen Personas, Web Dynpro, Workflow

Add Value Help to Web Dynpro Select Options

Search Help or Value Help screens in ABAP screens are very useful for SAP users to filter data using Select Options. In this SAP Web Dynpro tutorial, I'ld like to show how I added missing Value Help for Web Dynpro Select Options.

If you look at the below Web Dynpro application screen, you will notice that there is no Value Help button for Sales Document Type, Sales Document and Delivery Block select options.

SAP Web Dynpro application Select Options without Value Help





But I want to enhance my SAP Web Dynpro applications into the following form where Select Options are provided with Search Help functions, or Value Help options.

Select Options Search Value List on Web Dynpro screen

The original Web Dynpro application is created as follows.
I created the Select Options displayed on the WebDynpro screen in the WDDOINIT Controller Initialization Method of the MAIN View.

Here is the ABAP code in Web Dynpro application that I use in INIT method in order to create the SAP Sales Document Type, AUART field Select Option.

DATA: read_only TYPE abap_bool.

***** SELECT OPTIONS for: Sales Document Type - AUART

lt_range_auart = wd_this->m_handler->create_range_table( i_typename = 'AUART' ).

* add a new field to the selection
wd_this->m_handler->add_selection_field(
 i_id = 'AUART'
 it_result = lt_range_auart
 i_read_only = read_only
).
Code

What I changed in this ADD_SELECTION_FIELD method to add Value Help for the Selection screen is using the I_VALUE_HELP_STRUCTURE and I_VALUE_HELP_STRUCTURE_FIELD input parameters which are optional.

Here is the modified ABAP code that calls add_selection_field method with i_value_help_structure is read from VBAK Sales Order table and i_value_help_structure_field is AUART field in VBAK table.

DATA: read_only TYPE abap_bool.

***** SELECT OPTIONS for: Sales Document Type - AUART

lt_range_auart = wd_this->m_handler->create_range_table( i_typename = 'AUART' ).

* add a new field to the selection
wd_this->m_handler->add_selection_field(
 i_id = 'AUART'
 it_result = lt_range_auart
 i_read_only = read_only
 i_value_help_structure = 'VBAK'
 i_value_help_structure_field = 'AUART'
).
Code

You can see which search help will be used by calling SAP transaction code SE11 and checking AUART Sales Document Type field of VBAK table as seen below.

search-help-for-vbak-auart-sales-document-type-field

I've also altered my ABAP codes to provide search help or value help for SAP Web Dynpro application users for Sales Document number, Delivery Block using the following code.

**********
***** SELECT OPTIONS for: Sales Order Number - VBELN
**********
lt_range_vbeln = wd_this->m_handler->create_range_table( i_typename = 'VBELN' ).

* add a new field to the selection
wd_this->m_handler->add_selection_field(
 i_id = 'VBELN'
 it_result = lt_range_vbeln
 i_read_only = read_only
 i_value_help_structure = 'VBAK'
 i_value_help_structure_field = 'VBELN'
).

**********
***** SELECT OPTIONS for: Delivery Block - LIFSK
**********
lt_range_lifsk = wd_this->m_handler->create_range_table( i_typename = 'LIFSK' ).

* add a new field to the selection
wd_this->m_handler->add_selection_field(
 i_id = 'LIFSK'
 it_result = lt_range_lifsk
 i_read_only = read_only
 i_value_help_structure = 'VBAK'
 i_value_help_structure_field = 'LIFSK'
).
Code


SAP HANA and ABAP

Install SAP Free
CRM Companies List
Web Based CRM Software


Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.