Skip to Content
0
Oct 10, 2014 at 03:31 PM

Issue With end routine.

28 Views

Hello Experts,

I have an issue with my end routine. My requirement is need to populate the key figure "days over due" using a calculation (Inspection lot end date - date of UD) * (-1). To achieve this i have created a key figure "daysoverdue" (data type is Number and DEC) and assigend to infocube.Data source is DSO. And the Inspection lot end date and ate of UD are navigational attributes in DSO. so i have written logic to read P-Table of infoobject (Inspection lot). Because inspection lot end date and date of usage decision infoobjects are attributes for the infoobject inspection lot.


So , i have written end routine and executed the dtp. But DTP got failed with following error.


"error when converting data base field to target field.". Please refer my screen shots.( 2 screens).


And here is my code in end routine:


DATA: lt_insplot TYPE HASHED TABLE OF /bi0/pinsp_lot //Declared internal table type of master data table with keys from same table.

WITH UNIQUE KEY soursystem

insp_lot.

DATA: ls_insplot TYPE /bi0/pinsp_lot . // structure like master data table.

DATA: lv_lopendd TYPE char10, // variable like infoobject which is using in calculation.

lv_loeudc TYPE char10, // variable like infoobject which is using in calculation.

lv_nddeudc TYPE char10. // lv_nddeudc is lv_lopendd - lv_loeudc. because these two are date fields.so

have used two variables to get result.may be date fields cant subtract in bw.not sure.

SELECT soursystem

insp_lot

/bic/lopendd

/bic/loeudc

FROM /bi0/pinsp_lot

INTO TABLE lt_insplot

WHERE objvers = 'A'.

CONSTANTS: lv_one TYPE char2 VALUE '-1'. // actual formula is (0INSP_LOT__LOPENDD – 0INSP_LOT__LOEUDC) * (-1). so taken '-1' like this.

LOOP AT RESULT_PACKAGE ASSIGNING <result_fields>.

READ TABLE lt_insplot INTO ls_insplot

WITH KEY soursystem =

<result_fields>-soursystem

insp_lot =

<result_fields>-insp_lot.

IF sy-subrc IS INITIAL.

lv_lopendd = ls_insplot-/bic/lopendd.

lv_loeudc = ls_insplot-/bic/loeudc.

lv_nddeudc = lv_lopendd - lv_loeudc.

<result_fields>-/bic/lodaysod = lv_nddeudc * lv_one.

ENDIF.

CLEAR: ls_insplot,

<result_fields>,

lv_lopendd,

lv_loeudc,

lv_nddeudc.

ENDLOOP.

REFRESH lt_insplot.

This is not allowing us to debug also. i tried with break points in generated display program using simulate option in dtp.

So please give me your valuable replies.

Regards,

Raki.

Attachments

scn2.PNG (12.7 kB)
scn1.PNG (20.9 kB)