cancel
Showing results for 
Search instead for 
Did you mean: 

select-options for input field

Former Member
0 Kudos

hi,

Is it possible to use 'Select-options' in web dynpro for the input field like we use in abap?

Ex. material is the input field. i want to select range also for this input field using 'Select-options'

I have tried only with ovs(f4 help) for the input field. can u pls tel me how to use if it is possible ?

Thanks,

Aishwarya.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Aishwarya,

Pelase search before posting. this is basic question.

Yes, you can use select options. you have to use WDR_SELECT_OPTIONS component for this.

Please check this..

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

also this..

http://wiki.sdn.sap.com/wiki/display/Snippets/WebDynproABAP-Complexselect-optionscomponent+usages

Cheers,

Kris.

Former Member
0 Kudos

Is it possible to have 3 select - options ?

Former Member
0 Kudos

Hi,

it is possible , the documents explains clearly.try before searching.

Former Member
0 Kudos

DATA: LT_RANGE_TABLE TYPE REF TO DATA,

RT_RANGE_TABLE TYPE REF TO DATA,

READ_ONLY TYPE ABAP_BOOL,

TYPENAME TYPE STRING. DATA: LR_COMPONENTCONTROLLER TYPE REF

TO IG_COMPONENTCONTROLLER,

L_REF_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.

  • create the used component

L_REF_CMP_USAGE = WD_THIS->WD_CPUSE_SELECT_OPTIONS( ).

IF L_REF_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.

L_REF_CMP_USAGE->CREATE_COMPONENT( ).

ENDIF.

WD_THIS->M_WD_SELECT_OPTIONS = WD_THIS->WD_CPIFC_SELECT_OPTIONS( ).

  • init the select screen

WD_THIS->M_HANDLER =

WD_THIS->M_WD_SELECT_OPTIONS->INIT_SELECTION_SCREEN( ).

WD_THIS->M_HANDLER->SET_GLOBAL_OPTIONS(

I_DISPLAY_BTN_CANCEL = ABAP_FALSE

I_DISPLAY_BTN_CHECK = ABAP_FALSE

I_DISPLAY_BTN_RESET = ABAP_FALSE

I_DISPLAY_BTN_EXECUTE = ABAP_FALSE ).

*create a range table that consists of this new data element

LT_RANGE_TABLE = WD_THIS->M_HANDLER->CREATE_RANGE_TABLE(

I_TYPENAME = 'matnr' ).

  • add a new field to the selection

WD_THIS->M_HANDLER->ADD_SELECTION_FIELD(

I_ID = 'matnr'

IT_RESULT = LT_RANGE_TABLE

I_READ_ONLY = READ_ONLY ).

This is my code followed by saptechnical. but when i exec, am getting err like the type matnr is invalid.

Former Member
0 Kudos

Hi Aishwarya,

instead matnr.. give like this..'MATNR'

Try like this..code..

lr_field = wd_this->m_helper->create_range_table( `ZFILENAME` ). // your field
  wd_this->m_helper->add_selection_field(
    i_id           = `ZFILENAME`
    I_DESCRIPTION  = 'File Name'
*    i_within_block = `BL01`
    it_result      = lr_field ).
  FREE lr_field.

Cheers,

Kris.

Former Member
0 Kudos

thanks kris. If i use it for 2 more input fields and exec, dynamic type conflict araises. i also used free lr_field. can u pls tel me how to solve this issue ?

Former Member
0 Kudos

Hi Aishwarya,

You can use for any no of input fields... type conflict emans.. check data types.

lr_field = wd_this->m_helper->create_range_table( `ZFILENAME` ).
  wd_this->m_helper->add_selection_field(
    i_id           = `ZFILENAME`
    I_DESCRIPTION  = 'File Name'
*    i_within_block = `BL01`
    it_result      = lr_field ).
  FREE lr_field.

  lr_field = wd_this->m_helper->create_range_table( `ZCLM_STATUS` ).
  wd_this->m_helper->add_selection_field(
    i_id           = `ZCLM_STATUS`
    I_DESCRIPTION  = 'Claim Status'
*    i_within_block = `BL01`
    it_result      = lr_field ).
  FREE lr_field.

Cheers,

Kris.

Former Member
0 Kudos

DATA: lr_field TYPE REF TO data.

CREATE DATA lr_field TYPE matnr.

lr_field = wd_this->m_helper->create_range_table( 'MATNR' ).

  • add a new field to the selection

wd_this->m_helper->add_selection_field(

i_id = 'MATNR'

it_result = lt_range_table

i_read_only = read_only ).

FREE lr_field.

CREATE DATA lr_field TYPE werks.

lr_field = wd_this->m_helper->create_range_table( 'WERKS' ).

  • add a new field to the selection

wd_this->m_helper->add_selection_field(

i_id = 'WERKS'

it_result = lr_field

i_read_only = read_only ).

Former Member
0 Kudos

Hi Aishwarya,

What type you used for MATNR and WERKS?

you ahve to use range table. like below

TYPES : S_MATNR   TYPE RANGE OF ZMATNR_RAN,
                S_WERKS  TYPE RANGE OFZWERKS_RAN.
   DATA :  lr_field TYPE REF TO data.

  lr_field = wd_this->m_helper->create_range_table( `MATNR` ).
  wd_this->m_helper->add_selection_field(
    i_id           = `MATNR`
    I_DESCRIPTION  = 'Material'
*    i_within_block = `BL01`
    it_result      = lr_field ).
  FREE lr_field.

  lr_field = wd_this->m_helper->create_range_table( `WERKS` ).
* Add the select-option to the group
  wd_this->m_helper->add_selection_field(
    i_id           = `WERKS`
    I_DESCRIPTION  = 'Plant'
*    i_within_block = `BL01`
    it_result      = lr_field ).

  FREE lr_field.

Cheers,

Kris.

Former Member
0 Kudos

Where shud i have to use those types ??? s_matnr and s_werks ??

Former Member
0 Kudos

Hi

Kindly post your complete code, and check in debugging where you are getting error. go to st22 and check.

you can follow links above which i post in my first post.

Cheers,

Kris

Former Member
0 Kudos

thanks. its working fine now. sorry for bothering too much.

Former Member
0 Kudos

Hi,

Good...No issues..

Cheers,

Kris.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Krishna ,

How can we create select options for input field in standard webdynpro component.

if u have any code snippets please send to ravi2389@gmail.com

thanks in advance,