‎2008 Jun 24 12:32 PM
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.
‎2008 Jun 24 12:36 PM
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
‎2008 Jun 24 12:33 PM
Hi Naga,
please decalare the variable: w_char TYPE I .
This will fix the problem.
&***********Reward point if helpful*************&
‎2008 Jun 24 12:36 PM
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
‎2008 Jun 24 12:38 PM
Exactly,
you are right.they are type mismatched.please declear as same type.
Amit.
‎2008 Jun 24 12:41 PM
Hi,
w_char declared in test1 and test2 reports should be of same data type.
‎2008 Jun 24 12:42 PM
Hi Swapna,
Import it to a numeric type and then assign it to a character type to suit your requirement.
Thanks,
Keerthi.
‎2008 Jun 24 12:46 PM
Hi Swapna,
both the types SHOULD be same.
convertible and compatible are not the words.
Reward if useful.
I.
‎2008 Jun 24 1:32 PM