on 12-19-2017 8:48 AM
Hello all,
Report should show the last four weeks of data in the report from the current date. I want to create Customer exits to fulfill this requirement. Did anybody have this requirement in their project and created customer exits for the same in CMOD. Can anybody share me the logic to write a code.
Thanks in advance.
Regards,
Sheetal
Hi,
How are you going to determine your last 4 weeks? For example, today is December 21, what dates will the last 4 weeks fall? Also, what infoobject are you going to use? Is it CALDAY or CALWEEK?
Regards,
Loed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
normally in your customer exit you will have checks on I_step and I_vnam, depending how it is coded at your side you should implement code like:
data: tempdate type scal-date,
tempweek type scal-week.
case I_vnam.
when 'yourvariable'. "note your variable is set as interval and not input ready and mandatory
if I_step =2. "mandatory input and empty, non input ready variables
l_s_range-high = sy-datum. "if the infoobject is a date, not a week
l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
tempdate = sy-datum - 21 "(if we want the last 4 weeks incl current week)
call function 'DATE_GET_WEEK'
exporting date = tempdate
importing week = tempweek.
call function 'WEEK_GET_FIRST_DAY'
exporting week = tempweek
importing date = l_s_range-low.
"if 19/12/2017 is sy-datum and week 51, then first day of week 47 is 27/11/2017, 27.11.2017 - 19.12.2017
APPEND l_s_range TO e_t_range.
endif.
when others.
endcase.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Simply use the standard variable 0CWEEK to get the current week and use the offset option to go back 4 weeks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.