cancel
Showing results for 
Search instead for 
Did you mean: 

WD: Select Options shows empty ranges

Former Member
0 Kudos

Hi there,

Im using select options in my wd application... I defined a few fields (numeric, dats and so on). I was expecting that the select options in wd works like the normal ones in normal abap report.

But when I try to read the results from select options , the result range table has no sign or option value (low value ok) ... when I reach the result to a Select statement a shortdump happen with the notice there is no sign or option value in the IN parameter of the Selection statement.

Does any one know if this is standard behavior of WD select options ?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi ,

try to understand following code .

METHOD wddoinit .

  DATA:
       lr_componentcontroller TYPE REF TO ig_componentcontroller,
       l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
  DATA:
      lt_range_table       TYPE REF TO data,
      lt_types             TYPE string_table,
      rt_range_table       TYPE REF TO data,
      text                 TYPE string,
      typename             TYPE string.


  DATA: vbeln TYPE lips-vbeln,
        erdat TYPE lips-erdat,
        auart TYPE vbak-auart,
        trnsp TYPE vtadd01t-add_info,
        kunnr TYPE likp-kunnr.
  DATA:
    num_events TYPE i.
  DATA: uname TYPE sy-uname.

  uname = sy-uname.

  wd_context->set_attribute(  name = 'CUSTOMER'
  value = uname  ).

*  wd_context->GET_ATTRIBUTE( Name = 'TRANSPORTER_CODE'
*  Value = uname ).


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


  lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'VBELN_VL' ).
  wd_this->m_handler->add_selection_field(
    i_description                = 'Sales Document'
    i_id                         = 'VBELN'
    i_obligatory                 = 'X'
    it_result                    = lt_range_table
    i_value_help_structure       = 'LIPS'
    i_value_help_structure_field = 'VBELN' ).

  lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'ERDAT' ).
  wd_this->m_handler->add_selection_field( i_id = 'ERDAT'  i_obligatory = 'X' it_result = lt_range_table ).

*lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'VTTK_ADD01' ).
*wd_this->m_handler->add_selection_field( i_id = 'VTTK_ADD01' I_DESCRIPTION  = 'CHAHA' it_result = lt_range_table ).
*    wd_this->m_handler->add_selection_field(
*      i_description                = 'Transporters Code'
*      i_id                         = 'VTTK_ADD01'
*      it_result                    = lt_range_table
*      i_value_help_structure       = 'VTADD01T'
*      i_value_help_structure_field = 'ADD_INFO' ).

*Supress Global options in Used Component
  wd_this->m_handler->set_global_options(
      i_display_btn_cancel  = ''
      i_display_btn_check   = ''
      i_display_btn_execute = ''
      i_display_btn_reset   = '' ).

  lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'VBAK-AUART' ).
  wd_this->m_handler->add_selection_field(
    i_description                = 'Sales Document Type'
    i_id                         = 'AUART'
     i_obligatory                = 'X'
    it_result                    = lt_range_table
    i_value_help_structure       = 'VBAK'
    i_value_help_structure_field = 'AUART' ).

ENDMETHOD.





METHOD onactionexecute .

  DATA: node_saledoc TYPE REF TO if_wd_context_node.
  DATA: node_crdate TYPE REF TO if_wd_context_node.
  DATA: node_transcode TYPE REF TO if_wd_context_node.
  DATA: node_doctype TYPE REF TO if_wd_context_node.
  DATA: node1 TYPE REF TO if_wd_context_node.
  DATA: node2 TYPE REF TO if_wd_context_node.
  DATA: rt_saledoc TYPE REF TO data.
  DATA: rt_crdate TYPE REF TO data.
  DATA: rt_transcode TYPE REF TO data.
  DATA: rt_doctype TYPE REF TO data.

  FIELD-SYMBOLS: <fs_saledoc> TYPE table,
                  <fs_crdate> TYPE table,
                  <fs_transcode> TYPE table,
                  <fs_doctype> TYPE table.

* Retrieve the data from the select option
  rt_saledoc = wd_this->m_handler->get_range_table_of_sel_field(
  i_id = 'VBELN' ).
* Assign it to a field symbol
  ASSIGN rt_saledoc->* TO <fs_saledoc>.

* Retrieve the data from the select option
  rt_crdate = wd_this->m_handler->get_range_table_of_sel_field(
  i_id = 'ERDAT' ).
* Assign it to a field symbol
  ASSIGN rt_crdate->* TO <fs_crdate>.

* Retrieve the data from the select option
  rt_doctype = wd_this->m_handler->get_range_table_of_sel_field(
  i_id = 'AUART' ).
* Assign it to a field symbol
  ASSIGN rt_doctype->* TO <fs_doctype>.

* Retrieve the data from the select option
*rt_transcode = wd_this->m_handler->get_range_table_of_sel_field(
*i_id = 'VTTK_ADD01' ).
** Assign it to a field symbol
*assign rt_transcode->* to <fs_transcode>.

  node_saledoc = wd_context->get_child_node( name = 'S_VBELN' ).
  node_saledoc->bind_table( <fs_saledoc> ).
  node_crdate = wd_context->get_child_node( name = 'S_ERDAT' ).
  node_crdate->bind_table(  <fs_crdate> ).
  node_doctype = wd_context->get_child_node( name = 'S_AUART' ).
  node_doctype->bind_table( <fs_doctype> ).

  IF <fs_doctype> IS NOT INITIAL
    AND <fs_crdate> IS NOT INITIAL
    AND <fs_saledoc> IS NOT INITIAL
   .
    wd_comp_controller->execute_zotddelvnote_vend_tari( ).
  ENDIF.

ENDMETHOD.

Regards,

Amit solanki

Edited by: Amit Solanki on Aug 19, 2009 11:30 AM

Edited by: Amit Solanki on Aug 19, 2009 11:32 AM

Former Member
0 Kudos
METHOD wddoinit .

  DATA:
       lr_componentcontroller TYPE REF TO ig_componentcontroller,
       l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
  DATA:
      lt_range_table       TYPE REF TO data,
      lt_types             TYPE string_table,
      rt_range_table       TYPE REF TO data,
      text                 TYPE string,
      typename             TYPE string.


  DATA: vbeln TYPE lips-vbeln,
        erdat TYPE lips-erdat,
        auart TYPE vbak-auart,
        trnsp TYPE vtadd01t-add_info,
        kunnr TYPE likp-kunnr.
  DATA:
    num_events TYPE i.
  DATA: uname TYPE sy-uname.

  uname = sy-uname.

  wd_context->set_attribute(  name = 'CUSTOMER'
  value = uname  ).

*  wd_context->GET_ATTRIBUTE( Name = 'TRANSPORTER_CODE'
*  Value = uname ).


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


  lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'VBELN_VL' ).
  wd_this->m_handler->add_selection_field(
    i_description                = 'Sales Document'
    i_id                         = 'VBELN'
    i_obligatory                 = 'X'
    it_result                    = lt_range_table
    i_value_help_structure       = 'LIPS'
    i_value_help_structure_field = 'VBELN' ).

  lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'ERDAT' ).
  wd_this->m_handler->add_selection_field( i_id = 'ERDAT'  i_obligatory = 'X' it_result = lt_range_table ).

*lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'VTTK_ADD01' ).
*wd_this->m_handler->add_selection_field( i_id = 'VTTK_ADD01' I_DESCRIPTION  = 'CHAHA' it_result = lt_range_table ).
*    wd_this->m_handler->add_selection_field(
*      i_description                = 'Transporters Code'
*      i_id                         = 'VTTK_ADD01'
*      it_result                    = lt_range_table
*      i_value_help_structure       = 'VTADD01T'
*      i_value_help_structure_field = 'ADD_INFO' ).

*Supress Global options in Used Component
  wd_this->m_handler->set_global_options(
      i_display_btn_cancel  = ''
      i_display_btn_check   = ''
      i_display_btn_execute = ''
      i_display_btn_reset   = '' ).

  lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'VBAK-AUART' ).
  wd_this->m_handler->add_selection_field(
    i_description                = 'Sales Document Type'
    i_id                         = 'AUART'
     i_obligatory                = 'X'
    it_result                    = lt_range_table
    i_value_help_structure       = 'VBAK'
    i_value_help_structure_field = 'AUART' ).

ENDMETHOD.





METHOD onactionexecute .

  DATA: node_saledoc TYPE REF TO if_wd_context_node.
  DATA: node_crdate TYPE REF TO if_wd_context_node.
  DATA: node_transcode TYPE REF TO if_wd_context_node.
  DATA: node_doctype TYPE REF TO if_wd_context_node.
  DATA: node1 TYPE REF TO if_wd_context_node.
  DATA: node2 TYPE REF TO if_wd_context_node.
  DATA: rt_saledoc TYPE REF TO data.
  DATA: rt_crdate TYPE REF TO data.
  DATA: rt_transcode TYPE REF TO data.
  DATA: rt_doctype TYPE REF TO data.

  FIELD-SYMBOLS: <fs_saledoc> TYPE table,
                  <fs_crdate> TYPE table,
                  <fs_transcode> TYPE table,
                  <fs_doctype> TYPE table.

* Retrieve the data from the select option
  rt_saledoc = wd_this->m_handler->get_range_table_of_sel_field(
  i_id = 'VBELN' ).
* Assign it to a field symbol
  ASSIGN rt_saledoc->* TO <fs_saledoc>.

* Retrieve the data from the select option
  rt_crdate = wd_this->m_handler->get_range_table_of_sel_field(
  i_id = 'ERDAT' ).
* Assign it to a field symbol
  ASSIGN rt_crdate->* TO <fs_crdate>.

* Retrieve the data from the select option
  rt_doctype = wd_this->m_handler->get_range_table_of_sel_field(
  i_id = 'AUART' ).
* Assign it to a field symbol
  ASSIGN rt_doctype->* TO <fs_doctype>.

* Retrieve the data from the select option
*rt_transcode = wd_this->m_handler->get_range_table_of_sel_field(
*i_id = 'VTTK_ADD01' ).
** Assign it to a field symbol
*assign rt_transcode->* to <fs_transcode>.

  node_saledoc = wd_context->get_child_node( name = 'S_VBELN' ).
  node_saledoc->bind_table( <fs_saledoc> ).
  node_crdate = wd_context->get_child_node( name = 'S_ERDAT' ).
  node_crdate->bind_table(  <fs_crdate> ).
  node_doctype = wd_context->get_child_node( name = 'S_AUART' ).
  node_doctype->bind_table( <fs_doctype> ).

  IF <fs_doctype> IS NOT INITIAL
    AND <fs_crdate> IS NOT INITIAL
    AND <fs_saledoc> IS NOT INITIAL
   .
    wd_comp_controller->execute_zotddelvnote_vend_tari( ).
  ENDIF.

ENDMETHOD.