cancel
Showing results for 
Search instead for 
Did you mean: 

String literal is expected in ABSL

dav_lee
Explorer
0 Kudos

Hi experts.

I am working with SAP ByDesign and I got an error as below:

"String literal is expected."

This is my code:

-------------------------------------------------------------------------------------------

line1 : var query = CustomerInvoice.QueryByElements;

line2 : var params = query.CreateSelectionParams();

line3 : var signCode = "I";

line4 : params.Add(query.ReleaseStatusCode, signCode, "EQ", "3");

-------------------------------------------------------------------------------------------

I got an error at line4 "signCode".

So, I tried this

var signCode:LANGUAGEINDEPENDENT_SHORT_Name = "I";

And I still have an error as "String literal is expected.".

Surely, the below syntax is working good.

params.Add(query.ReleaseStatusCode, "I", "EQ", "3");

Is there anyone who can explain what I made wrong and understood wrong way?

Thanks.

Lee

Accepted Solutions (1)

Accepted Solutions (1)

anant_acharya
Advisor
Advisor
0 Kudos

Dear Lee,

As per documentation:

String Literals String expressions begin and end with double or single quote marks, and these string expressions are subject to backslash escape. The scripting engine does not support any escape sequences in the literals. In general, we do not recommend using escape sequences.

Please refer

7.3.3 Syntax of Front-End Scripts
for more details.

ANant

Answers (1)

Answers (1)

dav_lee
Explorer
0 Kudos

Hi Anant.

Thank you for your quick reply.

I am still wondering according to below reason:

--------------------------------------------------------------

var msgStatus = "E";

raise msgDateTermError.Create(msgStatus);

--------------------------------------------------------------

That is working well.

I reckon above code should not be worked according to 7.3.3 Syntax of Front-End Scripts.

Maybe I missed something to understand clearly.

Thank you.

Lee