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
824

hi all,

well I m facing problem with date format.

I have fetched value from VBAK-VDATU.. and saved it in a variable V_VDATa type dats however when i print that it prints as anormasl text. i like to print in

'DD.MM.YYYY' format.

is there any funtion module that can resolve my problem ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
772

Hi ,

you can get that value using offset.

concatanate v_vdat6(2) v_vdat4(2) v_vdat+0(4) into VDATE seperated by '.' .

7 REPLIES 7
Read only

Former Member
0 Likes
772

Hi,

Move vbak-vdatu to a 10 char field and it will write in the format DD.MM.YYYY.

regards,

Anji

Read only

amit_khare
Active Contributor
0 Likes
772

Check this -

CONVERSION_EXIT_PDATE_OUTPUT

Regards,

Amit

Read only

Former Member
0 Likes
773

Hi ,

you can get that value using offset.

concatanate v_vdat6(2) v_vdat4(2) v_vdat+0(4) into VDATE seperated by '.' .

Read only

Former Member
0 Likes
772
REPORT YCHATEST.


DATA : V_DATE TYPE DATS VALUE '20070402',
       V_DATE1(10).

CALL FUNCTION 'CONVERSION_EXIT_PDATE_OUTPUT'
  EXPORTING
    INPUT  = V_DATE
  IMPORTING
    OUTPUT = V_DATE1.


WRITE : V_DATE.
Read only

Former Member
0 Likes
772

Hi..,

its simple...

define the variable V_VDAT as

data v_vdat type sy-datum.

thats it.

regards,

sai ramesh

Read only

Former Member
0 Likes
772

hi arnab,

date format is depent on the user setting done while creating the user. it you want date should be written in ur formate not in the user then write following code.

WRITE sy-datum DD.MM.YYYY.

here data is printed in DD.MM.YYYY format.

Reward if useful.

Regards,

Kapil Soni

Read only

Former Member
0 Likes
772

Hi Arnab,

Well your prooblem can be solved using 2 different things.....

1. V_VDATA TYPE VBAK-VDATU.

what i think is that changing the type from date to the table from where you are fetching the value, will be definately helpful.

2. You can change the user data which also has the format in which the date is to be displayed.

or you can use the 3rd option

3. CONVERT DATE f1 INTO INVERTED-DATE f2

where f2 is of type c.

F2(10) TYPE C.

Reward if helpful.......

Thanks and Regards,

Kunjal Patel