Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
r3iuk
Creator
Creator

Arithmetic Expressions in SAP Connector SQL SELECT

Hi,

Does anyone know if you can use an arithmetic expression as part of a SQL SELECT statement using the SAP Connector and if so how do you construct the statement? When I try something like:

[tempdata]:
Load
*
;
SQL SELECT
MATNR, LFGJA*100 +LFMON
FROM MBEWH
WHERE BWKEY = 'XYZ'
AND LFGJA >= 2000
;

I get an "OpenStream failed. Key = SQL_ERROR ( Number:000) " error message.

Any suggestions would be most appreciated.

1 Solution

Accepted Solutions
martin59
Specialist II
Specialist II

So, you can try :

[tempdata]:
Load
MATNR,
LFGJA*100 +LFMON
;
SQL SELECT
MATNR, LFGJA, LFMON
FROM MBEWH
WHERE BWKEY = 'XYZ'
AND LFGJA >= 2000
;


Martin

View solution in original post

4 Replies
martin59
Specialist II
Specialist II

Hi,

Have you got a role in the system ?

Did you try loading another table from the SAP Connector.

Regards,

Martin

r3iuk
Creator
Creator
Author

Hi Martin,

I can do basic table extracts no problem for example:

[tempdata]:
Load
*
;
SQL SELECT
MATNR, LFGJA, LFMON
FROM MBEWH
WHERE BWKEY = 'XYZ'
AND LFGJA >= 2000
;

This works fine. It is when I try to add an expression into the SELECT clause that I get the error.

martin59
Specialist II
Specialist II

So, you can try :

[tempdata]:
Load
MATNR,
LFGJA*100 +LFMON
;
SQL SELECT
MATNR, LFGJA, LFMON
FROM MBEWH
WHERE BWKEY = 'XYZ'
AND LFGJA >= 2000
;


Martin

r3iuk
Creator
Creator
Author

I must be having a bad day - why didn't I think of that!

Many thanks.