This is the situation:
We have a transformation from a DSO to a CUBE. In the Cube we have the DOC_TYPE, but in the DSO we don't. So we do a lookup in the transformation to get the DOC_TYPE from a second DSO.
Until here we are OK. Then, in the end routine, we try to do the following: If a DOC_TYPE = 'ZNC' or 'ZND', then the ratios NETVAL_INV and INV_QTY must be equal zero for those records.
This is the code we are using:
DOC_TYPE type /BI0/OIDOC_TYPE,
INV_QTY TYPE /BI0/OIINV_QTY,
NETVAL_INV TYPE /BI0/OINETVAL_INV,
lv_data type table of _ty_s_TG_1,
wa_data type _ty_s_TG_1.
loop at RESULT_PACKAGE into wa_data where doc_type = 'ZNC' or
doc_type = 'ZND'.
INV_QTY = '0'.
NETVAL_INV = '0'.
modify RESULT_PACKAGE from wa_data.
The DOC_TYPE has records, so the lookup is working fine, but the ratios netval_inv and inv_qty have quantities when they should be = '0'.