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

date check

Former Member
0 Likes
1,676

dear experts,

i need to check wheather date variable contains value or not.

could any one pls tell how to check

thanks and regards

karthik

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,574

chk this

REPORT ztest.

DATA : BEGIN OF itab OCCURS 0,
         matnr LIKE mara-matnr,
         maktx LIKE makt-maktx,
       END OF itab.

LOOP AT itab WHERE matnr IS INITIAL AND
                   NOT maktx IS INITIAL.
ENDLOOP.

13 REPLIES 13
Read only

Former Member
0 Likes
1,574

If not date is initial.

  • Date has value

endif.

Read only

Former Member
0 Likes
1,574

Hi ,

In that case use INITIAL command.

I would look like this

IF NOT <Variable> IS INITIAL.

  • Varaible has a value

ENDIF.

Regards

Arun

Read only

0 Likes
1,574

hi arun,

LOOP AT object_tab1 WHERE aufnr NE space AND addat NE INITIAL.

i am using the above statement but i am getting the error.

pls help me solve.

regards

karthik

Read only

0 Likes
1,574

> hi arun,

>

> LOOP AT object_tab1 WHERE aufnr NE space AND addat

> NE INITIAL.

>

> i am using the above statement but i am getting the

> error.

>

> pls help me solve.

> regards

> karthik

your code should be:


LOOP AT object_tab1 WHERE aufnr NE space AND NOT addat  IS INITIAL.

Read only

Former Member
0 Likes
1,574

Hi..,

Not onli for a date value...

for any variable to check whether it contains any value or not .... we use the

IF NOT W_DATE IS INITIAL. (**** Checking for w_date contains value)

-


if w_date contains a value then it comes into this block---

ENDIF.

Plz do remember to close the thread , when your problem is solved, reward all helpful answers!!!

regards,

sai ramesh

Read only

Former Member
0 Likes
1,574

hi,

we can check the date field by using IS INITIAL.

I think following code will help you.

data:

w_d type d value '20001212',

w_d1 type d.

if w_d is not initial.

write:'w_d'.

elseif w_d1 is not initial.

write:'w_d1'.

endif.

Read only

Former Member
0 Likes
1,574

Hi,

Try this.

DATA: l_data LIKE sy-datum.

IF NOT l_date IS INITIAL.

*" write you logic here

ENDIF.

Regards,

RS

Read only

Former Member
0 Likes
1,575

chk this

REPORT ztest.

DATA : BEGIN OF itab OCCURS 0,
         matnr LIKE mara-matnr,
         maktx LIKE makt-maktx,
       END OF itab.

LOOP AT itab WHERE matnr IS INITIAL AND
                   NOT maktx IS INITIAL.
ENDLOOP.

Read only

Former Member
0 Likes
1,574

Hi Karthik,

Is ur problem completely solved??

Read only

Former Member
0 Likes
1,574

hi,

you have check as

If not <date variable> is initial or <date variable> <> '00000000'

*Date Variable has a vlaue

endif.

Pls reward if it is helpful

regards,

Sangeetha.A

Read only

Former Member
0 Likes
1,574

hi,

you have check as

If not <date variable> is initial or <date variable> <> '00000000'

*Date Variable has a vlaue

endif.

Pls reward if it is helpful

regards,

Sangeetha.A

Read only

Former Member
0 Likes
1,574

hi

try this

move <date variable> to <variable of type sy-datum>

if sy-subrc ne 0

....

hope it will work

regard

ravish

plz reward if helpful

Read only

Former Member
0 Likes
1,574

hi

try this

move <date variable> to <variable of type sy-datum>

if sy-subrc ne 0

....

hope it will work

regard

ravish

plz reward if helpful