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: 

Hmmm..Date is updation probs in BDC transaction

Former Member
0 Kudos

Hi all, very gud morning

I have written a BDC program to a dialog UI screen,

So in dialog screen there is a date field, which wud be entered and updated.

So if v update the date, using screen its been updated into the database corectly.

ex: if i enter 30.05.2007, its updated as the same.

But if i have saved the data in a .txt file and if i update the database using BDC, its been updating as 30.05.2020 into the database instead of taking it as 30.05.2007

So do u knw watz the problem n solution for this?

Regards,

Sourav

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Sowrabh,

You can facing this problem because SAP date field accepts only 8 characters

and when you are giving the value of 10 chracters, it is truncating the last 2 characters.

You can try the following code:

Data: i_dat(10),

o_dat type d.

*You can replace i_dat with ur date fld

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = i_dat

IMPORTING

output = o_dat.

Use the variable o_dat in ur upload.

Regards

2 REPLIES 2

Former Member
0 Kudos
Date format for entry into BDC 

Because a date field is stored and displayed in different formats within SAP the following code is 
required to convert the date into a format which can be input onto a screen field.

 

* Date field         
  data: ld_date(8).
  
  ld_date(2)   = sy-datum+6(2).
  ld_date+2(2) = sy-datum+4(2).
  ld_date+4(4) = sy-datum(4).


 

Girish

Former Member
0 Kudos

Hi Sowrabh,

You can facing this problem because SAP date field accepts only 8 characters

and when you are giving the value of 10 chracters, it is truncating the last 2 characters.

You can try the following code:

Data: i_dat(10),

o_dat type d.

*You can replace i_dat with ur date fld

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = i_dat

IMPORTING

output = o_dat.

Use the variable o_dat in ur upload.

Regards