cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Variable for Calendar month

sri_harsha2
Participant
0 Kudos

Hello Gurus,

I have a requirement in a the report. The columns currently we have in the report are

Billing Qty for last 12 months          Billing Qty for Last 6 months      Billing Qty for last 3 months

Instead of the 12, 6 and 3 months user wanted to have the Calendar months as columns

Biiling Qty   Billing Qty   Billing Qty  Billing Qty  .......  Billing Qty

Jan              Feb           March         April                   Dec

I would need to write a code for the variable, and restrict the key figure for billing Qty.

I could find a similar thread that would satisfy the above requirement.

I have made minor changes to the code but the code is not working in spite of trying to correct it

in different ways. I am going wrong in making the changes. I request you to help me out

on this.  Thanks in advance

if i_step = 2.

        

data it_range1 like line of e_t_range.

data is_range1 like it_range1.

 

 

first = sy-datum+0(4).

concatenate first '01' into first.

 

 

is_range1-low = first.

is_range-high = sy-datum+0(12).

is_range-sign = 'I'.

is_range-opt = 'BT'.

LAST = sy-datum+0(12).

concatenate LAST '12' into LAST.

 

 

append is_range to it_range.

endif.

Accepted Solutions (0)

Answers (4)

Answers (4)

yasemin_kilinc
Active Contributor
0 Kudos

Hi,

If user wants to show data month by month, then you neither need offset or any variable. Simply change the query adding the calmonth characteristic and billing quantity key figure (not the selection, the key figure from your infoprovider) to the columns.

Regards

Yasemin...

Loed
Active Contributor
0 Kudos

Hi Sri,

Why will you use a customer exit for this? Just use the OFFSET as Harish suggested..

Also, do you have input variable for this or the system will automatically detect the current month?

Regards,

Loed

KodandaPani_KV
Active Contributor
0 Kudos

HI,

no need for the code your senario.

put the 0CALMONTH object in column panel

and create the 3 KF if you want

-Billing Qty for last 12 months  - resctirct the 0calmont use the offset variable  -12

-Billing Qty for Last 6 months   - resctirct the 0calmont use the offset variable  -6

-Billing Qty for last 3 months  -  resctirct the 0calmont use the offset variable -3

check the out put in RSRT.

Thanks,

Phani.

former_member184884
Active Participant
0 Kudos

Hi,

why you are going for customer exit any specific reason??

you can achieve above requirement through variable offset.

hope you know how to apply offset approach for your current scenario!!

Thanks & Regards,

Harish