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: 

changing date in BDC

Former Member
0 Kudos

Hi ALL

I wanna to change the date in the flat file when I am entering into BDC, please give me the code for this one.

Regards

Praveen

3 REPLIES 3

Former Member
0 Kudos

Hi praveen,

I don't know whether i understood u question properly.

1. The date field in the flat file should

be in the format YYYYMMDD

2. Now while putting this date

on the screen field use this funda.

data : ds(10) type c.

write itab-field to ds.

(ds will now contain dd.mm.yyyy

which is required on the screen )

(screen does not requrie YYYYMMDD)

3. Use DS field for BDC.

I hope it helps.

regards,

amit m.

0 Kudos

Hi,

Try this...

  • Local variables to set date

DATA:lv_dd(2),

lv_mm(2),

lv_yyyy(4),lv_date1(10).

*pass the date field from file into a variable

SPLIT x_data_tab-str1 AT ',' INTO lv_date1.

  • Set Date into DDMMYYYY format or according to ur *requirement

lv_dd = lv_date1+0(2).

lv_mm = lv_date1+3(2).

lv_yyyy = lv_date1+6(4).

CONCATENATE lv_dd lv_mm lv_yyyy INTO x_final-bldat.

or if this does not work then use write to field statement

Regards,

Sridhar Reddy k

Message was edited by: sridhar reddy kondam

Former Member
0 Kudos

hi,

take a char(10) fields length and using write to statement write the date to this char field.

satish