12-14-2015 1:15 PM
Hi,
SELECT EBELN, INFNR,
MATKL,
COALESCE( s~INFNR, s~MATKL ) AS ABCD
FROM EKPO AS s
UP TO 20 ROWS
INTO TABLE @DATA(lt_result).
I am Using the previous code to test.
But if s~INFNR is null and s~MATKL consists value, then also blank is displaying in ABCD column.
Need clarification.
-Sabarna
12-17-2015 8:19 AM
In the field INFNR there is never a null value but an empty value. So you can not use coalesce here because infnr is always set
SELECT * FROM EKPO WHERE INFNR = '' ... returns a lot of results
SELECT * FROM EKPO WHERE INFNR is null ... returns no results
So in your case you should use matkl if infnr = ''
Best regards, Andreas