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: 

date problem.

Former Member
0 Kudos
121

in table dates is save as 20080602 that is 2 june, 08

so how can we recognize it in a program if we had defined the variable as dats type.......if we assign it in that variable then it wil take this date as 02.06.2008 ....so as both the pattern are sumwhat different so it is not fetching data from table...

plz comment what to do in this case

1 ACCEPTED SOLUTION

Former Member
0 Kudos
100

Hi,

use Write statment, which will will convert to system format

suppose date is stored in vaiable w_Date as 6 may 2007

write w_date to w_date1

now the value of w_date1 will be in system date format.

Regards,

Sriram

5 REPLIES 5

former_member223537
Active Contributor
0 Kudos
100

HI,

Declare char(8) type c variable.

Since you know the format in which it is stored.. get the values

l_day = l_date+6(2).

l_month = l_date+4(2).

l_year = l_date+0(4).

Then concatenate above values as per your requirement.

Best regards,

Prashant

Former Member
0 Kudos
101

Hi,

use Write statment, which will will convert to system format

suppose date is stored in vaiable w_Date as 6 may 2007

write w_date to w_date1

now the value of w_date1 will be in system date format.

Regards,

Sriram

Former Member
0 Kudos
100

There are two ways.

1. You can modify the table (I guess its a Z table)

2. Use CONVERT_DATE_TO_INTERNAL to get the internal date format.Pass this to a varibla of CHAR8 and use this value in the selection parameter.

Former Member
0 Kudos
100

Hi,

1.just convert the input date as sy-date and then select the values.

Like:

and also Replace keyword ,u can convert the 02.06.2008 into 02062008.Then use the logic of offset.

Regards,

Shiva Kumar

Former Member
0 Kudos
100

thanks