on 03-17-2019 7:49 AM
Hi all,
i have a requirement like where category ACT from Actual cube should convert to category PLAN in Plan cube which should run current month -1. If DTP runs for March period 003.2019 it should take from 000.2019 period to 002.2019
Result should be like this.
if user runs for 002.2019 then 0FISCPER - 1 it should take 000.2019 & 001.2019 & Category ACT should take as OL1
if user runs for 003.2019 then 0FISCPER - 1 it should take 000.2019 & 002.2019 & Category ACT should take as OL2
if user runs for 004.2019 then 0FISCPER - 1 It should take 000.2019 & 003.2019 & Category ACT should take as OL3
I wrote below logic to achieve this
Transformation Routine
Data:lv_char type char2,
L_RANGE TYPE RRRANGESID.
lv_char = sy-datum+4(2) .
case lv_char.
When '00'.
RESULT = 'OL0'.
when '01'.
RESULT = 'OL1'.
WHEN '02'.
RESULT = 'OL2'.
WHEN '03'.
RESULT = 'OL3'.
WHEN '04'.
RESULT = 'OL4'.
WHEN '05'.
RESULT = 'OL5'.
WHEN '06'.
RESULT = 'OL6'.
when '07'.
RESULT = 'OL7'.
WHEN '08'.
RESULT = 'OL8'.
WHEN '09'.
RESULT = 'OL9'.
WHEN '10'.
RESULT = 'OL10'.
WHEN '11'.
RESULT = 'OL11'.
WHEN '12'.
RESULT = 'OL12'.
ENDCASE.
DTP logic
data: l_idx like sy-tabix.
data: lv_date type char2.
lv_date = sy-datum+4(2) - 1.
* lv_date = lv_date - 1.
read table l_t_range with key
fieldname = 'FISCPER '.
l_idx = sy-tabix.
*....
concatenate sy-datum+0(4) '000' into l_t_range-low.
case lv_date.
when 1.
concatenate sy-datum+0(4) '001' into l_t_range-high.
when 2.
concatenate sy-datum+0(4) '002' into l_t_range-high.
when 3.
concatenate sy-datum+0(4) '003' into l_t_range-high.
endcase.
l_t_range-sign = 'I'.
l_t_range-fieldname = 'FISCPER'.
l_t_range-iobjnm = 'FISCPER'.
l_t_range-option = 'BT'.
if l_idx <> 0.
modify l_t_range index l_idx.
else.
append l_t_range.
endif.
p_subrc = 0.
I am not able to see 00 period in the result where I am getting only 001 & 002.2019.
00 period category showing Blank values which should show as OL2 as per my scenario
Kindly check & put your comments
Advanced Thanks,
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.