on 01-31-2016 2:33 AM
Hi Experts ,
i want to create badi for my IC SPO which has 3 partitions.
when i run t-code RSLPO_MASS_ACT, it should fulfill the partitions as below:
at first run ; partition1 should have 2013, partition2 : 2014 and Partition3:2015 data.
at second run; partition1 should have 2016 ,
at third run ,Partition2 should have 2017 data.
i guess on the GET_T_PART_CRIT method correnponding code has to be written.
can anyone help me on that code ?
thanks in advance.
Erdem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Sander,
i wrote some code but it's not working how i expect.
here is the code. first i create 2 static Level attributes (gv_year and gv_idpart)in class Interface.
method IF_RSLPO_BADI_PARTITIONING~GET_T_PART_CRIT.
DATA : l_s_part_crit type rslpo_badi_s_part_crit,
lv_idpart type numc2.
case i_spo.
when 'zmyspo'.
if gv_year is initial.
gv_year = '2013'.
clear l_s_part_crit.
l_s_part_crit-iobjnm = '0CALYEAR'.
l_s_part_crit-idpart = '01'.
l_s_part_crit-low = gv_year.
l_s_part_crit-opt = 'EQ'.
append l_s_part_crit to r_t_part_crit.
clear l_s_part_crit.
l_s_part_crit-iobjnm = '0CALYEAR'.
gv_year = g.v_year + 1 .
l_s_part_crit-idpart = '02'.
l_s_part_crit-low = gv_year.
l_s_part_crit-opt = 'EQ'.
append l_s_part_crit to r_t_part_crit.
clear l_s_part_crit.
l_s_part_crit-iobjnm = '0CALYEAR'.
gv_year = gv_year + 1.
l_s_part_crit-idpart = '03'.
l_s_part_crit-low = gv_year.
l_s_part_crit-opt = 'EQ'.
append l_s_part_crit to r_t_part_crit.
gv_idpart = '03'.
else.
lv_idpart = gv_idpart.
if lv_idpart = '03'.
lv_idpart = '01'.
else.
lv_idpart = lv_idpart + 1.
endif.
gv_year = gv_year +1.
clear l_s_part_crit.
l_s_part_crit-iobjnm = '0CALYEAR'.
l_s_part_crit-idpart = lv_idpart.
l_s_part_crit-low = gv_year.
l_s_part_crit-opt = 'EQ'.
append l_s_part_crit to r_t_part_crit.
endif.
endcase.
endmethod.
can you look where i am doing wrong !
thanks.
Erdem.
Hi Erdem,
Returning parameter R_T_PART_CRIT is a table based on structure RSLPO_BADI_S_PART_CRIT. The structure contains the following fields:
I can see in your coding that the field POSIT is not filled.
According to the on-line help of Interface IF_RSLPO_BADI_PARTITIONING, you can read the following text:
"The field POSIT is used to uniquely identify partitioning criteria. This is important if multiple partition criteria are defined for each partition and partitioning characteristic.
The following rules and consistency conditions apply:
1. If multiple partitioning criteria exist for each partition and partitioning characteristic, these criteria must be numbered uniquely and without gaps, in ascending order, starting with POSIT = 1. If there is only one partitioning criterion per characteristic, this partitioning criterion is given the value POSIT = 1."
I suggest to fill the field POSIT according to the explanation above.
Best regards,
Sander
first i create a year variable in TVARVC.
let say for 1. run year = 2013, for every run i Change the value of ZYEAR-low.
2. run year = 2014,
3.run year = 2015.
data : it_var type table of tvarvc,
wa-var like line of it_var,
lv_idpar type numc2,
l_ind type i,
l_no_parts type i,
l_year_c type numc4.
l_ind = 1.
l_no_parts = 3.
case i_spo .
when 'ZDEMO'.
select single * from tvarvc into wa_var where Name = 'ZYEAR'.
while l_ind LE l_no_parts.
clear l_s_part_crit.
l_s_part_crit-objnm = '0CALYEAR'.
l_s_part_crit-opt = 'EQ'.
lv_idpart = ( ( wa_var-low + 2 - l_ind ) mod 3 ) +1.
l_s_part_crit-idpart = lv_idpart.
l_year_c = wa_var-low - l_ind +2.
l_s_par_crit-low = l_year_c.
append l_s_part_crit to r_t_part_crit.
l_ind = l_ind +1.
endwhile.
endcase.
endmethod.
Erdem.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.