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

Issue in using SY-DATUM

Former Member
0 Likes
2,124

Hi.. Im finding difficulty in using SY-DATUM to the date field in transaction F-26 thru BDC. Bcoz the date format should be given as mm-dd-yyyy and also the date format may change as mm/dd/yyyy in differnt server.

server to server date format will change.. how can i solve this issue by using SY-DATUM.

<REMOVED BY MODERATOR>

Thanks in advance

Edited by: Alvaro Tejada Galindo on Feb 18, 2008 2:01 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,524

Hi Aslam,

DATA LV_DATE(10) TYPE C.

WRITE SY-DATUM TO LV_DATE.

write statement will convert the date format as per the user setting.

Regards,

Ali

6 REPLIES 6
Read only

Former Member
0 Likes
1,524

Hi,

When running the program using table USR01 and the user who is executing the batch job (SY-UNAME) get the date format from the table.

Each format has a single digit identifier, based on the same, format the date field into the string used in the BDC.

Hope this helps.

Cheers,

Aditya

p.s. you can view the format from SU3 or SU01D.

Read only

Former Member
0 Likes
1,524

Hi,

You can set the default system date format by going to TCode SU01 --> Default Parameters tab --> Date field.

Thanks,

Sriram Ponna,.

Read only

Clemenss
Active Contributor
0 Likes
1,524

Hi aslam,

in BDC date input is expected in the format the user has set in user details. It will be converted to SAP internal date format (YYYYMMDD).

If you use WRITE <YYYYMMDD> to BDCDATA-FVAL it will be written in the format you need. This is always correct if the user creating the BDC hast the same date format settings as the user executing the BDC.

Regards,

Clemens

Read only

Former Member
0 Likes
1,525

Hi Aslam,

DATA LV_DATE(10) TYPE C.

WRITE SY-DATUM TO LV_DATE.

write statement will convert the date format as per the user setting.

Regards,

Ali

Read only

0 Likes
1,524

Hi Thanks 4 ur rply...

i have solvd the issue by splitng the sy-datum into a variable (as per the formate of the transaction then ) and i passed to bdc. That was wrkng fine

Read only

0 Likes
1,524

Great answer. Thanks