on 07-18-2011 4:06 PM
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.
This is pretty long actually as lc_pct goes to till LC_pct12
and lc_cc1 goes to lc_cc19.
The logic is same. I don't know why its bringing '0' values.
We have data in the source Cube pertaining to all those cost center selections.
Thanks for the help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
in your code you have written an or statement for a case statement which will not work.
CASE <result_fields>-costcenter.
WHEN lc_cc1
or lc_cc2
CLEAR : <result_fields>-/bic/yactcogma,
Also check on icostcenter object, is it alpha appended object if yes then you need to append zeros to constant such that the length matches with the costcenter object length.
regards,
Arvind.
Edited by: Arvind Tekra on Jul 18, 2011 6:00 PM
Hi Arvind,
It didn't work. I removed all cases except lc_cc1. But result is same '0' values for keyfigure.
I don't think Alpha Conversion is an issue as same code ( as I copied it from another transformations) is running just fine without putting '00' to satisfy Alpha Conversion as CostCenter length is '10'.
Thanks
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.