on 06-08-2017 10:47 AM
Hi grurus,
Please help me to provide the step to get data One day before in mTD dta ..As user required to get the current MTD as the day from 1st day of the month till yesterday ..Not Today..I have already created a current MTD field in Bex query which gives data from the 1st day of the month till today..
suppose he is running a report today(6/8/2017) so MTD will give from 1st day may till 6/7/2017)
Please Advise.
Dear Siddique,
Please use the code as mentioned below for your variable
Say you have chosen the variable for MTD as ZCAL_MTD.
WHEN 'ZCAL_MTD'.
v_loc_date = sy-datum.
v_loc_date1 = sy-datum - 1.
l_s_range-low = v_loc_date.
l_s_range-high = v_loc_date1.
l_s_range-low+0(4) = sy-datum+0(4).
l_s_range-low+4(2) = sy-datum+4(2).
l_s_range-low+6(2) = '01'.
l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
APPEND l_s_range TO e_t_range_c.
EXIT.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use the code below. It also caters the MTD for every 1st day of month which will have the result of full month last month.
gv_date type sy-datum.
WHEN 'ZCAL_MTD'.
gv_date = sy-datum - 1.
concatenate gv_date(6) '01' into L_S_RANGE-LOW.
L_S_RANGE-HIGH = gv_date.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDLOOP.
Regards,
Loed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for you help..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Siddique,
In the e_t_range Internal table , Please give the high field values as sy-datum - 1, it will work now.
Regards,
RC.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.