cancel
Showing results for 
Search instead for 
Did you mean: 

Error when inserting or changing in a sorted table

former_member198064
Participant
0 Kudos

Hi Experts,

When i am executing a webdynpro application it says Error when inserting or changing in a sorted table. Can any one help for this.

The termination type was: RABAX_STATE

The ABAP call stack was:

Method: GET_CATEGORY_LIST of program /1BCWDY/F9XHYWN4WKNMG4CDUGA8==CP

Method: IF_COMPONENTCONTROLLER~GET_CATEGORY_LIST of program /1BCWDY/F9XHYWN4WKNMG4CDUGA8==CP

Method: WDDOMODIFYVIEW of program /1BCWDY/F9XHYWN4WKNMG4CDUGA8==CP

Method: IF_WDR_VIEW_DELEGATE~WD_DO_MODIFY_VIEW of program /1BCWDY/F9XHYWN4WKNMG4CDUGA8==CP

Method: DO_MODIFY_VIEW of program CL_WDR_DELEGATING_VIEW========CP

Method: MODIFY_VIEW of program CL_WDR_VIEW===================CP

Method: DO_MODIFY_VIEW of program CL_WDR_CLIENT_COMPONENT=======CP

Method: DO_MODIFY_VIEW of program CL_WDR_WINDOW_PHASE_MODEL=====CP

Method: PROCESS_REQUEST of program CL_WDR_WINDOW_PHASE_MODEL=====CP

Method: PROCESS_REQUEST of program CL_WDR_WINDOW=================CP

in ST22

  • Object Definition

DATA: lo_node TYPE REF TO if_wd_context_node,

lo_node_info TYPE REF TO if_wd_context_node_info,

lo_element TYPE REF TO if_wd_context_element.

  • Additional Data declarations

DATA: lv_key TYPE string.

  • Get context node.

lo_node = wd_context->get_child_node( name = 'DROPDOWNLISTS' ).

lo_node_info = lo_node->get_node_info( ).

  • Call method to fetch the categories.

CALL METHOD cl_hap_wd_start_page_ui=>category_get_list

EXPORTING

add_on_application = add_on_application

IMPORTING

t_categories = lt_categories.

  • Append Default selection entry 'All'.

lw_category-category_id = '00000000'.

lw_category-category_name = 'All'.

APPEND lw_category TO lt_categories.

  • Sort table after appending the new entry.

SORT lt_categories ASCENDING.

  • Loop through the category list and populate key(category_id) value(category_name) pair for

LOOP AT lt_categories INTO lw_category.

lw_key_value-key = lw_category-category_id.

625 lw_key_value-value = lw_category-category_name.

>>>>> APPEND lw_key_value TO lt_key_values.------>Here it throws an error

627 CLEAR: lw_key_value, lw_category.

628 ENDLOOP.

629

630 * Bind the category key-value pair to the context attribute.

631 CALL METHOD lo_node_info->set_attribute_value_set

632 EXPORTING

633 name = 'CATEGORY_LIST'

634 value_set = lt_key_values.

635

636 * Make the entry 'All' as default selected.

637 CALL METHOD lo_node->set_attribute

638 EXPORTING

639 value = '00000000'

640 name = 'CATEGORY_LIST'.

641

642 ENDMETHOD.

643

644 method GET_EMPLOYEES.

645

Accepted Solutions (0)

Answers (1)

Answers (1)

saravanan_narayanan
Active Contributor
0 Kudos

Hello Durga,

from the error what I understood is lt_key_values is a sorted table and you are trying append a new line to it. Incase of sorted table you need to use the INSERT statement and not the APPEND statement.


INSERT lw_key_value INTO table lt_key_values.

BR, Saravanan

former_member198064
Participant
0 Kudos

Hi saravan,

625 lw_key_value-value = lw_category-category_name.

>>>>> APPEND lw_key_value TO lt_key_values.------>Here it throws an error

627 CLEAR: lw_key_value, lw_category.

628 ENDLOOP.

here you says that instead of append we need to write insert statement.Please help me for this issue.

saravanan_narayanan
Active Contributor
0 Kudos

Hello Durga,

thats correct. Append statement should be replaced with INSERT statement


INSERT lw_key_value INTO TABLE lt_key_values.

BR, Saravanan

former_member198064
Participant
0 Kudos

Hi,

Thanks Problem is solved.