cancel
Showing results for 
Search instead for 
Did you mean: 

OVS in Select-options

Former Member
0 Kudos

Hi All,

i have to give the select-options for one field(Patient_id) which is not having any search help in dictionary.

plz help me to use OVS in Select -Options......

Thanks in Advance,

Ravi

Accepted Solutions (0)

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> Hi All,

>

> i have to give the select-options for one field(Patient_id) which is not having any search help in dictionary.

>

> plz help me to use OVS in Select -Options......

>

> Thanks in Advance,

> Ravi

Look at the parameter interface of the method add_selection_field (IF_WD_SELECT_OPTIONS). There are several parameters for dynamically attaching a different type of search help to a select-option. Look at I_VALUE_HELP_TYPE, I_VALUE_HELP_ID, I_VALUE_HELP_MODE, etc. This will allow you to attach an OVS to a select-option.

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi

This will be helpful

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c09fec07-0dab-2a10-dbbe-c9a26bdf...

Abhi

Edited by: Abhimanyu Lagishetti on Jun 24, 2008 11:45 AM

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> Hi

>

> This will be helpful

> https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c09fec07-0dab-2a10-dbbe-c9a26bdf...

>

> Abhi

>

> Edited by: Abhimanyu Lagishetti on Jun 24, 2008 11:45 AM

That is a nice document on Select-Options in general, but I don't see anything in it related to this question. There is example of how to link to value help or OVS. Is there something I am missing?

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Sorry, wrong post

Abhi

Former Member
0 Kudos

Hi Abhi,

Can u plz suggest me to resolve this.How to combine OVS with Select-Options.......

Regards,

Ravi

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi

In WDDOINIT code as follows to get a select option

data: lr_select_options type ref to iwci_wdr_select_options.

data: lr_cpuse type ref to if_wd_component_usage.

DATA: LR_HELPER TYPE REF TO IF_WD_SELECT_OPTIONS.

DATA: LR_TABLE TYPE REF TO DATA.

lr_cpuse = wd_this->wd_CpUse_Select_Options( ).

if lr_cpuse->has_active_component( ) = abap_false.

lr_cpuse->create_component( ).

endif.

lr_select_options = wd_This->wd_CpIfc_Select_Options( ).

LR_HELPER = LR_SELECT_OPTIONS->INIT_SELECTION_SCREEN( ).

LR_TABLE = LR_HELPER->CREATE_RANGE_TABLE( I_TYPENAME = 'CHAR1' ).

lr_HELPER->add_selection_field(

i_id = 'CHAR1'

IT_RESULT = LR_TABLE

I_VALUE_HELP_TYPE = IF_WD_VALUE_HELP_HANDLER=>CO_PREFIX_OVS

).

Now go to Methods tab of the View

add a method say ON_OVS change the method type to Event Handler and in 4th column(Event) select F4, you can see the Events available for Select Option Used Component, select ON_OVS event.

Inside the ON_OVS event handler code as you code for typical OVS, here youwill not get OVS_CALLBACK_OBJECT directly, if you want input screen you can code in phase indicator 0 and 1.

data: ovs_callback_object type ref to if_wd_ovs.

TYPES: BEGIN OF T_CHAR1,

CHAR1 TYPE CHAR1,

TEXT TYPE STRING,

END OF T_CHAR1.

DATA: LS_CHAR1 TYPE T_CHAR1.

DATA: LT_CHAR1 TYPE TABLE OF T_CHAR1.

data: lt_result type table of char1.

data: lv_char1 type char1.

field-symbols: <selection> like ls_char1,

<lt_result> type standard table,

<result> type char1.

ovs_callback_object = i_ovs_data-m_ovs_callback_object.

case ovs_callback_object->phase_indicator.

when if_wd_ovs=>co_phase_2.

LS_CHAR1-CHAR1 = '1'.

LS_CHAR1-TEXT = 'fIRST option'.

append ls_char1 to lt_char1.

LS_CHAR1-CHAR1 = '2'.

LS_CHAR1-TEXT = 'second option'.

append ls_char1 to lt_char1.

ovs_callback_object->set_output_table( output = lt_char1 ).

when if_wd_ovs=>co_phase_3.

assign ovs_callback_object->selection->* to <selection>.

assign <selection>-char1 to <result>.

assign i_ovs_data-mt_selected_values->* to <lt_result>.

append <result> to <lt_result>.

endcase.

Abhi

Former Member
0 Kudos

Hi Abhimanyu,

Your reply was very helpful for one of my scenarios. Thanks a lot.

Cheers!!!

Kuldeep

Former Member
0 Kudos

Kuldeep,

can you please post as how you achieved the solution.

thanks,