cancel
Showing results for 
Search instead for 
Did you mean: 

dates problem in query ( customer exit code)

Former Member
0 Kudos

Hi all,

There is a requirement to display the data every month( only monthly data Ex:- 07/2007) up to 24 months from sy-datum. For these we have one customer exit but in that result some value (Ex- (mm/yyyy format) 07/2007, 07/2007) are repeated.

In query level 07/2007 month 2 times repeated. we are using 24 user exit variables.

I debugged that code.. if date wise is ok when we saw monthly wise repeated.

can any body give me inputs.... sample code

very urgent rquirement

raj

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Cna you detail me nore about the columns and how you are using the months variable.

Former Member
0 Kudos

Hi venkat,

i debugged my code every thing .. only problem i taken constant 720.

every varibale 720-30 = 690

bleow given code zca24 to zca1. 24 variables using.

see this my report

04/2006 1

05/2006

06/2006 1 2

07/2006 1 2

08/2006

09/2006

10/2006 3 6

10/2006 3 6

11/2006 2

12/2006 1 1

01/2007 2 1

02/2007 3

my code

WHEN 'Zxxx'. " 24 cal month

  • if i_step = 1.

CLEAR l_s_range.

l_s_range-sign = 'I'.

l_s_range-opt = 'EQ'.

lv_date2 = sy-datum - 720.

MOVE lv_date2+0(6) TO l_s_range-low.

APPEND l_s_range TO e_t_range.

HEN 'Zyyy'. " 24 cal month

  • if i_step = 1.

CLEAR l_s_range.

l_s_range-sign = 'I'.

l_s_range-opt = 'EQ'.

lv_date2 = sy-datum - 720.

MOVE lv_date2+0(6) TO l_s_range-low.

APPEND l_s_range TO e_t_range.

  • endif.

WHEN 'Zzzz'. " 24 cal month

  • if i_step = 1.

CLEAR l_s_range.

l_s_range-sign = 'I'.

l_s_range-opt = 'EQ'.

lv_date2 = sy-datum - 690.

MOVE lv_date2+0(6) TO l_s_range-low.

APPEND l_s_range TO e_t_range.

  • endif.

to decrease value up 24 months..

give me ur id i send my report

raj

Former Member
0 Kudos

You can even, populate the months range in the code. Here, you should use this variable in columns and then place the key figure structure.

Well, if the user is entering the date just modify your code as below and check.

First read the date entered by the user in the user and then derive the current month. From that calculate the 24 month past and populate that to the vaiable(another variable).

Check the belwo link for offsets example:

Former Member
0 Kudos

Hi all,

in my report sy-datum automatically is taken.. user not enter any date.

in variable screen only enter in product number

curret date is taken after that - 24 months back.

see above my code. we r using 24 variables zxxx24 to zxxx1.

only problem month repreated. but date wise showing diffrent

see below

11/8/2005

12/8/2005

1/7/2006

2/6/2006

3/8/2006

4/7/2006

5/7/2006

6/6/2006

7/6/2006

8/5/2006

9/4/2006

10/4/2006

11/3/2006

12/3/2006

1/2/2007

2/1/2007

3/3/2007

4/2/2007

5/2/2007

6/1/2007

<b>7/1/2007

7/31/2007</b>

8/30/2007

9/29/2007

any body give me suggestion..

raj

Answers (2)

Answers (2)

Former Member
0 Kudos

Raj,

Is the user enetering any value for the month?

If not why do you want to make it complicated by subractingteh numbers days in your code. You can create a variable of type not user entry and populate the current month. Using the same variable you can use offsets for 24 months.

If my understanding is wrong let me know how your output should look and what the user enters and how your data records are.....

Former Member
0 Kudos

Hi venkat,

can u explain briefly offset function.

user enter only date and Product number.

give me ur personel mail id i send screen shot

raj

Former Member
0 Kudos

Hi,

Use 0calmonth info object. Include it in ur cube and connect it with the date field in ur transformation. Now create a customer exit variable having data range of sy-datum in low value and current year + 2 in high value. Put that variable in filter selection and info object in column selection. This would certainly help.

Thanks!