cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between assigning variable and passing as parameter

Will2
Explorer
0 Kudos
105

Hi,
Why is assigning the variable OK but passing as a parameter gives a "not type-compatible" error?

 

 

data: ls_sdata type edi_sdata.
data: ls_data TYPE e1edk01.
* this is fine:
ls_sdata = ls_data.

* this gives a not type-compatible error:
method definition: method record_sdata importing i_sdata type edi_sdata.
me->record_sdata( i_sdata = ls_data ). "error

 

 

Thanks.

View Entire Topic
ulrich_mhrke
Explorer
0 Kudos

There are stricter checks for method parameters.

If you really want this call, try this:

me->record_sdata( i_sdata = conv #( ls_data ) ).

Since edi_sdata is not a structure, I would suggest writing lv_sdata instead of ls_sdata.