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 FORMAT

Former Member
0 Likes
1,225

Hi,

i have a date 20060720 stored in a variable of type sy-datum. How do i convert it to format 20.07.2006 while printing it through a sapscript

regards

Nishant

14 REPLIES 14
Read only

Former Member
0 Likes
1,155

Hi nishant,

1. no need to convert.

2. In the layout just mention

&mydate&

3. it will automatically print

in dd.mm.yyyy format

(based upon user settings)

regards,

amit m.

Read only

0 Likes
1,155

hi Nishanth,

Amit is Right it print in the way you want.

Regards,

Santosh

Read only

0 Likes
1,155

Hi,

try fm CONVERT_DATE_TO_EXTERNAL

Andreas

Read only

0 Likes
1,155

Hi Amit,

...".. In the layout just mention

&mydate&"

Can you please be more specific....

regards

Read only

0 Likes
1,155

mydate is just the sample variable name that Amit has mentioned.he just means that u r supposed to put ur variable for date in that place.The default format as i mentioned earlier will be picked up frpm the User's master data.That's all.

Read only

0 Likes
1,155

Hi again,

1. In your layout using se71,

u must be writing some other texts,

along with the position, at which,

u want your date to be printed.

2. So, suppose your variable name for date

(in driver program)

is MYDATE,

then

3. just use / type

in layout as,

&MYDATE&

4. Eg.

Todays Date is &MYDATE&

regards,

amit m.

Read only

Former Member
0 Likes
1,155

hi,

data : date(10),
       dat type sy-datum.

date = '20060720'.

dat = date.

Regards

vijay

Read only

0 Likes
1,155

REPORT ZES .

data: v_date type char10.

CALL FUNCTION 'HRGPBS_HESA_DATE_FORMAT'

EXPORTING

p_date = sy-datum

IMPORTING

DATESTRING = v_date.

replace all occurences of '/' in v_date with '.' .

write v_date.

hope it solves your problem. pls close the thread by allocating points if u satisfy with solutions.

Read only

guillaume-hrc
Active Contributor
0 Likes
1,155

Hi,

Why not use another variable of type character that you would fill with a WRITE statement from the first variable ?

Another possibility would be to use offset - such as mydate+0(2) - on the date variable directly into the SAPscript.

Hope it helps.

Best regards,

Guillaume

Read only

Former Member
0 Likes
1,155

hi

use &date&

it will write

Read only

nishanthbhandar
Contributor
0 Likes
1,155

In any SAP screen check SYSTEM->USER PROFILE->OWN DATA.This will show the user's default parameters.Check the defaults tab.Under the Date Format check the radiobutton DD.MM.YYYY.Dont do anything if it is already checked.This is the format that is taken to print the SY-DATUM value.

Cheers

Nishanth

Message was edited by: Nishanth Bhandar

Read only

former_member480923
Active Contributor
0 Likes
1,155

Hi

Use the following codes

Report z.......

data v_date(10) type c.

write date to v_date.

........

in SAPScript pass v_date and write as v_date..

this will work if ur dateformat is DD.MM.YYYY

Hope it helps

Anirban

Read only

Former Member
Read only

Former Member
0 Likes
1,155

Hii

use

e.g. /: SET DATE MASK = ‘MM DDDD (Day in full) yyyy’

otherwise

&sydatum&