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
887

i declare "keydate LIKE bgmkobj-gwlen"

and i get 01.01.2000

like 00.20.0101

any idea?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
863

I have checked your code

data : keydate LIKE bgmkobj-gwlen.

keydate = '20000101'.

write keydate.

I getting 01.01.2000 which is correct.. check how you assigned to keydate.

8 REPLIES 8
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
863

Huh? Can you please explain the problem a little clearer. This is working ok for me.



report zrich_0001.

data:
    keydate LIKE bgmkobj-gwlen.



    keydate = sy-datum.


    write:/ keydate.

Regards,

Rich HEilman

Read only

0 Likes
863

rich

i want that

keydate = '01.01.2000'

and i get 00.20.0101

Read only

Former Member
0 Likes
863

Hi Please

paste your code.

if i am correct you are getting out put in this format 00.20.0101 not 01.01.2000

regards

vijay

Read only

Former Member
0 Likes
863

Hi,

GWLEN is format char8 and on system side like this

"20000101"...

Use FM CONVERT_DATE_TO_INTERNAL / EXTERNAL to change formats.

hope this helps otherwise keep asking!

Regards Matt

Read only

Former Member
0 Likes
863

Hi Yehiel,

May be date is in different format.

use write statement like

write date to keydate.

Use function modules 'CONVERT_DATE_TO_INTERNAL'

and move to keydate.

Hope this will help you.

Thanks&Regards,

Siri.

Read only

Former Member
0 Likes
864

I have checked your code

data : keydate LIKE bgmkobj-gwlen.

keydate = '20000101'.

write keydate.

I getting 01.01.2000 which is correct.. check how you assigned to keydate.

Read only

christian_wohlfahrt
Active Contributor
0 Likes
863

Hi!

How do you fill keydate? With move, via dynpro...

Regards,

Christian

Read only

0 Likes
863

Yes,you always need to move data in the a date field using the YYYYMMDD format. Otherwise you will have the problem that you did.

Regards,

Rich Heilman