Skip to Content
Author's profile photo Ravi Sankar Venna

How to use dynamic variables in the variants?

SAP users must be running number of reports on a daily basis. There are number of selection parameters like dates and periods etc. are to be entered. Every time, entering these values must be cumbersome task. However, following small trick would let the system dynamically select the dates based on the values maintained in the variable of the variant.
File 1.png
Would like to run this report on a daily basis, however, the open items (open at key date) has to be dynamically changed when running, we can create variant with dynamic variables. Click on “save” button.
File 2.png

Give Name and Description and Variant Name.

File 3.png

Now this field we are expecting the system should calculate the date dynamically when running on each day.

File 4.png
For Dynamic Variables, SAP has provided some standard variables, we can use them. Select “D” for this purpose.
File 6.png
The above are the standard variables created by SAP for this purpose. Now for this purpose, I am selecting Current Date. Anything beyond these standard variables, we may have to create customized variables.

I am selecting “Current Date” for this purpose.
File 7.png

Click on save button

File 8.png

You can please see the dynamic variant.


For example, if we schedule this job to run on a daily basis, the system would dynamically take the “Current Date” into “Open at Key Date” Field and run the report.

Assigned Tags

      9 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Anshu Lilhori
      Anshu Lilhori

      Thanks Ravi for sharing this..Might come handy some day for sure..

      I learnt new thing today.

      Regards,

      AL

      Author's profile photo Ravi Sankar Venna
      Ravi Sankar Venna
      Blog Post Author

      Thank you Anshu 🙂 Much appreciated your comments.

      Kind Regards,

      Ravi

      Author's profile photo Former Member
      Former Member

      How to create from and to date ? suppose I create variable in MB51. 

      Author's profile photo Ravi Sankar Venna
      Ravi Sankar Venna
      Blog Post Author

      I am not in front of the system, however, you must be having ("date+number of days)

      Author's profile photo YOGESH KSHATRIYA
      YOGESH KSHATRIYA

      Hi,

      thanks for sharing this functionality.. I would have never thought for this...

      Author's profile photo Ravi Sankar Venna
      Ravi Sankar Venna
      Blog Post Author

      Thanks Yogesh for your comments.

      Kind Regards,

      Ravi

      Author's profile photo Lakshmi Sama
      Lakshmi Sama

      Hi Ravi,

      Good One and we are expecting to share knowledge on other areas like controlling, special purpose ledger and asset accounting areas 🙂 from your end.

      Best Regards,

      Lakshmi S

      Author's profile photo Ravi Sankar Venna
      Ravi Sankar Venna
      Blog Post Author

      Thanks Lakshmi for your encouraging words.

      Hopefully, I should come up with some more good articles / blogs. Thanks once again.

      Kind Regards,

      Ravi

      Author's profile photo Erwin Leitner
      Erwin Leitner

      Hello,

      Thank you for sharing interesting document.

      all the best Erwin