Skip to Content
0
Former Member
Jul 18, 2011 at 03:06 PM

Routine not performing calculation

12 Views

Hi gurus,

I have written a code but its not performing calculations and bringing 'ZERO' values for key figure.

Its pretty long I am just putting here part of it.

DATA: result_pkg_temp TYPE STANDARD TABLE OF tys_tg_1

WITH NON-UNIQUE DEFAULT KEY.

DATA: lv_totamnt TYPE /bic/oiyactcogma.

CONSTANTS: lc_pct1 TYPE f VALUE '0.6687',

lc_pct2 TYPE f VALUE '0.1667',

lc_pct3 TYPE f VALUE '0.4333',

lc_pct4 TYPE f VALUE '0.1083',

lc_cc1 TYPE /bi0/oicostcenter VALUE 'ZTE64350',

lc_cc2 TYPE /bi0/oicostcenter VALUE 'MUS80900'.

LOOP AT RESULT_PACKAGE ASSIGNING <result_fields>.

lv_totamnt = <result_fields>-/bic/yactcogma.

CASE <result_fields>-costcenter.

WHEN lc_cc1

or lc_cc2

CLEAR : <result_fields>-/bic/yactcogma,

<result_fields>-record.

<result_fields>-/bic/yactcogma = lv_totamnt * lc_pct1.

APPEND <result_fields> TO result_pkg_temp.

CLEAR :<result_fields>-/bic/yactcogma, <result_fields>-record.

<result_fields>-/bic/yactcogma = lv_totamnt * lc_pct2.

APPEND <result_fields> TO result_pkg_temp.

CLEAR :<result_fields>-/bic/yactcogma, <result_fields>-record.

<result_fields>-/bic/yactcogma = lv_totamnt * lc_pct2.

APPEND <result_fields> TO result_pkg_temp.

CLEAR :<result_fields>-/bic/yactcogma, <result_fields>-record.

WHEN lc_cc2.

CLEAR :<result_fields>-/bic/yactcogma, <result_fields>-record.

<result_fields>-/bic/yactcogma = lv_totamnt * lc_pct4.

APPEND <result_fields> TO result_pkg_temp.

CLEAR :<result_fields>-/bic/yactcogma, <result_fields>-record.

<result_fields>-/bic/yactcogma = lv_totamnt * lc_pct4.

APPEND <result_fields> TO result_pkg_temp.

CLEAR :<result_fields>-/bic/yactcogma, <result_fields>-record.

WHEN OTHERS.

CLEAR <result_fields>-record.

APPEND <result_fields> TO result_pkg_temp.

ENDCASE.

ENDLOOP.

REFRESH RESULT_PACKAGE.

RESULT_PACKAGE[] = result_pkg_temp[].

REFRESH result_pkg_temp.

Can anyone please help.