cancel
Showing results for 
Search instead for 
Did you mean: 

getting an error

Former Member
0 Kudos

Hi ,

Please help me in using a ALV in webdynpros.

I am getting an error right now <b>Data no longer available when SALV_WD_TABLE GET_MODEL called</b> .

Here are the steps i did while creating Webdynpro.

1. In the prpeorties of the application , i have added the component usage for SALV_WD_TABLE.

2.Created a view FLIGHT_DISPLAY in which i have copied the node from component controller.

3. Created a ViewContainerUIElement

4.In the wddoinit method i have instanstiated the ALV component.

I have populated the details to the node in the view.

After creating the applications.

Now i am getting an error in the wddoinit method where get_model method is called.

I am new to webdynpros.

Thanks and Regards

Sohit Gulati

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Did you embed the ALV as tableview within the view to the window?

Did you bind the data from the ALV contextnode in the component controller to the data contextnode in the interface controller of the used ALV component?

Regards

Wouter Heuvelmans

Former Member
0 Kudos

Hi Wouter ,

I have done the mapping of the interface controller node to the node of the componnent controller and embedded a ALV table view only.

Thanks and Regards

Sohit Gulati

Former Member
0 Kudos

I think you have the problem with the Coding only Not with the mapping. Check whether you embed the Table view under your viewUIcontainer. and also

Just check, i am providing code from one of the example. Which will be helpful to you.

Warm Regards,

Vijay


*... check ALV component usage
  data:
    lr_salv_wd_table_usage type ref to if_wd_component_usage.

  lr_salv_wd_table_usage = wd_this->wd_cpuse_salv_wd_table( ).
  if lr_salv_wd_table_usage->has_active_component( ) is initial.
    lr_salv_wd_table_usage->create_component( ).
  endif.

*... get ALV component
  data:
    lr_salv_wd_table type ref to iwci_salv_wd_table.

  lr_salv_wd_table = wd_this->wd_cpifc_salv_wd_table( ).

*... (1) get ConfigurationModel from ALV Component
  wd_this->r_table = lr_salv_wd_table->get_model( ).

*... (2) configure ConfigurationModel
*... init TableSettings
  data:
    lr_table_settings type ref to if_salv_wd_table_settings.

  lr_table_settings ?= wd_this->r_table .

  lr_table_settings->set_visible_row_count( '15' ).

  data:
    lr_header type ref to cl_salv_wd_header.

  lr_header = lr_table_settings->get_header( ).

  data:
    l_header type string.

  concatenate sy-sysid ' Flight overview' into l_header.    "#EC NOTEXT
  lr_header->set_text( l_header ).
  lr_header->set_tooltip( 'Tooltip Flight Overview' ).      "#EC NOTEXT
  lr_header->set_image_source( 'ICON_FLIGHT' ).
  lr_header->set_image_first( abap_false ).

*... init FunctionSettings
  cl_salv_wd_model_table_util=>if_salv_wd_table_util_stdfuncs~set_all(
    r_model = wd_this->r_table ).

*... init ColumnSettings
  data:
    lr_column_settings type ref to if_salv_wd_column_settings.

  lr_column_settings ?= wd_this->r_table.

  data:
    lt_columns type salv_wd_t_column_ref.

  lt_columns = lr_column_settings->get_columns( ).

  data:
    ls_column type salv_wd_s_column_ref.

  data:
    lr_column type ref to cl_salv_wd_column.

  data:
    lr_cell_editor type ref to cl_salv_wd_uie.

  data:
    lr_text_view type ref to cl_salv_wd_uie_text_view.

  loop at lt_columns into ls_column.
    case ls_column-id.
      when 'CARRID' or 'CONNID' or 'FLDATE' or 'PLANETYPE' or
           'PRICE' or 'CURRENCY' or 'SEATSOCC' or
           'DISTANCE' or 'DISTID'.
        ls_column-r_column->set_visible( CL_WD_UIELEMENT=>E_VISIBLE-VISIBLE ).

      when others.
        ls_column-r_column->set_visible( CL_WD_UIELEMENT=>E_VISIBLE-NONE ).
    endcase.
  endloop.

*... column color
  lr_column = lr_column_settings->get_column( 'CARRID' ).

  lr_column->set_cell_design( CL_WD_ABSTR_MASTER_TABLE_COL=>E_CELL_DESIGN-POSITIVE ).

*... cell color
  lr_column = lr_column_settings->get_column( 'CONNID' ).

  lr_column->set_cell_design_fieldname( 'CELL_DESIGN' ).

*... text color on text view
  lr_column = lr_column_settings->get_column( 'FLDATE' ).

  lr_cell_editor = lr_column->get_cell_editor( ).

  case lr_cell_editor->editor.
    when if_salv_wd_c_column_settings=>cell_editor_text_view.

      lr_text_view ?= lr_cell_editor.

      lr_text_view->set_semantic_color( CL_WD_TEXT_VIEW=>E_SEMANTIC_COLOR-POSITIVE ).
  endcase.

*... cell text color on text view
  lr_column = lr_column_settings->get_column( 'PLANETYPE' ).

  lr_cell_editor = lr_column->get_cell_editor( ).

  case lr_cell_editor->editor.
    when if_salv_wd_c_column_settings=>cell_editor_text_view.

      lr_text_view ?= lr_cell_editor.

      lr_text_view->set_semantic_color_fieldname( 'SEMANTIC_COLOR' ).
  endcase.

*... init FieldSettings
  data:
    lr_field_settings type ref to if_salv_wd_field_settings.

  lr_field_settings ?= wd_this->r_table.

  data:
    lr_field type ref to cl_salv_wd_field.

*... set reference fields
  lr_field = lr_field_settings->get_field( 'PRICE' ).
  lr_field->set_reference_field( 'CURRENCY' ).
  lr_field->set_reference_field_type( if_salv_wd_c_field_settings=>reffieldtype_curr ).

  lr_field = lr_field_settings->get_field( 'PAYMENTSUM' ).
  lr_field->set_reference_field( 'CURRENCY' ).
  lr_field->set_reference_field_type( if_salv_wd_c_field_settings=>reffieldtype_curr ).

  lr_field = lr_field_settings->get_field( 'DISTANCE' ).
  lr_field->set_reference_field( 'DISTID' ).
  lr_field->set_reference_field_type( if_salv_wd_c_field_settings=>reffieldtype_quan ).

Former Member
0 Kudos

Hi,

does SAP note 1035989 help?

Regards, Heidi