on 09-30-2010 6:32 PM
Hi Guru's,
i am new for WebDynpro programming.I am trying to use select-options tutorial.
System showing select options and table binding on screen when i test the application.
I have using search button to get the value which user will i/p.for that onaction method created, i have writen the code to get the values which user will input.
Method given below is of componentcontroler
method wddoinit .
data: lt_range_table type ref to data,
rt_range_table type ref to data,
read_only type abap_bool,
lt_range_table1 type ref to data.
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( ).
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 ).
lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'S_CARR_ID' ).
wd_this->m_handler->add_selection_field( i_id = 'CARRID'
it_result = lt_range_table i_read_only = read_only ).
call method wd_this->m_handler->add_horizontal_divider
exporting
i_id = 'LINE'.
endmethod.
Method given below is of VIEW.
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.
while executing appln. error is trigger on line given below
RT_CARRID = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'S_CARR_ID' ).
Err: The following error text was processed in the system BCD : Access via 'NULL' object reference not possible.
please help me out on this issue.
Thanks and Regards
Vinayak Sapkal
hi ,
The attribute M_HANDLER is an attirbute of component controller (as told by your post) and so you cannot access it as you have done it.
You will have to access it as .
WD_COMP_CONTROLLER->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD(I_ID = 'S_CARR_ID' ).
Try doing it.
Or else , if you have created a similar attribute in your view itself , then it is "INITIAL" and hence you are getting the dump.
You will have to assign the view attribute "M_HANDLER" with the value of your component controller attribute "M_HANDLER" ,because all the initializations are done in WDDOINIT of comp controller and on component controller atribute "M_HANDLER".
Thanks,
aditya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aditya,
i have created m_handler in component controller and main view (ref to IF_WD_SELECT_OPTIONS).
I tried with WD_COMP_CONTROLLER->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD(I_ID = 'S_CARR_ID' ).
in onactionsearch but it throws error while checking 'field M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( neither in one of specified table nor defined by Data'
Thanks and Regards
Vinayak Sapkal
HI ,
Make sure that the attribute is public.
You can also also assign the view attribute (M_HANDLER) with the value of component controller attribute(M_HANDLER) in the handler of button before using it.
The problem is that the view attribute is initial .
So to overcome , you have to either use the component controller attribute or assign the component controller attribute value to view attribute and use it.
Hope I am clear.
Thnks,
aditya.
HI,
Donot create M_HANDLER both in component controller and main view. Create M_HANDLER only in component controller.
When you are using M_HANDLER in component controller emthods use WD_THIS->M_HANDLER.
When You are using M_HANDLER in methods other than component controller user WD_COMP_CONTOLLER->M_HANDLER.
Regards,
madhu
Hi Guru's,
i tried with 'WD_COMP_CONTROLLER->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD(I_ID = 'S_CARR_ID' )'
its perfectly fine.
it is not showing any error while checking and activating but when i click on search button it throws DUMP.
'The current application triggered a termination with a short dump.'
The current application program detected a situation which really
should not occur. Therefore, a termination with a short dump was
triggered on purpose by the key word MESSAGE (type X).
Thanks and Regards
Vinayak Sapkal
Hi Guru's,
i tried with 'WD_COMP_CONTROLLER->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD(I_ID = 'S_CARR_ID' )'
its perfectly fine.
it is not showing any error while checking and activating but when i click on search button it throws DUMP.
i put break point on onactionsearch method but it is not reach up to that method and throws dump.
'The current application triggered a termination with a short dump.'
The current application program detected a situation which really
should not occur. Therefore, a termination with a short dump was
triggered on purpose by the key word MESSAGE (type X).
Thanks and Regards
Vinayak Sapkal
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.