question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

parse_error in COND inside LET

See original GitHub issue

This code raises a parse_error, caused by COND inside the LET statement:

rv_info = CONV string(
        LET height_dec  = COND #( WHEN lv_height_unit = 'M'  THEN 2 ELSE 0 )
            weight_dec  = COND #( WHEN lv_weight_unit = 'KG' THEN 1 ELSE 0 )
            height_unit = to_lower( lv_height_unit )
            weight_unit = to_lower( lv_weight_unit )
            height = COND #( WHEN lv_height <> 0
                         THEN |{ 'Height'(001) }: { lv_height NUMBER = USER DECIMALS = height_dec } { height_unit }| )
            weight = COND #( WHEN lv_weight <> 0
                         THEN |{ 'Weight'(002) }: { lv_weight NUMBER = USER DECIMALS = weight_dec } { weight_unit }| )
            IN COND #( WHEN height IS NOT INITIAL AND weight IS NOT INITIAL
                           THEN |{ height } \| { weight }|
                       WHEN height IS NOT INITIAL
                           THEN |{ height }|
                       WHEN weight IS NOT INITIAL
                           THEN |{ weight }| ) ).

Statement does not exist in ABAPv754(or a parser error), “rv_info”(parser_error)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
larshpcommented, Apr 14, 2020

regarding types, note that ABAP has a lot of implicit conversions, following runs without problems

  DATA(lv_height) = 2.
  DATA(sdf1) = |{ lv_height NUMBER = USER DECIMALS = '2' }|.
  DATA(sdf2) = |{ lv_height NUMBER = USER DECIMALS = `2` }|.
  DATA(sdf3) = |{ lv_height NUMBER = USER DECIMALS = '2' + 1 }|.

only something like

DATA(sdf4) = |{ lv_height NUMBER = USER DECIMALS = 'A' }|.

dumps, but it dumps at runtime, no syntax errors or warnings

0reactions
jrodriguez-rccommented, Apr 14, 2020

Right, I was using an old version from npmjs. Changed not works ok. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parse error on input 'if' when trying to use a condition inside a ...
I have the following code and I already tried multiple ways to write this, but I can't make it work. What I need...
Read more >
Formula Parse Errors In Google Sheets And How To Fix Them
formula parse error occurs when you have an invalid reference. Missing reference: For example when you reference a cell in your formula that...
Read more >
SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
This string has to be valid JSON and will throw this error if incorrect syntax was encountered. Examples. JSON.parse() does not allow trailing...
Read more >
Learn how to handle errors in Go (Golang) | golangbot.com
Let's say we are trying to open a file and the file does not exist in the file system. This is an abnormal...
Read more >
Exception and Error Handling in Python - DataCamp
Syntax errors often called as parsing errors, are predominantly caused when the parser detects a syntactic issue in your code. Let's take an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found