All about I_t_var_range table.
Hi
This blog describes about the I_T_VAR_RANGE table.
All about I_T_VAR_RANGE tables:
—————————————————————————–
This table is used to fetch the data given by the end user in the variable whenever we execute the report.
Let’s say we have MTD report, in this report we will pass the date as the input.
Whenever we pass the date in the variable screen , the date value is stored in the I_T_VAR_RANGE table.
The various fields present in this table are
LOW, HIGH, OPT, SIGN
Low: Whenever we pass the single value in the variable screen , by default that value is stored in the LOW field .
High : Whenever we pass the range values , the first value is stored in the low field and last value is stored in the high field of I_T_VAR_RANGE internal table.
OPT: The various option for the OPT are EQ,BT,NE etc..
SIGN : The various option for the SIGN is I,E.
Now our requirement is to create the MTD report.
MTD report will displays the output starting of the month till the user input date. Let say the user has given the input date as 20130328, Then MTD report should display the data starting from the first date of that month ( 20130301) till the user input date.
So in this scenario it has to display the output starting from the range 20130301 to 20130328.
Here the user will give the date as 20130328 in the variable screen, now this value is stored in the I_T_VAR_RANGE internal table. If we want to fetch the data from the table , then we have to create work area, as shown below.
data wa like line of i_t_var_range.
Now we can able to retrieve the data from the internal table as shown. Since the user has given one value , by default the value is stored in the LOW field of I_T_VAR_RANGE internal table.so now the data from that table will be retrieved as shown below
data : ref_date type d,
first_date type d,
last_date type d.
ref_date = wa-low. ” wa-low will fetch the data from the low field of the I_T_VAR_RANGE table.
“now ref_date will hold the data 20130328.
first_date = ref_date.
first_date+6(2) = ’01’. ” In the first date we should get the first date of that month.
last_date = ref_date. ” In the last date we should get the user input date.
wa-low = first_date.
wa-high = last_date.
wa-sign = ‘I’.
wa-opt = ‘BT’.
append wa to e_t_range.
Now whenever you execute the report, it will display the MTD report.
Hope you got it,
Regards,
RaviChandra.
Good article Ravi.keep it up.
Thanks
Hi ravi,
Good article.
tnx,
I really appreciate your ABAP training skills. It's like spoon feeding..
Thanx suman...
Nice one...
Thanx anshu..
Nice one Ravi...
Thanks for sharing Ravi!
Hi Uma,
Thanx for rating...
Nice document and information is shared by you.
🙂
Regards,
SM
Hi Ravi,
This is really helpfull...
share your knowledge!!!!!
Regards,
Ajit
Good Doc. Ravi
regards
Sandeep
Thnx sandeep.
Nice article..
good article thanks for sharing..
Good article ravi, it cleared my confusion on MTD reports/
Excellent post! and illustrated very clear manner. Thank you sharing...
Regards
Venkat...
Thanx Venkatesh for rating...
Nice one. 🙂
Nice article
Hi Ravi,
Thank you for this very helpful article.
Naveen.
Hi
good one .
and
one more point to be add to the Document
I.e
Loop at I_T_VAR_RANGE into WA.
END LOOP.