cancel
Showing results for 
Search instead for 
Did you mean: 

Pulling Data from DB to BW - One By One for Month in Year

Former Member
0 Kudos

Hi,

I want to write abap routine that will pull data from Oracle View (our Data Source) in the infopackage by 1 to1  for each months belong to year of 2015. I have loaded 2016 data manually but I want to load 2015 data automatically.

There are 4-6 millions data in one month so it is important to pull data for one month firstly and then I should pull data next month.

Then after infopackage, I should load data to Cube from PSA, again  I should load data one by one month.

My scenerio is below. I need ABAP examples and your valuable opinions.

Regards,

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Is there any comment, all of things I have written is clear to you?

Regards,

Tarumar,

former_member189845
Active Participant
0 Kudos

May I know that my understanding of your requirement is correct

You want to load 2015 data, i.e. month by month one after the another. through abap program.

Since you can't do it manually you want to automate it right ?

Have you tired with process chain ?

Former Member
0 Kudos

Hi Sivaramakrishnan,

Yes, I will load full of 2015 data. There is 5-6 millions data in one month so I want to load one month data then transfer it to Cube with DTP. Everytime old PSA request should be deleted. New request will be uploaded to Cube.

You are right, I want to make it automatically.

I think I should use process chain but I want to use only one infopackage.

Do you have any suggestion?

Thanks,

Best Regards,

former_member189845
Active Participant
0 Kudos

Hi

Thanks for your answers.

Few more information please, In Data source level you have any fields like change_on or fiscper

And for that date field what you mentioned, yes you can write abap routine and based on current sy-datum we can get the first and last day of the month and we can populate the data.

And here is the below code where it will help to load previous month of data.

data: ld_low like syst-datum,

   ld_high like syst-datum.

   data: lt_timestamp type timestamp,

   lt_timestamp_low type timestamp,

   lt_timestamp_high type timestamp,

   E_TIMESTAMP  type timestamp.

   data: lv_time like SY-TIMLO.

   data: lv_first_day like sy-datum,

         lv_last_day like sy-datum.

   data: lv_periv LIKE  T009B-PERIV VALUE 'PH',

lv_cur_month  like T009B-POPER,

lv_prev_month  like T009B-POPER,

year type n length 4,

month_6 type n length 2,

year_last like T009B-BDATJ,

lv_result like T009B-POPER.

   clear: lv_cur_month, lv_prev_month, year, month_6, year_last,

   lv_result.

   read table l_t_range with key

        fieldname = 'CH_ON'.

   l_idx = sy-tabix.

   l_t_range-fieldname = 'CH_ON'.

   l_t_range-sign = 'I'.

   l_t_range-option = 'BT'.

******************************************

   year = syst-datum(4).

   lv_cur_month = syst-datum+4(2).

   year_last = year - 1.

   BREAK-POINT.

   lv_result = lv_cur_month - 1.

   CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'

     EXPORTING

       I_GJAHR  = year_last

       I_MONMIT = '00'

       I_PERIV  = 'PH'

       I_POPER  = lv_result

     IMPORTING

       E_DATE   = lv_first_day.

CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'

     EXPORTING

       I_GJAHR  = year_last

       I_MONMIT = '00'

       I_PERIV  = 'PH'

       I_POPER  = lv_result

     IMPORTING

       E_DATE   = lv_last_day.

l_t_range-low = lv_first_day.

l_t_range-high = lv_last_day.

   If sy-subrc = 0.

     modify l_t_range index l_idx.

   else.

     append l_t_range.

   endif.



   p_subrc = 0.

Try this code and see, but your need is to continuously load the 12 months data.

Thanks,

Siva

Former Member
0 Kudos

Hello,

The best and simple way is to create 12 infopackages in BW (one per month) and include those in a temporary process chain one after the other. You can then run your DTP to your target.

Cheers!

Former Member
0 Kudos

Hi Rahul,

Thanks for your reply. This is one of solutions.

Is there any ABAP program to be able to work on this as an another solution?

Thanks

Regards,