‎2008 Feb 21 6:17 AM
Hi,
The following code does not work on ecc 6. The complier returns "Could not specify the access range automatically. This means that you need a RANGE addition . . . . . . . . . ."
Any suggestion??
DO 15 TIMES VARYING P_FIELD FROM T312S-SRI00 NEXT T312S-SRI01
VARYING H_FIELD FROM T312S-SRT00 NEXT T312S-SRT01
VARYING D_FIELD FROM D00 NEXT D01
VARYING U_FIELD FROM U00 NEXT U01.
IF P_FIELD = CON_X. "absteigend / descending
D_FIELD = H_FIELD.
ELSE.
U_FIELD = H_FIELD. "aufsteigend / ascending.
ENDIF.
ENDDO.
Regards,
Kit
‎2008 Feb 21 6:30 AM
See the documentation as given below.
If RANGE is not explicitly specified, the permitted memory area is determined as follows:
1. In non-Unicode programs and before release 6.10, the permitted memory area of dobj1 extends to the limit of the current data area of the ABAP program. If the RANGE addition is not specified, there is a danger of unintentionally overwriting the memory.
2. In Unicode programs, , RANGE can only be omitted if it can be statically determined that dobj1 and dobj2 are components of the same structure. The permitted memory area is then determined from the smallest substructure that contains dobj1 and dobj2.
So just check whether D00 & D01 are components of the same structure and similarly U00 and U01 and it doesn't look like that way. So for those if we add the RANGE addition the code should work.
Reward points for all helpful answers.
Thanks,
Balaji