‎2006 Nov 24 3:38 PM
Hi All,
there is a condition in a query where i have to check for a char field is NULL or not.
how do I do it ??
select count(*) into count1 from DFKKOP
WHERE blart = 'CO'
AND betrw < 0
and augbl is NULL.
the field 'augbl' is a char type field. when i write the above query, it gives me a incorrect result. actually i want to retrieve the field(augbl) where the field value in the table DFKKOP is a space.
plz tell me how to write the query in this case.
thanks..
prad
‎2006 Nov 24 3:39 PM
use INITIAL
select count(*) into count1 from DFKKOP
WHERE blart = 'CO'
AND betrw < 0
and augbl is INITIAL.
‎2006 Nov 24 3:40 PM
Hello Prad
It should look like this:
select count(*) into count1 from DFKKOP
WHERE blart = 'CO'
AND betrw < 0
and augbl = space.Regards
Uwe
‎2006 Nov 24 3:40 PM
select count(*) into count1 from DFKKOP
WHERE blart = 'CO'
AND betrw < 0
*and augbl is NULL
<b>and augbl eq space</b>
regards,
vijay
‎2006 Nov 24 3:45 PM
Here we go :
select count(*) into count1 from DFKKOP
WHERE blart = 'CO'
AND betrw < 0
and augbl = ' ' .
OR
select count(*) into count1 from DFKKOP
WHERE blart = 'CO'
AND betrw < 0
and augbl IS INITIAL .
Cheers.
‎2006 Nov 24 3:55 PM
is INITIAL is used for NULL values ..... so that is not working ....
i have tried all the other options , such as space /' ' ......... none of the options are working ...
please let me know ur thoughts
‎2006 Nov 24 4:06 PM
hi pradipta,
just check the table BSIK with a valid entry of a vendor having more than 1 item ..
execute the code and cross check with the table entries this will give u a clear picture . also dfkkok is a structure cause im not able to see that in 4.6c.
data: count1 type i.
select count(*) into count1 from bsik
WHERE lifnr eq '0000010010'
and augbl eq space .
check sy-subrc eq 0.
write:/ count1.regards,
vijay
‎2006 Nov 24 4:18 PM