08-27-2016 7:49 AM
Hello Experts,
We are in the process of adopting unicode compliance for custom ABAP programs for our unicode conversion project. There were around 70+ programs that needed to be adjusted as per UCCHECK, we have successfully made almost all of them unicode compliant, but there is an issue with one of the program which states that "Could not specify the access range automatically. This means that you need a RANGE addition." Also attached is the error screenshot to this post.
Below is an excerpt of our source code:
data: KEYF01(20) TYPE C,
KEYFXX LIKE KEYF01,
KFLN01(2) TYPE N,
KFLNXX LIKE KFLN01,
KEYF01(20) TYPE C,
KEYF02 LIKE KEYF01,
KFLN01(2) TYPE N,
KFLN02 LIKE KFLN01.
DO 10 TIMES VARYING KEYFXX FROM KEYF01 NEXT KEYF02
VARYING KFLNXX FROM KFLN01 NEXT KFLN02 .
Error:Could not specify the access range automatically. This means that you need a RANGE addition
In order to make it compatible with unicode environment we have to solve this error as soon as possible. Thank you in Advance!!!
08-27-2016 10:50 AM
This is a very old and obsolete syntax. Anyway, I find the ABAP documentation clear about what means RANGE. Unfortunately, it means that you should define your variables KEYF01, KEYF02... and KFLN01, KFLN02... inside a structure (and change it accordingly in the whole program):
data: begin of KEYFXX_STRU,
KEYF01(20) TYPE C,
KEYF02 LIKE KEYF01,
...
end of KEYFXX_STRU,
begin of KFLNXX_STRU,
KFLN01(2) TYPE N,
KFLN02 LIKE KFLN01,
...
end of KFLNXX_STRU.
DO 10 TIMES
VARYING KEYFXX FROM KEYFXX_STRU-KEYF01 NEXT KEYFXX_STRU-KEYF02 RANGE KEYFXX_STRU
VARYING KFLNXX FROM KFLNXX_STRU-KFLN01 NEXT KFLNXX_STRU-KFLN02 RANGE KFLNXX_STRU.
08-27-2016 10:50 AM
This is a very old and obsolete syntax. Anyway, I find the ABAP documentation clear about what means RANGE. Unfortunately, it means that you should define your variables KEYF01, KEYF02... and KFLN01, KFLN02... inside a structure (and change it accordingly in the whole program):
data: begin of KEYFXX_STRU,
KEYF01(20) TYPE C,
KEYF02 LIKE KEYF01,
...
end of KEYFXX_STRU,
begin of KFLNXX_STRU,
KFLN01(2) TYPE N,
KFLN02 LIKE KFLN01,
...
end of KFLNXX_STRU.
DO 10 TIMES
VARYING KEYFXX FROM KEYFXX_STRU-KEYF01 NEXT KEYFXX_STRU-KEYF02 RANGE KEYFXX_STRU
VARYING KFLNXX FROM KFLNXX_STRU-KFLN01 NEXT KFLNXX_STRU-KFLN02 RANGE KFLNXX_STRU.
08-27-2016 11:27 AM