Skip to Content
avatar image
Former Member

Select Options

Hi all,

I have this problem. I have a select options (ZLOEVM) in my view and for retrieve the information from this select options I use this code:

data zloevm type ref to DATA.

FIELD-SYMBOLS: <ZLOEVM> TYPE TABLE.

data ls_select_options type ZPS_TT_SELECT_OPTIONS.

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( ).

ZLOEVM = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'LOEVM' ).

ASSIGN ZLOEVM->* TO <ZLOEVM>.

LS_SELECT_OPTIONS = <ZLOEVM>.

My structure ZPS_TT_SELECT_OPTIONS has this fields:

FIELDNAME (type string), SIGN, OPTION, LOW (string) and HIGH (string).

I have a dump when I run this code: LS_SELECT_OPTIONS = <ZLOEVM>.

The error is "Two internal tables are neither compatible nor convertible".

Can you help me?

TKS

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Dec 23, 2010 at 12:15 PM

    Hi,

    Try the below coding.

    In the initialization,

    METHOD WDDOINIT .

    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 = 'S_CARR_ID' ).

    • add a new field to the selection

    WD_THIS->M_HANDLER->ADD_SELECTION_FIELD( I_ID = 'S_CARR_ID'

    IT_RESULT = LT_RANGE_TABLE I_READ_ONLY = READ_ONLY ).

    ENDMETHOD.

    In the Button Action write the following code

    METHOD ONACTIONSEARCH .

    DATA: NODE_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE.

    DATA: RT_CARRID TYPE REF TO DATA.

    DATA: ISFLIGHT TYPE TABLE OF SFLIGHT.

    DATA: WSFLIGHT TYPE SFLIGHT.

    FIELD-SYMBOLS: <FS_CARRID> TYPE TABLE.

    • Retrieve the data from the select option

    RT_CARRID = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'S_CARR_ID' ).

    • Assign it to a field symbol

    ASSIGN RT_CARRID->* TO <FS_CARRID>.

    CLEAR ISFLIGHT. REFRESH ISFLIGHT.

    SELECT * INTO CORRESPONDING FIELDS OF TABLE ISFLIGHT FROM SFLIGHT

    WHERE CARRID IN <FS_CARRID>.

    NODE_FLIGHTS = WD_CONTEXT->GET_CHILD_NODE( NAME = `FLIGHTS` ).

    NODE_FLIGHTS->BIND_ELEMENTS( ISFLIGHT ).

    ENDMETHOD.

    Regards,

    Balaji.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 21, 2010 at 12:31 PM

    hI,

    Try this.

    DATA lo_interfacecontroller TYPE REF TO iwci_wdr_select_options .

    lo_interfacecontroller = wd_this->wd_cpifc_select_options( ).

    DATA lo_r_helper_class TYPE REF TO if_wd_select_options.

    lo_r_helper_class = lo_interfacecontroller->init_selection_screen( ).

    • Creating range table

    DATA lt_range TYPE REF TO data.

    CALL METHOD lo_r_helper_class->create_range_table

    EXPORTING

    i_typename = ''PERNR_D'

    RECEIVING

    rt_range_table = lt_range.

    • Disabling the global options

    CALL METHOD lo_r_helper_class->set_global_options

    EXPORTING

    i_display_btn_cancel = abap_false

    i_display_btn_check = abap_false

    i_display_btn_reset = abap_false

    i_display_btn_execute = abap_false.

    • Adding the selection field

    CALL METHOD lo_r_helper_class->add_selection_field

    EXPORTING

    i_id = 'PERNR_D'

    I_OBLIGATORY = ABAP_TRUE

    i_value_help_type = if_wd_value_help_handler=>CO_PREFIX_SEARCHHELP

    I_VALUE_HELP_ID = 'PREM'

    it_result = lt_range.

    Check this artcle for more details which uses VBELN as select option with search help.

    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/103e43d5-fdb8-2d10-90ab-b5e8532cbc04

    Add comment
    10|10000 characters needed characters exceeded