Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SQL - Select a constant

Former Member
0 Likes
391

Hello people,

I have a function that receives a table as a parameter.

I need to check if each enter in this table exists in table in database. If it exists, I need to mark "X" in the last column in this table. Liek this:

SELECT WERKS MATKL 'X'

INTO CORRESPONDING FIELDS OF TABLE T_LISTA

FROM yswerks_matkl

FOR ALL ENTRIES IN T_LISTA

WHERE WERKS = T_LISTA-WERKS

AND MATKL = T_LISTA-WERKS.

Is it possible?

Thanks a lot!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
341

HI,

No it is not possible.

You can take other table to save the data instead of same table. In which you get only records exists in database.

SELECT WERKS MATKL 
INTO CORRESPONDING FIELDS OF TABLE T_LISTA_TEMP "--> Take new internal table
FROM yswerks_matkl
FOR ALL ENTRIES IN T_LISTA
WHERE WERKS = T_LISTA-WERKS
AND MATKL = T_LISTA-WERKS.

1 REPLY 1
Read only

Former Member
0 Likes
342

HI,

No it is not possible.

You can take other table to save the data instead of same table. In which you get only records exists in database.

SELECT WERKS MATKL 
INTO CORRESPONDING FIELDS OF TABLE T_LISTA_TEMP "--> Take new internal table
FROM yswerks_matkl
FOR ALL ENTRIES IN T_LISTA
WHERE WERKS = T_LISTA-WERKS
AND MATKL = T_LISTA-WERKS.