Application Development 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: 

error message: cannot be converted to the type of...

Former Member
0 Kudos
5,685

hi friends,

i got this error, when i write this:

data: pt_req type hrobject,

p_hrobject_list type rcf_t_hrobject.

pt_req = pt_hrobject_list.

ho can i do that?

thanks.

dana.

1 ACCEPTED SOLUTION

faisal_altaf2
Active Contributor
0 Kudos
853

Hi,

Use the following Code will Solve out your Problem,

data: pt_req type hrobject,
p_hrobject_list type HROBJECT.

pt_req = p_hrobject_list.

Or the following,

data: pt_req type hrobject,
p_hrobject_list type LINE OF rcf_t_hrobject." HROBJECT.

pt_req = p_hrobject_list.

Please Reply if any Else Issue.

Kind Regards,

Faisal

Edited by: Faisal Altaf on Feb 2, 2009 12:44 PM

5 REPLIES 5

Former Member
0 Kudos
853

Hi Dana,

The type for both the variables which you are equating should be same.

i think the type is not same and thats y u r getting an error.

Thanks.

faisal_altaf2
Active Contributor
0 Kudos
854

Hi,

Use the following Code will Solve out your Problem,

data: pt_req type hrobject,
p_hrobject_list type HROBJECT.

pt_req = p_hrobject_list.

Or the following,

data: pt_req type hrobject,
p_hrobject_list type LINE OF rcf_t_hrobject." HROBJECT.

pt_req = p_hrobject_list.

Please Reply if any Else Issue.

Kind Regards,

Faisal

Edited by: Faisal Altaf on Feb 2, 2009 12:44 PM

0 Kudos
853

thank you for replying.

no, its not working.

pt_hrobject_list is a sap variable, and i cant change it.

i want to "play" with his data, and that why i need to

give the data to pt_req.

pt_hrobject_list declare as rcf_t_hrobject

and i dont know how can i give the same values to pt_hrobject.

thanks,

dana.

0 Kudos
853

Hi,

Test the folloing Hope this time it will work.

DATA: pt_req TYPE hrobject,
pt_hrobject_list TYPE LINE OF rcf_t_hrobject." HROBJECT.

pt_req = pt_hrobject_list .

Or Please Send you Complete Code.

Please Reply if problem is still there.

Kind Regards,

Faisal

Edited by: Faisal Altaf on Feb 2, 2009 1:09 PM

Former Member
0 Kudos
853

thanks very much.