on 04-24-2012 11:34 AM
Hi All
Can you share the code how to captuer the values from select option fields.
Here I am using From date To to date .
This Date I have desgined in the layout by using Standard component wdr_select_option .
* create the used component
DATA LO_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.
LO_CMP_USAGE = WD_THIS->WD_CPUSE_SELECT_OPTIONS( ).
IF LO_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.
LO_CMP_USAGE->CREATE_COMPONENT( ).
ENDIF.
DATA LO_INTERFACE TYPE REF TO IWCI_WDR_SELECT_OPTIONS.
LO_INTERFACE = WD_THIS->WD_CPIFC_SELECT_OPTIONS( ).
DATA: LT_RANGE_TABLE TYPE REF TO DATA,
LT_RANGE_TABLE2 TYPE REF TO DATA,
RT_RANGE_TABLE TYPE REF TO DATA,
READ_ONLY TYPE ABAP_BOOL,
TYPENAME TYPE STRING.
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 = 'DATUM' ).
* add a new field to the selection
WD_THIS->M_HANDLER->ADD_SELECTION_FIELD( I_ID = 'DATUM'
This Code I had written in WDDOINT method of view .
But now my requirement is I need to captuer the data values from date range UI element into button and perform the following action.
Depending on the date Range it need to display Managers subbordinates in the table .
Thanks & Regards
Deepika
Hi Deepika
If u got an answer then make this thread is answered and close the same.
Regards,
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
As suggested, here are the steps. You need to place in the suitable place where you want to track the details.
Step1:
As menioned in your code
DATA LO_INTERFACE_CO TYPE REF TO IWCI_WDR_SELECT_OPTIONS.
LO_INTERFACE_CO = WD_THIS->WD_CPIFC_SELECT_OPTIONS( ).
Step2:
Declare range and initiliaze selection screen.
DATA: LT_RANGE TYPE REF TO DATA,
LO_HELPER TYPE REF TO IF_WD_SELECT_OPTIONS.
LO_HELPER = LO_INTERFACE_CO->INIT_SELECTION_SCREEN().
Step3:
Call method for getting data.
CALL METHOD LO_HELPER->GET_RANGE_OF_SEL_FIELD
EXPORING
I_ID = 'DATUM'
RECEIVING
RT_RANGE_TABLE = LT_RANGE.
Step4:
Assign it to field-symbol.
FIELD_SYMBOLS <FS> TYPE TABLE.
ASSIGN <LT_RANGE> TO <FS>.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Deepika,
Create one button and create one action method. and write below code.
data :
lt_date TYPE REF TO data,
ls_date LIKE LINE OF lr_date,
lv_beg_date TYPE datum,
lv_end_date TYPE datum.
FIELD-SYMBOLS: <fs_date>.
lt_date = wd_this->m_handler1->get_range_table_of_sel_field( i_id = 'DATUM' ).
ASSIGN lt_date->* TO <fs_date>.
READ TABLE <fs_date> INTO ls_date INDEX 1.
lv_beg_date = ls_date-low.
lv_end_date = ls_date-high.
U will get two dates in these two variables and
in selection statement use 'IN' with field symbol <fs_date>.
Regards,
Venkat.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Deepika,
can you try with the below.
DATA: rt_carrid TYPE REF TO data.
DATA: rt_connid TYPE REF TO data.
FIELD-SYMBOLS: <fs_carrid> TYPE table,
<fs_connid> TYPE table.
* Retrieve the data from the select option
rt_carrid = wd_this->m_handler->get_range_table_of_sel_field(
i_id = 'DATUM').
* Assign it to a field symbol
ASSIGN rt_carrid->* TO <fs_carrid>.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.