cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi Experts,

I have 2 custom date fields for which I'm getting the values from oracle database through DB Connect in MM/DD/YYYY format (e.g values 10/20/2007 and 3/5/2007). But I want to convert this date format into SAP BW internal format (YYYYMMDD). I've defined the above 2 date fields in BW with a data type DATS (8 digits length) and wrote a code in the TRs as below. Both these fields are defined as a character with a length of 10 in the oracle system.

data zresult(10) type C.

data : lv_day(2) type c,

lv_month(2) type c,

lv_year(4) type c.

zresult = tran_structure-spring_norm_date.

lv_day = zresult+3(2).

lv_month = zresult+0(2).

lv_year = zresult+6(4).

CONCATENATE lv_year lv_month lv_day into result.

But still the data load is getting failed due to wrong date format and error in the routine. It says the value for the characteristic 0DATE doesn't have 8 spaces. Is there anything wrong with the routine?

Could someone please share some inputs on this.

Thanks,

Krish

0 Likes
View Entire Topic
mathew_muthalaly
Contributor
0 Likes

Hi,

Suggest that you concatenate into another variable and say 'result = variable'.

BR/

Mathew.