cancel
Showing results for 
Search instead for 
Did you mean: 

Code at DTP Filter

Former Member
0 Kudos

Hi All,

I am using  OLAP variable to filter at DTP level , I have field called calendar year/week for this I am creating OLAP variable , I have written code in code for 0CALWEEK. I am not getting correct week of the year , please let me know if anything wrong with code.

if i_step eq 0 and i_iobjnm eq '0CALWEEK'.

    data : date type scal-date,

            wk type scal-week.

            case i_vnam.

            when 'YVAR_CALWK'.

            clear l_s_range.

            CLEAR e_t_range.

            l_s_range-sign ='I'.

            l_s_range-opt ='EQ'.

            date = sy-datum.

                          CALL FUNCTION 'DATE_GET_WEEK'

                            EXPORTING

                              DATE               = date

                            IMPORTING

                              WEEK               = wk.

                              l_s_range-low = wk.

                              append l_s_range to e_t_range.

                             endcase.

                             endif.

Kind regards

Hari

Accepted Solutions (0)

Answers (1)

Answers (1)

KodandaPani_KV
Active Contributor
0 Kudos

Hi,

no need to write the code for 0CALWEEK

just add the cube level map to form source side date field to 0CALWEEK then load the data form source to target.

automatically you will get the week wise data.

Thanks,

Phani.

Former Member
0 Kudos

Hi Pani,

Thanks for your reply .

I want to filter data at DTP level on "Week of the current year" example 201437 , as of today is 37th week of the year. so base upon week , I want to load data into next data target.

Regards

Hari