1

I want to use this Open SQL code in my ABAP code :

  SELECT RIGHT( NODENAME, LENGTH( NODENAME ) - 8 )
      FROM  RSMHIERNODE
      WHERE HIEID = 'HRJ'
      INTO TABLE @lt_commentdata.

but when I try to activate the method I have this error :

In the function RIGHT , the parameter number 2 must be an abap variable. this is not the case for the expression that starts with 'LENGTH'.

Have any idea how can I solve this ?

1 Answer 1

1

You cannot use operator for length of RIGHT function. You need to give exact value. You can use SUBSTRING function with huge length.
Example:

SUBSTRING( NODENAME, 8, 999 ) 
Sign up to request clarification or add additional context in comments.

2 Comments

SUBSTRING(NODENAME, 8, 999) produces a syntax error because of missing spaces around parentheses. Shouldn't it be 9 instead of 8? Note that the parameter 2 of RIGHT can be a SQL expression from ABAP 7.55.
thank you mkysoft , it solves the problem . Just as @SandraRossi said there is a missing spaces around parentheses .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.