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

how to check date type is initial

Former Member
0 Likes
7,317

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
Read only

JozsefSzikszai
Active Contributor
3,808

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

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

... laeda EQ '00000000'.

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.

8 REPLIES 8
Read only

bpawanchand
Active Contributor
0 Likes
3,808

select matnr laeda

from mara

where laeda IS INITIAL.

Read only

0 Likes
3,808

this sentence can't used 'is initial'.

Regards.

Read only

Former Member
0 Likes
3,808

if it-laeda is initial.

Read only

Former Member
0 Likes
3,808

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

Read only

JozsefSzikszai
Active Contributor
0 Likes
3,808

select matnr laeda

from mara

where laeda IS NULL

(IS INITIAL is definetly wrong)

Read only

0 Likes
3,808

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.

Read only

former_member585060
Active Contributor
0 Likes
3,808

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

Read only

JozsefSzikszai
Active Contributor
3,809

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

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

... laeda EQ '00000000'.