‎2006 Sep 18 7:05 AM
Hi,
I have condition like this
data: ab type i,
ab = 5.
now i wanted to move the value of ab to info having type c.
but it is not taking the value of c.
clear mlin.
mlin-type = 'S'.
mlin-info = ???
what i have to write in place of ??? so that it will display the value of ab in mlin-info.
‎2006 Sep 18 7:08 AM
‎2006 Sep 18 7:08 AM
1st check the lenght of <b>mlin-info = ???</b>it is more than 16 bit.
before conversion remember . char type take 1 byte and integer type take 2 byte
‎2006 Sep 18 7:08 AM
Please check this,it worked.
data:ab type i.
data:c type c.
ab = 5.
c = ab.
write:/ c.
regards
‎2006 Sep 18 7:10 AM
Hi Salil,
check the coding for your test case as below:
REPORT Z_TEST .
data: ab type i value 5.
data: begin of mlin occurs 0,
typ type c,
info type c,
end of mlin.
clear mlin.
mlin-typ = 'S'.
mlin-info = ab.
append mlin.
loop at mlin.
write: / mlin-typ, mlin-info.
endloop.
Execute this, you will get your answer.
P.S. mark all helpful asnwers for points.
JLN
‎2006 Sep 18 7:11 AM
Below code works for me, kindly check the same on your
system.
data: l_num type i value 5.
data: l_char(1) type c.
data: begin of l_struc,
num type c,
end of l_struc.
l_char = l_num.
l_struc-num = l_num.
write:/ l_char.
write:/ l_struc-num.Kind Regards
Eswar