Application Development 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: 

how to check date type is initial

Former Member
0 Kudos

there is SQL sentence.

---

DATA: BEGIN OF it OCCURS 0,

matnr LIKE mara-matnr,

laeda LIKE mara-laeda,

END OF it.

select matnr laeda

from mara

where laeda <> space.

---

How can I check the laead field is initial.

Regards.

1 ACCEPTED SOLUTION

JozsefSzikszai
Active Contributor

I checked and IS NULL does not work either....

laeda is a date field, so the only correct solution is:

... laeda EQ '00000000'.

8 REPLIES 8

bpawanchand
Active Contributor
0 Kudos

select matnr laeda

from mara

where laeda IS INITIAL.

0 Kudos

this sentence can't used 'is initial'.

Regards.

Former Member
0 Kudos

if it-laeda is initial.

Former Member
0 Kudos

Hi Cao,

Check the code which i have modified which you have post

DATA: BEGIN OF it OCCURS 0,

matnr LIKE mara-matnr,

laeda LIKE mara-laeda,

END OF it.

select matnr laeda

from mara into it

where laeda = ''.

endselect.

Cheers!!

Balu

JozsefSzikszai
Active Contributor
0 Kudos

select matnr laeda

from mara

where laeda IS NULL

(IS INITIAL is definetly wrong)

0 Kudos

I exect the sentence ,but the result is wrong.

when the field is null

display of select all DB data.

when the field is not null

can't select data from DB.

regards.

former_member585060
Active Contributor
0 Kudos

Hi,

Try this syntax

SELECT... WHERE s IS [NOT] NULL...

SELECT matnr laeda FROM mara INTOTABLE it_itab WHERE

laeda IS [NOT] NULL.

Regards

Bala Krishna

JozsefSzikszai
Active Contributor

I checked and IS NULL does not work either....

laeda is a date field, so the only correct solution is:

... laeda EQ '00000000'.