Skip to Content
Author's profile photo TANKA RAVICHANDRA

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.

Assigned Tags

      22 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo CH Raman
      CH Raman

      Good article Ravi.keep it up.

      Thanks

      Author's profile photo Former Member
      Former Member

      Hi ravi,

      Good article.

      tnx,

      Author's profile photo Suman Chakravarthy K
      Suman Chakravarthy K

      I really appreciate your ABAP training skills. It's like spoon feeding..

      Author's profile photo Ravi Chandra
      Ravi Chandra
      Blog Post Author

      Thanx suman...

      Author's profile photo Anshu Lilhori
      Anshu Lilhori

      Nice one...

      Author's profile photo Ravi Chandra
      Ravi Chandra
      Blog Post Author

      Thanx anshu..

      Author's profile photo KD Jain
      KD Jain

      Nice one Ravi...

      Author's profile photo Umashankar Poojar
      Umashankar Poojar

      Thanks for sharing Ravi!

      Author's profile photo Ravi Chandra
      Ravi Chandra
      Blog Post Author

      Hi Uma,

      Thanx for rating...

      Author's profile photo Satendra Mishra
      Satendra Mishra

      Nice document and information is shared by you.

      🙂

      Regards,

      SM

      Author's profile photo Former Member
      Former Member

      Hi Ravi,

      This is really helpfull...

      share your knowledge!!!!!

      Regards,

      Ajit

      Author's profile photo Sandeep a
      Sandeep a

      Good Doc. Ravi

      regards

      Sandeep

      Author's profile photo Ravi Chandra
      Ravi Chandra
      Blog Post Author

      Thnx sandeep.

      Author's profile photo Manisha Dhanekula
      Manisha Dhanekula

      Nice article..

      Author's profile photo Martin Grob
      Martin Grob

      good article thanks for sharing..

      Author's profile photo jagadeeshwar dasari
      jagadeeshwar dasari

      Good article ravi, it cleared my confusion on MTD reports/

      Author's profile photo Former Member
      Former Member

      Excellent post! and illustrated very clear manner. Thank you sharing...

      Regards

      Venkat...

      Author's profile photo Ravi Chandra
      Ravi Chandra
      Blog Post Author

      Thanx Venkatesh for rating...

      Author's profile photo Former Member
      Former Member

      Nice one. 🙂

      Author's profile photo Jalina Vincent
      Jalina Vincent

      Nice article

      Author's profile photo NaveenKumar Ganugapenta
      NaveenKumar Ganugapenta

      Hi Ravi,

      Thank you for this very helpful article.

      Naveen.

      Author's profile photo Pulla Reddy P
      Pulla Reddy P

      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.