Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Range question

Former Member
0 Likes
622

Hi,

I need to make a range for the end of the month date only and I use the low range only because in the table that I make the select have all the days and I only need the last day of the month, so, I use the LOW range only like this:


  end_month-sign    = 'I'.
  end_month-option  = 'EQ'.
  end_month-low     = last_day.
  APPEND end_month.
 

Is this code correct? because first I call a function that give the last day of the month and then I create the range and then I make the select like this:


SELECT bukrs day_a racct prctr per_day average agregate 
       accumulate average_sap
  FROM zavg_bal_table  APPENDING TABLE t_zavg
  WHERE bukrs IN p_bukrs
   AND  day_a IN end_month
   AND  prctr IN profit.

Thanks for the help!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
587

Hi Carlos,

Perfect code (Assuming you have defined end_month as a range with reference to the day_a filed in table zavg_table.

Regards.

John.

5 REPLIES 5
Read only

Former Member
0 Likes
588

Hi Carlos,

Perfect code (Assuming you have defined end_month as a range with reference to the day_a filed in table zavg_table.

Regards.

John.

Read only

Former Member
0 Likes
587

Hai,

The code is correct.

Read only

Former Member
0 Likes
587

Hi carlos,

1. range for the end of the month <b>date</b> only

2. since this is range for DATE,

3. we have to give LOW AND HIGH BOTH,

otherwise it may not give the desired results.

(in your case, it will give for ONE Date only)

4.

end_month-sign = 'I'.

end_month-option = 'BT'.

end_month-low = FIRST_day.

end_month-low = last_day.

APPEND end_month.

5. U can consturct the first date

from the last day,

by using concatenate '01' concept.

regards,

amit m.

Read only

Former Member
0 Likes
587

add this also ,

end_month-high = ''.

Read only

Former Member
0 Likes
587

Hi CARLOS,

The code will work fine.

Regards,

Mukesh Kumar