cancel
Showing results for 
Search instead for 
Did you mean: 

Year to date question!

Former Member
0 Kudos

Hi Experts -

I need a report like below:

Employee Aug Sales YTD Sales

Jon 5000 60000

Tom 2000 70000

I was reading through the forum and I see that I have to use customer exit for that. I'm using 0CALMONTH for my variable.

But I also saw that I can avoid the customer exit and use the properties on the key figure.

But the figures are not correct.

I read here that in the properties Calculations -> Calculate as Single Value-> choose Standard Value. But I don't have any option for 'Standard Value' .

Can someone please share his/her thoughts on this? Thanks a lot!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Syed,

I believe you have two options. One where the user enter the month they wish to see and the YTD range. It's a little messy that way.

The other option is with a Customer Exit on 0calmonth. So you have the 0calmonth in a selection with a variable that the user enters the month they want to view on the report. And then another selection with a customer exit on 0calmonth which derives the YTD range based on the input of the user.

Regards

Gill

Former Member
0 Kudos

Hi Gill -

Thanks for the response.

I have created a variable on 0CALMONTH and using it for user input. The var name is ZTEMP .

I have created another variable on 0CALMONTH with a customer exit and the name is 'ZU_YR_TO_DATE'.

Now I have the following code...can someone one please take a look at it and modify it so I can get a range of beg month to user month. As an example, if the user chooses Aug 2007, the range should be Jan 2007 - Aug 2007.

DATA: L_S_RANGE TYPE RSR_S_RANGESID.

DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.

Data: v_loc_date type d.

Data: v_loc_date1 type d.

Data: v_loc(4) type c.

CASE I_VNAM.

WHEN 'ZU_YR_TO_DATE'.

IF I_STEP = 2. "after the popup

LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE

WHERE VNAM = 'ZTEMP'.

CLEAR L_S_RANGE.

v_loc_date1 = LOC_VAR_RANGE-LOW.

v_loc_date = LOC_VAR_RANGE-LOW(4). "low value, e.g.200001

v_loc_date+4(4) = '0101'.

L_S_RANGE-LOW = v_loc_date1 - v_loc_date. "get the difference between current date & first date of year

L_S_RANGE-SIGN = 'I'.

L_S_RANGE-OPT = 'EQ'.

APPEND L_S_RANGE TO E_T_RANGE.

EXIT.

ENDLOOP.

ENDIF.

ENDCASE.

Former Member
0 Kudos

Hello Syed

Very strange that your not passing the year and calculating the YTD value...from your code i am not able to see if u r using default year....

First check the requirement

1. Either you should have 0CALMONTH and YTD caluclation with current year

2. OR you should have 0CALDAY in your time char, create a variable on it and take user input based on variable

3. OR you should have fiscal yera period

Thanks

Tripple k

Former Member
0 Kudos

Thanks every one for your replies. I got a solution.

Triple K - i'm very unfamiliar with ABAP so sorry for the messy code. but i think now i got a solution and is working fine. thanks again every one.

Answers (2)

Answers (2)

Former Member
0 Kudos

In ur case - does YTD mean month 1 to month the user entered?

If so, why dont you hardcode the month1 in the query to the user entered period.

Former Member
0 Kudos

Hi Anil -

Thanks for the reply. So I'm assuming I need to use the Customer Exit. Is there any special thing I have to do in Bex for it to make use of the customer exit var. I have created a Customer Exit Var as Single Value and user input. And I just put a break-point in the CMOD without any code. I just wanted to see if my hook-ups are all correct. But when i execute my report in Analyzer, it doesn't get into my code.

Voodi -

thanks for your reply also. if I understand your suggestion correctly, my beg month will be jan 2007 and end month will be use-entered month, right? but what if i want to see oct 2006 values! in any case, how do I make end month equal to user-entered month. Can I restrict a var with another var?

Former Member
0 Kudos

for this - you need to use two time chars in ur report - fiscal year and posting period.

And a variable of each of them - user entry

but the posting period variable would be a range - which would be period 1 to user entry variable.

the disadvantage would be the user cant go across the years. meaning if he enters OCT 2006 - YTD will calculate only from JAN 2006.

Former Member
0 Kudos

Hi,

You got wrong impression that it is possible without customer exit.

It is possible with cell editor concept if and only if you have 2 structures in the query,even in case you donot want to use Customer exit.

But it seems you are do not need 2 structures in the report,because you need this report Employee wise.

With rgds,

Anil Kumar Sharma. P