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

cdate convertion

Former Member
0 Likes
531

hi all

i have problem with the date formates my requirement is

– currently when running the upload program the document date (BKPF_BLDAT) defaults in to the current date. As the program is now, that date is being formatted in US MMDDYYYY. For those who use any other date format (i.e. European format DDMMYYYY) they are getting an error (Invalid date).

This is also a problem with the posting date field BKPF_BUDAT) which comes from the upload spreadsheet and will be in the same format as the user’s profile. We need to have this report changed so that both the date fields accept any and all date formats.

2 REPLIES 2
Read only

Former Member
0 Likes
462

Hi,

You can solve this type of problem with 2 statments.

Lets say your date is BKPF_BLDAT.

Data: Date1 type Sy-datum,
         date2(10) type c.
Move BKPF_BLDAT to Date1.
Write Date1 to Date2.

So, now here the Date2 will have the User format, it will pick the User date format.

Regards

Sudheer

Read only

Former Member
0 Likes
462

Hi,

Either you can use write to statement ie write (your date field) to (any char variable having 10 char as property).

Or you can check the login country from syst table and mask to get the required format of dates.

Regards,

Sunmit.