cancel
Showing results for 
Search instead for 
Did you mean: 

Type Compatible error

Former Member
0 Kudos

Hi,

I have a four column, one row value in an internal table for a select option sign, option, low and high. I need to pass this one to the select option component to display the values when the system is called. am passing the value to the class 'IF_WD_SELECT_OPTIONS' method 'SET_RANGE_TABLE_OF_SEL_FIELD' parameter 'IT_RANGE_TABLE' with the std type 'DATA'... am facing type compatible error. Give an idea to convert the internal table or workarea value to this IIT_RANGE_TABLE.

Thanks,

Sivasaravanan Nagarajan

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You need to declare a data type as a Range. Use the special syntax:

DATA rtab TYPE RANGE OF type.

You can also create range table types in the data dictionary.

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/00/958fb7e42b11d295f700a0c929b3c3/frameset.htm

Answers (2)

Answers (2)

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

As suggested already, this is the way.

  • Creating range table

DATA lt_range TYPE REF TO data.

CALL METHOD lo_r_helper_class->create_range_table

EXPORTING

i_typename = 'VBELN'

RECEIVING

rt_range_table = lt_range.

Check this article. In this, I am explaining how to create select option.

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/103e43d5-fdb8-2d10-90ab-b5e8532cbc04

krishnendu_laha
Active Contributor
0 Kudos

Hello,

Please see below example code for a possible solution:

DATA:
    lr_range                 TYPE REF TO data,
    lrf_handler             TYPE REF TO IF_WD_SELECT_OPTIONS.

  FIELD-SYMBOLS:
    <fs_table>               TYPE STANDARD TABLE.


* Create range tabel
  lrf_range = wd_this->lrf_handler->create_range_table(
                                     i_typename = ih_id ).

* Assign it to a field symbol
  ASSIGN lrf_range->* TO <fs_table>.

  IF sy-subrc EQ 0.
*   Fill it!
    <fs_table> = ii_range_table.

    wd_this->lrf_handler->set_range_table_of_sel_field(
                           i_id           = ih_id
                           it_range_table = lrf_range ).
  ENDIF.

Former Member
0 Kudos

I have solved my problem with similar codes, i have passed workarea vaue by creating an data object as like line of the table type we used for the reference of internal table...

Thanks for all of you who tried to solve thisnissue. thanks once again.