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
4,236

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
727

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
727

select matnr laeda

from mara

where laeda IS INITIAL.

0 Kudos
727

this sentence can't used 'is initial'.

Regards.

Former Member
0 Kudos
727

if it-laeda is initial.

Former Member
0 Kudos
727

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
727

select matnr laeda

from mara

where laeda IS NULL

(IS INITIAL is definetly wrong)

0 Kudos
727

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
727

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
728

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

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

... laeda EQ '00000000'.