Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

is not type compatible.

Former Member
0 Likes
1,639

Hi all

I have defined a method like this

begin of ty_plnt,

        plnt type z_cds_purc-plant,

end of ty_plnt.

TYPES: tt_pnt TYPE STANDARD TABLE OF ty_plnt

METHODS retv_bgsml

        IMPORTING

          value(iv_from) type d

          value(iv_to) type d

          value(iv_plnt) TYPE tt_pnt

        exporting

          value(et_itm_bgsml) type tt_bgsml

In my report program i am using a select-options

SELECT-OPTIONS s_plnt for z_cds_purc-plant

I am calling  the method like this

lo_itm_sum->retv_bgsml(

  EXPORTING

    iv_from    = p_ivfrm

    iv_to      = p_ivto

   iv_plnt =  s_plnt

  IMPORTING

    et_itm_bgsml = DATA(lt_itm_sum)

).

It shows an error as

What could be the possible error.

Thanks and regards

Arun Kumar Menon

Hi all

I have defined a method like this

begin of ty_plnt,

        plnt type z_cds_purc-plant,

end of ty_plnt.

TYPES: tt_pnt TYPE STANDARD TABLE OF ty_plnt

METHODS retv_bgsml

        IMPORTING

          value(iv_from) type d

          value(iv_to) type d

          value(iv_plnt) TYPE tt_pnt

        exporting

          value(et_itm_bgsml) type tt_bgsml

In my report program i am using a select-options

SELECT-OPTIONS s_plnt for z_cds_purc-plant

I am calling  the method like this

lo_itm_sum->retv_bgsml(

  EXPORTING

    iv_from    = p_ivfrm

    iv_to      = p_ivto

   iv_plnt =  s_plnt

  IMPORTING

    et_itm_bgsml = DATA(lt_itm_sum)

).

It shows an error as

What could be the possible error.

Thanks and regards

Arun Kumar Menon

2 REPLIES 2
Read only

pfefferf
Active Contributor
0 Likes
1,181

Hi Arun.

There are two problems:

- The first one is, that your select-option parameter s_plnt has a structured line type (because of defining it by SELECT-OPTIONS). The structure contains the fields SIGN, OPTION, LOW, HIGH (LOW and HIGH have the length of z_cds_purc-plant). So it does not work to transfer the select-option table to a parameter which contains only the  plnt field.

- The second one is, that a select-option table defined with SELECT-OPTIONS has a header line. So only the body of the select-option table has to be transferred.

You can solve the issue in different ways. One option would be to define a table type for DDIC structure SELOPT (or use an existing one). This table type can be used in your interface. The values of s_plnt can be moved to a table with that type using a value expression (e.g. lt_so_plnt = VALUE <your_table_type>( FOR ls_so IN s_plnt ( sign = ls_so-sign option = ls_so-option low = ls_so-low high = ls_so-high ) ) ).

Best Regards,

Florian

PS: Maybe the discussion should be moved to the general ABAP Development space, because there is not specific ABAP on HANA content affected .

Read only

Former Member
0 Likes
1,181

Try it:

TYPES: r_plnt TYPE RANGE OF z_cds_purc-plant.

METHODS retv_bgsml

  IMPORTING

     value(iv_from) TYPE d

     value(iv_to)   TYPE d

     value(iv_plnt) TYPE r_plnt

  EXPORTING

     value(et_itm_bgsml) TYPE tt_bgsml

  

SELECT-OPTIONS s_plnt for z_cds_purc-plant.

lo_itm_sum->retv_bgsml( EXPORTING iv_from = p_ivfrm

                                                          iv_to   = p_ivto

                                                          iv_plnt =  s_plnt[]

                                       IMPORTING et_itm_bgsml = DATA(lt_itm_sum)).