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

Date format in BDC

Former Member
0 Likes
3,012

Hi Friends,

Presently I am working on a BDC report wherein one of the field to give as input is DATE. I am first giving the data in an excel sheet then converting it into text file and trying to upload.

While uploading , the date field is mis interpreted and its giving a wrong input to my BDC report as a result my BDC report is giving wrong output.

Can anyone suggest me with this issue ?

Edited by: Swapna Vadlamani on Dec 16, 2008 12:20 PM

10 REPLIES 10
Read only

Former Member
0 Likes
2,015

u can use

WRITE lwa_febko-azdat TO lv_date.

Read only

Former Member
0 Likes
2,015

Hi,

While uploading the date field from Text file, the date field will be as '20081216',But while passing to BDC you have to pass date as '12/16/2008'.

So you have to format the date before passing to BDC.

Hope this may be helpful.

Regrads,

Sravanthi

Read only

GauthamV
Active Contributor
0 Likes
2,015

hi,

Declare your date field like this.

data: Date(10) type c.

Read only

Former Member
0 Likes
2,015

Use FM CONVERT_DATE_TO_EXTERNAL to change the date fromat from 99991231 to 31.12.9999

pass this value to BDC

Read only

Former Member
0 Likes
2,015

Hi Swapna,

I had the similar issue and I did it like this.

i_date     = lv_date.  --> Actual date obtained (20081231) format
      lv_year    = lv_date+0(4).
      lv_day     = lv_date+6(2).
      lv_month   = lv_date+4(2).
      CONCATENATE lv_day  lv_month  lv_year INTO lv_final_date SEPARATED BY '.'.
      MOVE lv_final_date TO wa_it_date-d_date.

Please incorporate the same and lemme know.

Regards,

-Syed.

Read only

Former Member
0 Likes
2,015

Hi There,

when you uploading it ...jus format the data in the way you wanted and use the same in your BDC .

Thanks

Read only

Former Member
0 Likes
2,015

hi,

can i know what you are giving input and what you are getting output(DATE)

Read only

Former Member
0 Likes
2,015

Hi,

Do One thing.

Create a variable LV_DATE(10) type C.

Now, Write your date to Local variable.

Write: YourDate to LV_DATE.

And, Pass this LV to your recording, frm where the date field is getting populated to your ITAB.

Hope It helps.

Regards,

Vikas

Read only

rainer_hbenthal
Active Contributor
0 Likes
2,015

Use


write var to char10 dd/mm/yyyy.

This will give you the representation of the date due tor your user settings (dont be confused, it will not write day month year with slashes, it will write it according to your user settings in transaction SU3).

Still there is one problem: if a user executes this BDC with a different user setting for the date representation, it will still fail.

Read only

Former Member
0 Likes
2,015

Hi Friends,

Thanks a ton for everyone for replying. I will surely incorporate the required and hope I will succeed.

-Regards,

Swapna Vadlamani