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 initial check

Former Member
0 Likes
14,213

Dear friends

I am checking date like below

if not i_date1 is initial. is this correct or i have to check like

if not i_date1 is space.

pls suggest

thanks in advance

karthik

11 REPLIES 11
Read only

Former Member
0 Likes
4,578

Hi.

Check initial is correct.

Regards,

Timo.

Read only

Former Member
0 Likes
4,578

Hi,

If the i_date1 is of data type D..Then you can check IF NOT i_date1 IS INITIAL..

Thanks,

Naren

Read only

0 Likes
4,578

Hi naran,

The I_date is declared as date only but when ever the I_date is space the condition not satisfying

pls see the below code

i_date = int_out1-zactcostdte.

if not i_date is initial.

CONCATENATE i_date6(2) i_date4(2) i_date(4) INTO

i_OUTPUT SEPARATED BY '.'.

int_out1-zactcostdte = i_output.

else.

int_out1-zactcostdte = '00.00.0000'.

endif.

if the i_date is space instead of '00000000' then it is going to concatenate instead of going to else part.

pls suggest

Read only

0 Likes
4,578

Hi,

DOn't check l_date is initial.

Check if ldate CO '00000000'.

Regards,

Deepu.K

Read only

Former Member
0 Likes
4,578

Hi,

What is the data type of the field zactcostdte

Thanks,

Naren

Read only

0 Likes
4,578

hi naren

that is date data type

Read only

0 Likes
4,578

dear naren

if i_date co '00000000' or i_date co ' ' or i_date is initial.

int_out1-zactcostdte = '00.00.0000'.

else.

CONCATENATE i_date6(2) i_date4(2) i_date(4) INTO

i_OUTPUT SEPARATED BY '.'.

int_out1-zactcostdte = i_output.

endif.

i have coded like above is it correct.

Read only

0 Likes
4,578

Hello Karthik,

Did u check my code ?

What is the problem in that ?

R u not getting the required output ?

I tried it in my system and after checking it then I fwded that to u.

Regards,

Deepu.K

Read only

Former Member
0 Likes
4,578

Hi,

Probably while storing the data "int_out1-zactcostdte" the date value would have been blank...instead of initial value for date...

In this case..

Check for both NOT INTIIAL and NOT EQUAL SPACE..

if not i_date1 is space AND

not i_date1 is initial.

  • Concatenate

else.

  • Default

endif.

Thanks,

Naren

Read only

0 Likes
4,578

Hello ,

Try this :-


DATA: i_date TYPE sy-datum.
DATA: i_output TYPE char10.

i_date = sy-datum.

CLEAR i_date.

IF i_date CN '00000000'.

  CONCATENATE i_date+6(2) i_date+4(2) i_date(4) INTO
  i_output SEPARATED BY '.'.
  i_date = i_output.

ELSE.
  WRITE '00000000' TO i_date.
ENDIF.

WRITE:/ i_date.
WRITE:/ 'BLA BLA BLA '.
WRITE:/ i_output.

Hope this helps.

Regards,

Deepu.K

Read only

Former Member
0 Likes
4,578

Hi,

Yes..Looks good..

But IS INITIAL and this condition i_date co '00000000' both are same..

You can remove one of them..

Thanks,

Naren