2023 Jun 30 9:33 AM
Hello Guys,
sorry for the noob question, I forgot the correct syntax for this and didn't find anything in SCN.
- ERROR: Specified length can contain only numeric literals or constants
Any suggestion?
Best regards,
RR.
2023 Jun 30 9:45 AM
2023 Jun 30 9:47 AM
2023 Jun 30 10:02 AM
2023 Jun 30 1:09 PM
try something like
* Build a dynamic wildcard field
lv_key_wildcard = lv_key_master(lv_key_length) && '*'.
* Use it in the where criteria
WHERE key CP lv_key_wildcard<br>
2023 Jun 30 9:59 PM
Hi Rachid,
as the compiler tells you "can only contain literals or constants". Other experts already answered, just to add that the documentation might make it clearer (https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenoffset_length.htm).
So you can either use a literal (see answer by Xiaosan Yu) or you might define a constant cv_key (instead of lv_key). Or depending on your specific requirement the wildcard alternative might be handy for you as well.
Best,
Jasmin
2023 Jul 01 7:48 AM
DATA lv_key TYPE i.
LOOP AT lt_tree INTO DATA(ls_tree).
CHECK ls_tree(lv_key) = lv_key_master.
ENDLOOP.