‎2007 Oct 04 3:20 PM
Hi All,
Thanks for this great helpful website!
I have following code...this used to work under non unicode system...now since we are upgrading to unicode system...it is giving us error... any thoughts or guidance would be greatly appreciated.
Thanks in advanced....
DATA: BEGIN OF i0041,
date_type LIKE p0041-dar01,
date LIKE p0041-dat01,
END OF i0041.
.
.
DO 12 TIMES VARYING i0041 FROM p0041-dar01
NEXT p0041-dar02.
.
.
Error I get is as follows:
"P0041-DAR01" and "I0041" are type-incompatible.
‎2007 Oct 04 3:25 PM
‎2007 Oct 04 3:32 PM
Check this out -
DO - varying
Syntax
DO ... VARYING dobj FROM dobj1 NEXT dobj2 [RANGE range].
[statement_block]
ENDDO.
Effect
: The addition VARYING assigns a new value to a variable dobj for each run of a DO loop. It can be used more than once in a DO statement.
dobj1 and dobj2 are the first two data objects in a sequence of data objects that are the same distance apart in the memory. The data types of the data objects dobj, dobj1, and dobj2 must be flat.
<b>In Unicode programs, dobj, dobj1, and dobj2 must be compatible. Also in Unicode programs, dobj1 and dobj2 must either be structure components that belong to the same structure, or subareas of the same data object specified by offset/length specifications. </b>
In the first completion of the loop, the content of the data object dobj1 is assigned to dobj, and in the second loop, the content of the data object dobj2 is assigned. In the subsequent loops, dobj is assigned the content of the data object that is the same distance in the memory from the previously assigned data object, as dobj2 is from dobj1. There is no type conversion.
Hope above explanation helps.
Please reward points if helpful.
‎2007 Oct 04 3:32 PM
Hi J Are,
Can you show us the declaration of p0041 in your program?
Regards,
VIvek
‎2007 Oct 09 2:14 PM
Hello all,
thanks for the answers...I used field symbols to solve this error...thanks.
‎2007 Nov 05 6:31 PM
Hi J,
I'm facing the same issue and would like to see how you used field symbols to solve your problem. I haven't used them that much and I'm interested in seeing how you did.