cancel
Showing results for 
Search instead for 
Did you mean: 

Short-Dump ASSERTION_FAILED

mario_abel
Explorer
0 Kudos

Hello,

I get a short-dump when I select an value of a dropdownbykey-box in my WD-ALV. I want to change one field from dropdown to input_field if a special value is selected from the dropdownbox.

The coding in WDDOMODIFYVIEW:

**************************************************************************************************************

DATA: lo_column_settings TYPE REF TO if_salv_wd_column_settings,

lt_columns TYPE salv_wd_t_column_ref,

ls_column TYPE salv_wd_s_column_ref,

lo_column TYPE REF TO cl_salv_wd_column,

lo_input_field TYPE REF TO cl_salv_wd_uie_input_field,

lo_cv TYPE REF TO cl_salv_wd_cv_standard.

IF wd_this->m_new_entry = 'X'.

LOOP AT lt_zeiten ASSIGNING <ls_zeiten>.

IF sy-tabix = wd_this->m_row.

<ls_zeiten>-cell_variant = 'INPUT_FIELD'.

ELSE.

<ls_zeiten>-cell_variant = 'DROPDOWN_BY_KEY'.

ENDIF.

ENDLOOP.

lo_nd_zeiten = wd_context->get_child_node( name = wd_this->wdctx_zeiten ).

lo_nd_zeiten->bind_table(

new_items = lt_zeiten ).

ENDIF.

IF wd_this->m_new_entry = 'X'.

" ALV-Componenten instanzieren

lo_cmp_usage = wd_this->wd_cpuse_alv_usage( ).

IF lo_cmp_usage->has_active_component( ) IS INITIAL.

lo_cmp_usage->create_component( ).

ENDIF.

l_ref_interfacecontroller = wd_this->wd_cpifc_alv_usage( ).

lo_cmd = l_ref_interfacecontroller->get_model( ).

lo_column = lo_cmd->if_salv_wd_column_settings~get_column( 'LSTAR' ).

CREATE OBJECT lo_input_field

EXPORTING

value_fieldname = 'LSTAR'.

CREATE OBJECT lo_cv.

lo_cv->set_key( value = 'INPUT_FIELD').

lo_cv->set_editor( value = lo_input_field ).

lo_column->add_cell_variant( r_cell_variant = lo_cv ).

lo_column->set_sel_cell_variant_fieldname( 'CELL_VARIANT' ).

ENDIF.

********************************************************************************************

Any ideas, whats the problem ?

Regards,

Mario

Accepted Solutions (1)

Accepted Solutions (1)

mario_abel
Explorer
0 Kudos

ST22:

if /1WDA/VTABLE_ABSTRACT_CELL~mv_COLUMN_REF->is_grouped = abap_true and

/1WDA/VTABLE_ABSTRACT_CELL~mv_COLUMN_REF->cell is bound and

mv_SELECTED_CELL_VARIANT = /1WDA/VTABLE_ABSTRACT_CELL~mv_COLUMN_REF->variant and

/1WDA/VTABLE_ABSTRACT_CELL~mv_COLUMN_REF->grouping_value = mv_GROUPING_VALUE.

/1WDA/VTABLE_CELL~mv_IS_GROUPED = abap_true.

else.

/1WDA/VTABLE_CELL~mv_IS_GROUPED = abap_false.

/1WDA/VTABLE_ABSTRACT_CELL~mv_COLUMN_REF->grouping_value = mv_GROUPING_VALUE.

/1WDA/VTABLE_ABSTRACT_CELL~mv_COLUMN_REF->variant = mv_SELECTED_CELL_VARIANT.

endif.

>> property-UCA IFUR_NW5_SAPTABLECELL~ROWSPAN

>> UCA STANDARD|TABLE_ABSTRACT_CELL|ROWSPAN

" Has to be set on each roundtrip for grouping

IFUR_NW5_SAPTABLECELL~ROWSPAN = 1.

>> property-UCA IFUR_NW5_SAPTABLECELL~SAPTABLEID

>> UCA STANDARD|TABLE_ABSTRACT_CELL|SAPTABLEID

IFUR_NW5_SAPTABLECELLSAPTABLEID = /1WDA/VTABLE_ABSTRACT_CELLmv_TABLE_ADAPTER->m_id.

>> property-Aggregation mv_VARIANT

DATA va__VARIANT TYPE REF TO /1WDA/VABSTR_TABLE_CELL_VAR. "#EC NEEDED

>> UCA STANDARD|TABLE_DATA_CELL|VARIANT

data wd_table_cell_var type ref to CL_WD_ABSTR_TABLE_CELL_VAR. "#EC NEEDED

data ur_sthiercell type ref to ifur_nw5_sthiercell. "#EC NEEDED

if /1WDA/VTABLE_CELL~mv_IS_GROUPED = abap_false.

if mv_SELECTED_CELL_VARIANT is not initial.

read table wd_TABLE_COLUMN->CH_CELL_VARIANTS into wd_table_cell_var

with key table_line->vl_variant_key = mv_SELECTED_CELL_VARIANT.

" Check: TableColumn M_VIEW_ELEMENT must contain a cell variant with variantKey mv_S

assert sy-subrc = 0.

va__VARIANT ?= mv_VARIANT.

IF va__VARIANT is bound and va__VARIANT->m_view_element = WD_TABLE_CELL_VAR.

ELSE.

va__VARIANT ?= create_by_view_element(

view_element = WD_TABLE_CELL_VAR

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Looking at the code, it would appear that the assertion is thrown because the CELL Variant you are specifying doesn't exist in the table.

Answers (2)

Answers (2)

mario_abel
Explorer
0 Kudos

Ok, thanks that works. But now I have another problem: I could only type in the values which are defined

for the dropdownbox and I don't need the searchhelp for the new inputfield any more.

For that issue I add the following code to method WDDOMODIFYVIEW.

lo_nd_info = wd_context->get_node_info( ).

lo_nd_info = lo_nd_info->get_child_node( name = wd_this->wdctx_zeiten ).

REFRESH lt_value_set.

lo_nd_info->set_attribute_value_set( name = 'LSTAR'

value_set = lt_value_set ).

lo_nd_info->SET_ATTRIBUTE_VALUE_HELP( name = 'LSTAR'

value_help = 'DEACTIVATED' ).

But It doesn't works. Any idea?

Thanks

Mario

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Please use ST22 to view the details of the dump and share here. What exact was the section of code that the dump occured on for instance.