Skip to Content
0
Former Member
Feb 10, 2006 at 04:29 PM

How to debug a transfer rule during data load?

30 Views

I am conducting a flat file (excel sheet saved as a CSV file) data load. The flat file contains a date field and the value is '12/18/1988'. In transfer rule for this field, I use a function call to transfer this value to '19881218' which corresponds to BW DATS format, but the monitor of the InfoPackage shows red error:

"Value '1981218' of characteristic 0DATE is not a number with 000008 spaces".

Somehow, the last digit or character of the year 1988 was cut and the year grabbed is 198 other than 1988. The function code is (see below in between two * lines):

**********************************************************

FUNCTION ZDM_CONVERT_DATE.

*"----


""Local Interface:

*" IMPORTING

*" REFERENCE(CHARDATE) TYPE STRING

*" EXPORTING

*" REFERENCE(DATE) TYPE D

*"----


DATA:

c_date(2) TYPE c,

c_month(2) TYPE c,

c_year(4) TYPE c,

c_date_combined(8) TYPE c.

data: text(10).

text = chardate.

search text for '/'.

if sy-fdpos = 1.

concatenate '0' text into text.

endif.

c_month = text(2).

c_date = text+3(2).

c_year = text+6(4).

CONCATENATE c_year c_month c_date INTO c_date_combined.

date = c_date_combined.

ENDFUNCTION.

**********************************************************

Could experts here tell me what's wrong and also tell me on how to debug a transfer rule during data load?

Thanks