cancel
Showing results for 
Search instead for 
Did you mean: 

WD4ABAP: Initialise Select-Options Field with default values

jrgen_bauer
Explorer
0 Kudos

Hello

how can I initialise Select-Options Input Fields with default values?

regards

Jürgen Bauer

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Juergen,

See BLOGS on Select option tool.

Once you have had a quick look at blog,

call INIT_SELECTION_SCREEN

You get handle to IF_WD_SELECT_OPTIONS object.

There are many methods here to control behaviour of tool.

Use the CREATE_RANGE_TABLE method,

if you are uncertain about working with DATA references.

Now See SET_RANGE_TABLE_OF_SEL_FIELD

gruss

Phil

jrgen_bauer
Explorer
0 Kudos

Hello Phil,

thanks for answer.

I have looked to the BLOGS, I haven't found an helpful notice.

Is there a description for Select_Options for WD4ABAP available?

I tried to use SET_RANGE_TABLE_OF_SEL_FIELD but I don't know how to fill in data

For Example:

METHOD wddoinit .

DATA:

lt_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.

DATA:

rt_supplier_id TYPE RANGE OF lifnr,

rs_supplier_id LIKE LINE OF rt_supplier_id.

  • 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.

  • get a pointer to the interface controller of the select options

*component

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

*--->SUPPLIER_ID

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

lt_range_table = wd_this->m_handler->create_range_table(

i_typename = 'LIFNR' ).

  • add a new field to the selection

wd_this->m_handler->add_selection_field(

i_id = 'SUPPLIER_ID'

it_result = lt_range_table

i_read_only = read_only ).

  • fill range for supplier_id

rs_supplier_id-low = '8888'.

rs_supplier_id-sign = 'I'.

rs_supplier_id-option = 'EQ'.

APPEND rs_supplier_id TO rt_supplier_id .

rs_supplier_id-low = '9999'.

APPEND rs_supplier_id TO rt_supplier_id .

*???????????

*--> how can I transfer the data to lt_range_table????

*???????????

wd_this->m_handler->set_range_table_of_sel_field(

i_id = 'SUPPLIER_ID'

it_range_table = lt_range_table ).

Former Member
0 Kudos

field-symbols: <fs_supplier> type table. " this will the range table

  • you need to derefernce the data object by assigning it via the derefence pointer statement

assign lt_range_table->* to <fs_supplier>.

  • now manipulate <fs_supplier>

SET back in...

cheers

Phil.

jrgen_bauer
Explorer
0 Kudos

Hi Phil,

thanks, it works excellent.

regards

Jürgen

Ritin
Explorer
0 Kudos

hi phil,

can u tell me more on how to manilpualte <fs_supplier> please.

Thanks in advance.

Answers (0)