cancel
Showing results for 
Search instead for 
Did you mean: 

reg:how disaplay selection range for date field

Former Member
0 Kudos

hi all

can you please let me know how to write the code in wdabap to display a date field with range option.i mean in abap we use at selection screen ,but coming to wdabap can you help how to write the code in wdabap.

Thanks in advance

Deepika

Accepted Solutions (0)

Answers (2)

Answers (2)

Sharathmg
Active Contributor
0 Kudos

In addition to creatign range table, later add the range table in "add selection field" method.

Regards,

Sharath

Former Member
0 Kudos

hi sharath

Here i am not getting data INTO CUSTOM TABLE AFTER ENTERING DATE RANGE AND CLICK ON SEARCH BUTTON THE SEARCH BUTTON SHOULD FETCH THE RECORDS ON THIS DATE RANGE INPUT AND SHOULD SEND THE DATE TO THE CUSTOM TABLE .BUT HERE HOW TO SEND DATE INPUT TO TABLE AND HOW TO FETCH THE RECORDS FROM THAT TABLE.

COULD PLEASE SHARE YOUR KNOWLEDGE FOR FURTHER PROCEEDING ON IT

thanks

DEEPIKA.

Edited by: deepika_indian on Aug 25, 2010 9:08 AM

Former Member
0 Kudos

we have standered web dynpro component WDR_SELECT_OPTIONS by reusing

this we can achieve.

here iam writing some sample code please check it:

lr_interfacecontroller type ref to iwci_wdr_select_options,

lr_range_table type ref to data,

lr_cmp_usage = wd_this->wd_cpuse_select_options( ).

if lr_cmp_usage->has_active_component( ) is initial.

lr_cmp_usage->create_component( ).

endif.

lr_interfacecontroller = wd_this->wd_cpifc_select_options( ).

wd_this->m_select_options = lr_interfacecontroller->init_selection_screen( ).

  • add the transparent container

wd_this->m_select_options->add_block(

i_id = 'MY_TRANSPARENT_CONTAINER'

i_block_type = if_wd_select_options=>mc_block_type_transp_container ).

  • add a selection field of type s_carr_id (carrier id within the SAP demo flight model)

  • => create a range table of type s_carr_id

lr_range_table = wd_this->m_select_options->create_range_table( 'S_CARR_ID' ).

like this u can pass your variable.

Former Member
0 Kudos

hi experts

i am use the WDR_SELECT_OPTIONS predefined component for getting date range field.

But here i didn't understand when i run this application we can find predefined button reset,check,copy,cancel.purpose of this buttons .More over i didn't find action events for this buttons in order to write my code.

But here my scenario is i am using two tables from one table i am using date field as input which is related to the tabel1 and retrieving some fields from that same table1.

2) i am using goods date field as input from the table1 and retrieving table2 values.

3)But i need to have both the table fields tabel1 and tabel2 into final table.

can you please guide me how to work on with this scenario

Thanks & Regards

Deepika

Former Member
0 Kudos

Hi,

When we use WDR_SELECT_OPTIONS this component we get all those options,and for ur requirement what i understand is

you have a table when u selecting on the field the related information appered on the other table if it is correct.

we have table propeties onselect with that we can achieve that, please explain clearly if it is wrong.

Former Member
0 Kudos

hi experts

Actually i am using 3 tables 1) leci_event

2) leci_event_data

3)ztrans(its a combination of above two table fields)

here i am using leci_event table which contains date field which is used as input parameter .by giving date as input i am retrieving output for that particular range date some values as output from leci_event table .

As the same i am using one more field as input from leci_event and getting data from second table leci_event_data.the output of the first two tables i am passing into third table .

i want date field to be displayed in the range format .so i have gone with predefined wdr_select_options componnet.

And the third table fields i want to display in alv table by using predefined component salv_wd_table.

can any one guide me how to work on with this issue as i am new to this platform.

Thanks in advance.

Deepika

Edited by: deepika_indian on Aug 23, 2010 12:53 PM

Former Member
0 Kudos

I don't understand why you have so many tables. As I can see you want to filter data in your table using Select-Option. I did similar task.

You can use tabstrip UI element. The first tab will contain your SO and the second ALV.

See component WDR_TEST_SELECT_OPTIONS on how to use SO.

If you want to hide some buttons in SO use this:

CALL METHOD selopt->set_global_options

EXPORTING

i_display_btn_cancel = abap_false

i_display_btn_check = abap_false

i_display_btn_reset = abap_true "show only reset button, which clears all fields

i_display_btn_execute = abap_false.

Then you should place a 'Find' button and attach an action ('Search') to it. After filling your date (or anything else), user clicks this 'Find' button and your action do its job. You should place a code in action to read the values from select-option. Something like:

DATA: lr_range TYPE REF TO data.

FIELD-SYMBOLS: <date> TYPE table.

lr_range = selopt->get_range_table_of_sel_field( i_id = 'DATE' ).

ASSIGN lr_range->* TO <date>.

Then you should filter your table usign this <date> table and display data with ALV.

Hope I wrote clearly.

Former Member
0 Kudos

hi

thanks for the information.but i dont understand what is ONACTIONSET_GET_RANGE_TABLE what this action performs.

here my scenario is depending on the date range i need to get that date range records into ALV table.please share your knowledge on this.

and when we are using select options we are getting four predefined buttons like

1)reset

2)check

3)copy

4)cancel

if we want to get this predefined actions event and in order to place the custom code in it where we need to check it.

Thanks in advance.

Deepika

Edited by: deepika_indian on Aug 24, 2010 9:11 AM

Edited by: deepika_indian on Aug 24, 2010 12:07 PM

Edited by: deepika_indian on Aug 25, 2010 7:25 AM

Sharathmg
Active Contributor
0 Kudos

To simplify the requirement, let me consider the followign understanding:

1. You need few fields in the selection screen. They need to be select options and some parameter fields.

2. The user clicks the button. You need to read teh user entered data.

Once, you have teh data in your code, assign it to the context node - attributes. later, you need to decide what you shoudl do with that data.

Sol: 1. To obtain fields into selection screen, use the component "wdr_select_options" and ass the interface view into your window. Make the view as default.

Now, you need to build the select options. Firstly create a method or insert the code in init().

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_true

i_display_btn_execute = abap_false ).

  • Adding a block (type Tray) to the select-options

wd_this->m_handler->add_block(

i_id = `BSC01`

i_block_type = if_wd_select_options=>mc_block_type_tray

i_title = `Selection Screen` ).

  • Adding a parameter field to the created block

  • Create a reference to the type of customer number KUNNR

CREATE DATA lr_field TYPE kunnr.

  • Sets the airline code initial value

ASSIGN lr_field->* TO <fs_field>.

  • Add the parameter to the group

wd_this->m_handler->add_parameter_field(

i_id = `KUNNR`

i_within_block = `BSC01`

i_obligatory = abap_true

i_value = lr_field ).

FREE lr_field.

  • Adding a select-options field to the created block

  • Create a reference to the material number range table

lr_field = wd_this->m_handler->create_range_table( `MATNR` ).

  • Add the select-option to the group

wd_this->m_handler->add_selection_field(

i_id = `MATNR`

i_within_block = `BSC01`

it_result = lr_field ).

FREE lr_field.

The code with method "set_global_options" is used to make the buttons visible or disappear.

Its convinient to create your own button with an action instead or subscribing to the action of exceute button.

Sol. 2: Read the data.

FIELD-SYMBOLS:

<fs_sel_item> LIKE LINE OF lt_sel_item,

<fs_kunnr> TYPE kunnr,

<fs_matnr> TYPE ranges_matnr.

wd_this->m_handler->get_value_of_parameter_field(

EXPORTING i_id = 'KUNNR'

RECEIVING r_value = p_kunnr ).

  • Get the selection-screen items

wd_this->m_handler->get_selection_fields(

IMPORTING et_fields = lt_sel_item ).

  • Retrieve the values from the select-options items

LOOP AT lt_sel_item ASSIGNING <fs_sel_item>.

CASE <fs_sel_item>-m_id.

WHEN `MATNR`.

ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_matnr>.

WHEN < Other sel-option'

ENDCASE.

ENDLOOP.

Obtain a reference to your context node and assign the field symbols to the attributes.

Finally, you would have the data in your nodes. Now, you need to handle the coe as per your req.

Regards,

Sharath

Edited by: Sharath M G on Aug 27, 2010 9:45 AM