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

EXPORT / IMPORT

Former Member
0 Likes
912

Hai all!

I have two programs like this :

report test1.

DATA :

w_char TYPE n VALUE '1'.

EXPORT w_char TO MEMORY ID 'ABC'.

SUBMIT test2 AND RETURN.

WRITE 😕 w_char.

-


report test2.

DATA :

w_char TYPE c.

IMPORT w_char FROM MEMORY ID 'ABC'.

WRITE 😕 w_char.

If i execute test1 i am getting a runtime error.

The Dump says "Error when attempting to import w_char".

My doubt is w_char in test1 is of type N and in test2 it is of type C, So why is it not taking 1 into w_char field in test2 when types of the field in test1 and test2 are type compatible.

Thanks in advance,

Swapna.

1 ACCEPTED SOLUTION
Read only

former_member195383
Active Contributor
0 Likes
888

Both the types are not compatible.Thats wy the error is coming if u want to store the importing value in the character variable, then do onething...

In test2

Declare one field wf_temp of type n.

Import to wf_temp.

then wf_char = wf_temp.

This may help...

If helpful...reward points....

Edited by: Rudra Prasanna Mohapatra on Jun 24, 2008 1:36 PM

7 REPLIES 7
Read only

Former Member
0 Likes
888

Hi Naga,

please decalare the variable: w_char TYPE I .

This will fix the problem.

&***********Reward point if helpful*************&

Read only

former_member195383
Active Contributor
0 Likes
889

Both the types are not compatible.Thats wy the error is coming if u want to store the importing value in the character variable, then do onething...

In test2

Declare one field wf_temp of type n.

Import to wf_temp.

then wf_char = wf_temp.

This may help...

If helpful...reward points....

Edited by: Rudra Prasanna Mohapatra on Jun 24, 2008 1:36 PM

Read only

Former Member
0 Likes
888

Exactly,

you are right.they are type mismatched.please declear as same type.

Amit.

Read only

Former Member
0 Likes
888

Hi,

w_char declared in test1 and test2 reports should be of same data type.

Read only

Former Member
0 Likes
888

Hi Swapna,

Import it to a numeric type and then assign it to a character type to suit your requirement.

Thanks,

Keerthi.

Read only

Former Member
0 Likes
888

Hi Swapna,

both the types SHOULD be same.

convertible and compatible are not the words.

Reward if useful.

I.

Read only

Former Member
0 Likes
888

Thanks All