cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the Current Date and Current User in UI designer to Query on OWL screen

Former Member
0 Kudos
1,738

Hi Experts,

We need to create custom Queries on OWL screen ,

Ex: "All instances created Today" and "All instances created By Current user" (below image for reference ).To achieve this we need current date and current user name in UI Designer, so can any one please guide us , how we can get those values in UI designer to achieve this or please suggest me if any other method to achieve this.




Thanks in Advance



Regards

Ravi




Accepted Solutions (1)

Accepted Solutions (1)

former_member200925
Active Participant
0 Kudos

Hi Ravikumar, you can use the context "GetCurrentIdentifyUUID".

former_member186648
Active Contributor
0 Kudos

Hi,

You can try to create field transformation in the UI designer :http://scn.sap.com/docs/DOC-52471

if you cannot find the function then you could create reuse library: http://scn.sap.com/docs/DOC-72615

Thanks, Pradeep.

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks a lot All of you.

From the above responses now, I am able to get the Current user Name and Current Date in the UI Designer by using custom Reuse Library Function but I am not able to achieve the field transformation in the default set as Saurabh Kabra explained. Am able to see empty drop-down box of Transformation (as shown in the below img) While trying to configure Field Transformation in Query parameter, Please can an one tell me , Why am getting empty list? and can any one explain little briefly how to configure the Query parameter in Default Set?

Thanks in Advance

Ravi

Former Member
0 Kudos

Hi Ravi,

In the reuse library please ensure that the functions are enabled in the UI designer.

Thanks,

Will

Saurabh_Kabra
Participant
0 Kudos

Hi Ravikumar,

You have to make sure that your field transformation Data Type and your target field Data type should be Exactly same.

For example: in your case you want to store the UserName and UserDate and its Data Types are A and B respectively then your Target field should also have the same Data Type as the A and B including the namespace as well.

If that there is any mismatch in data type then it will never show you the field transformation.

Thanks

Saurabh

Saurabh_Kabra
Participant
0 Kudos

Hi Ravi,

Please try to use "Field Transformation" functionality in UI designer for newly created custom queries.

For this select the field for which you want to create a field transformation and try to pass the date same thing like this:

Field transformation "TodaySADL" will be defined as follow:

Similarly for retrieving the user related details you need to use field transformation as follow:

And use it in your query in UI designer.

Hope it helps you!

Thanks & Regards

Saurabh Kabra

Former Member
0 Kudos

Hi Ravi,

Take a look at this post

For the "all instances created today" there is a function in the library Context to get the current date. I'm not sure if that is enabled in the UI designer though, so you might need to create a re-use function yourself with the existing SAP re-use function called inside.

Will