Application Development 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: 

BDC date format

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi

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

Regards,

Vishwa.

former_member188685
Active Contributor
0 Kudos

>Is this true??

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

0 Kudos

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

0 Kudos

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

0 Kudos

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..

0 Kudos

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

" Formatting error for BKPF-BLDAT".

Any suggestion?

Thanks,

Praneeth

0 Kudos

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.

kammaje_cis
Active Contributor
0 Kudos

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