SAP automation current Month

Hey guys,
I want the robot using UiPath Studio to always choose the current Month in a Selection Box. How do I tell him to always choose the current Month?

Thank you in advance,

Rebekka

Hi @rebekka.haendel,

You can get the current month by:

Now.Month.ToString

This will return 4. What are the values in the Selection Box?

@jcastro thank you a lot for your very quick respond and therefore your help.
I am pretty new to UiPath.
While recording my activity, where do squize in the “Now.Month.ToString”

Thankyou.

1 Like

Or you can try these, too:

DateTime.Now.ToString("MMM") - This returns Apr

DateTime.Now.ToString("MMMM") - This one returns April

What does your Selection Box look like? Is it a dropdown field?

When I open the SAP Transaktion, the Selection Box is filled with: “01.2020”.
That has to be changed to 04.2020.
There is no dropdown field.

Hi @rebekka.haendel,

It seems that Selection Box is an edit box. If you need it to be filled with 04.2020, you can do the following:

  1. Introduce a Type Into activity
  2. Spy the Selection Box
  3. Enter DateTime.Now.ToString("MM") +"." + DateTime.Now.ToString("yyyy") as the text. - This will return 04.2020
  4. Tick the EmptyField option in the Type Into activity. Refer to screenshot below:

image

Awesome, thank you!

1 Like