cancel
Showing results for 
Search instead for 
Did you mean: 

SPO Dynamic Partition using by BAdi

Former Member
0 Kudos

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.    

Accepted Solutions (1)

Accepted Solutions (1)

sander_vanwilligen
Active Contributor
0 Kudos

Hi Erdem,

Yes, you are right. You have to implement BAdI RSLPO_BADI_PARTITIONING and in method GET_T_PART_CRIT you have to write appropriate coding to supply the criteria.

Please also have a look at my blog series . The coding example might be useful for you.

Best regards,

Sander

Former Member
0 Kudos

Hi Sander,

thanks for sharing the link..it's very helpful..

would you mind if i ask some abap code as an example for the script which i explained above. ?

thanks.

Erdem

sander_vanwilligen
Active Contributor
0 Kudos

Hi Erdem,

Please have a look at document . The attached presentation contains coding examples in Demo Part 3 (starting at slide 61).

You may also refer to the BAdI implementation example (and the related coding in the attached file) in my document .

Best regards,

Sander

Former Member
0 Kudos

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.    

sander_vanwilligen
Active Contributor
0 Kudos

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:

  • IDPART
  • IOBJNM
  • POSIT
  • OPT
  • LOW
  • HIGH

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

Former Member
0 Kudos

thank you Sander.

in that Scenario we do not need posit..

it is solved anyway.

sander_vanwilligen
Active Contributor
0 Kudos

Hi Erdem,

Thanks for your update.

Can you please share your solution to close the discussion?

Best regards,

Sander

Former Member
0 Kudos

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.

Answers (0)