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

problem with date field with different user formats

Former Member
0 Likes
678

Hi friends,

I have a Requirement.

on my screen i want default values as current years ist date ie : 01/01/2009 in FRMDATE field on the screen and last date of the year 31/12/2009 In TODATE field

CODE

frmdate = sy-datum

frmdate +4(4) = '0101'

todate = sy-datum

todate + 4(4)

But my problem is iam gettin the value when i execute but my user is facing a problem

as his date format is dffernt.

can any one tell me how can i do that

Regards

Priyanka..

1 ACCEPTED SOLUTION
Read only

former_member156446
Active Contributor
0 Likes
621
PARAMETER: p_to TYPE d, p_fr TYPE d.

DATA: date TYPE char10.

INITIALIZATION.
  CONCATENATE sy-datum+0(4) '0101' INTO date.
  p_to  = date.

  CONCATENATE sy-datum+0(4) '1231' INTO date.
  p_fr  = date.

Hi friends,

I have a Requirement.

on my screen i want default values as current years ist date ie : 01/01/2009 in FRMDATE field on the screen and last date of the year 31/12/2009 In TODATE field

CODE

frmdate = sy-datum

frmdate +4(4) = '0101'

todate = sy-datum

todate + 4(4)

But my problem is iam gettin the value when i execute but my user is facing a problem

as his date format is dffernt.

can any one tell me how can i do that

Regards

Priyanka..

3 REPLIES 3
Read only

former_member156446
Active Contributor
0 Likes
622
PARAMETER: p_to TYPE d, p_fr TYPE d.

DATA: date TYPE char10.

INITIALIZATION.
  CONCATENATE sy-datum+0(4) '0101' INTO date.
  p_to  = date.

  CONCATENATE sy-datum+0(4) '1231' INTO date.
  p_fr  = date.
Read only

Former Member
0 Likes
621

Try these codes:

data:date like sy-datum.
data:date1 like sy-datum.
select-options:s_date for sy-datum.

initialization.

date = sy-datum.
date+4(4) = '0101.

date1 = date.
Date1+4(4) = '1231'
s_date-low = date.
s_date-high = date1.

Append s_date.

Regards,

Gurpreet

Read only

MarcinPciak
Active Contributor
0 Likes
621

Hi,

If you want to display date in explicit format, independently of the user settings use formating with write statement.


data: c_date(10) type c.

write frmdate to c_date DD/MM/YYYY.  "yout desired format

Regards

Marcin