cancel
Showing results for 
Search instead for 
Did you mean: 

How to update select option with own range table

Former Member
0 Kudos

Hi Experts,

How can I update select option( IF_WD_SELECT_OPTIONS ) with my own range table.

Background: I'm implementing variant feature to store selection criteria for user so that they don't need to input

complex selection criteria every time. they just need to select the variant they saved last time.

But when I tried to set the range table to the existing selection field, it also throws dump( stack overflow ) , no matter

I'm using method: UPD_SELECTION_FIELD or method: SET_RANGE_TABLE_OF_SEL_FIELD.

Could you help me out here?

Thanks for you help in advance.

Regards,

Aaron.

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Instead of passing in your own range table, have you tried using the create_range_table method and then just looping at and copying the values from your range table to the table retunred from this method? Perhaps there is some incompatibility with your range table type and what is expected by the Select-Options object. Can you post some of the details from the dump.

Former Member
0 Kudos

Hi Thomas,

Thanks for your reply.

I've tried with the method: CREATE_RANGE_TABLE to create a new table for me. but it doesn't work.

Here's the error analysis:

Category ABAP Programming Error

Runtime Errors GETWA_NOT_ASSIGNED

ABAP Program CL_WDR_SELECT_OPTIONS=========CP

You attempted to access an unassigned field symbol

(data segment "-1").

This error may occur if

- You address a typed field symbol before it has been set with

ASSIGN

- You address a field symbol that pointed to the line of an

internal table that was deleted

- You address a field symbol that was previously reset using

UNASSIGN or that pointed to a local field that no

longer exists

- You address a global function interface, although the

respective function module is not active - that is, is

not in the list of active calls. The list of active calls

can be taken from this short dump.

source code:

if <field>-m_dont_care_value is bound.

lr_dont_care_value = <field>-m_dont_care_value.

else.

create data lr_dont_care_value type handle <field>-m_value_field_rtti.

endif.

assign lr_dont_care_value->* to <dont_care_value>.

  • copy the content of the current range table of that attribute to its context node

  • => get that node

node_name = i_context_node_info->get_name( ).

lr_context_node = i_parent_node->get_child_node( node_name ).

  • => clear the node (always overwrite mode)

lr_context_node->invalidate( ).

  • => perform the copy operation

assign <field>-mt_range_table->* to <range_table>.

loop at <range_table> assigning <range_table_line>. **** <====== error

  • get pointers to the fields

assign component 'SIGN' of structure <range_table_line> to <sign_rt>.

assign component 'OPTION' of structure <range_table_line> to <option_rt>.

assign component 'LOW' of structure <range_table_line> to <low_rt>.

assign component 'HIGH' of structure <range_table_line> to <high_rt>.

Former Member
0 Kudos

Hi Thomas,

The problem is solved. the root cause is the combination of not using the created range table with method CREATE_RANGE_TABLE of IF_WD_SELECT_OPTIONS and a small programing error from myself.

Thanks for your timely help.

regards,

Aaron.

Answers (1)

Answers (1)

FLSaito
Participant
0 Kudos

Hi,

Try to use the following code:

  • Set default values for field DATE

data: ls_tmprange type rsparams,

lr_headerline type ref to data,

lt_valueset_datum type ref to data.

field-symbols: <fs_param> type any,

<fs_range> type any,

<fs_rangetable> type table.

ls_tmprange-low = sy-datum.

ls_tmprange-high = sy-datum.

ls_tmprange-sign = 'I'.

ls_tmprange-option = 'EQ'.

lt_valueset_datum = wd_this->m_select_options->get_range_table_of_sel_field( 'FIELD_DATUM' ).

assign lt_valueset_datum->* to <fs_rangetable>.

create data lr_headerline like line of <fs_rangetable>.

assign lr_headerline->* to <fs_range>.

move-corresponding ls_tmprange to <fs_range>.

append <fs_range> to <fs_rangetable>.

Fabio Saito