‎2008 May 26 6:58 PM
I have a query regarding move statement when the source structure is char and the target structure is different than char.
Can i know the different possibilities of the target structure for the declaration ?
Ex: move v1 to v2.
V1 is declared as char. What are the different possibilities of declaration of V2.
Move statement has to be used. i cant replace it.
‎2008 May 26 7:06 PM
hi check this...
data:v_char(10) type c value '45.65',
j type f .
j = v_char .
write:/ j .
data:v_char(10) type c value '45',
i type i .
i = v_char .
write:/ i.
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/move.htm
regards,
venkat.
‎2008 May 26 7:41 PM
Hi Sameer,
Look at below program:
REPORT Z_TEST_PROGRAM.
data: x type i, y type f.
data: z(10) value 'abcd123'.
y = '10.50'.
move y to x.
write x.
*Output is 11.
move z to x. " This leads to dump
write x.
The data object destination can be any data object that can be listed at a write position, and the data object source can be a data object, a predefined function or a functional method (as of release 6.10). The data type of the data object destination must either be compatible with the data type of source, or it must be possible to convert the content of source into the data type of destination according to one of the conversion rules. (This is from SAP docs)
So as Destination is compatible to accept the data coming in you can use required data types.
Hope this will help..
//Kiran
‎2008 May 26 7:46 PM
hi,
V2 can be N, I or P ... You can move character to any of these variables ..
Regards,
Santosh