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

BDC date format

Former Member
0 Likes
1,454

Hi,

I need a clarification here.

When we deal with date, normally we convert it into external format of user by using 'WRITE TO' statement.

But in my current program, it does not have any format conversions for date. However, they are uploading to BDC structure in YYYYMMDD basic internal format.

I heard it like, if u supply date with this internal format, it just get converted to specific user format on the screen.( Suppose if user format mm/dd/yyyy, if u spply in YYYYMMDD. Then it will convert to mm/DD/YYYY automatically)

Is this true??

Because the same program working properly on PRD system and in QAT it is throwing date format error.

Can any pls confirm...

Thanks,

Praneeth

8 REPLIES 8
Read only

Former Member
0 Likes
1,112

Hi

In general, based on user settings the date gets changed.

Regards,

Vishwa.

Read only

Former Member
0 Likes
1,112

>Is this true??

yes it is true. if you load it internal format, conversion will takes place automatically according to settings.

Read only

0 Likes
1,112

Vijay,

As I mentioned in only one system it is working properly, the other systems is giving error.

Any specific settings required for this conversion? OR can we take help of SAP?

Please suggest.

Thanks & Regards,

Praneeth

Read only

0 Likes
1,112

Vijay,

As I mentioned in only one system it is working properly, the other systems is giving error.

Any specific settings required for this conversion? OR can we take help of SAP?

Please suggest.

Thanks & Regards,

Praneeth

Read only

0 Likes
1,112

if you use the sy-datum format that will work automatically.

>Any specific settings required for this conversion?

I don't see any need in that. i feel the problem lies in the bdcdata population for the datefield. check it once in Debug mode in other system if you can..

Read only

0 Likes
1,112

yes, I debugged and it is giving the following error on FB05 screen.

" Formatting error for BKPF-BLDAT".

Any suggestion?

Thanks,

Praneeth

Read only

0 Likes
1,112

Just check the below setting in the quality system.

From menu options system-->User Profile -->Own Data --> Open the tab Defaults.

Check the date format over there. The date format from the file and the date format over here should sink.

Read only

kammaje_cis
SAP Mentor
SAP Mentor
0 Likes
1,112

Hi Praneet,

Here is the solution.

OK, first the problem.

This problem is due to user settings. So it is not a good idea to hardcode the format it according to user settings, since we will not know in which system your program will be executed.

Solution.

=======================

Data: begda(10) type C.

Write p0001-begda to begda.

========================

Important point to note.

Source field (p0001-begda), must be of DATE format.

Destination field(begda) must be of char type.

WRITE statement will automatically convert the date to user format.

Thanks

Krishna