on ‎2008 Mar 18 1:15 PM
Hi Experts,
I am working on a process wherein a user creates a proposal and a notification is sent to the manager for approval.
Now i need to send the date of creation as a attribute to the manager.
Can anyone guide me as to how to get the current system date???
Thanks a lot.
Cheers
Gaurav Raghav
Request clarification before answering.
Hi,
You use "Current State Information" CO to find the data and time
Thanks
Gopal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Wojciech Matulewicz ,
I am using Web Dynpro Java in SAP NW Developer studio.
that code is for Web Dynpro ABAP and i know that as i am a ABAP Consultant..
But i need the code to get the current system date to send the day of creation of proposal request in Web Dynpro Java.
Any clues???
Cheers
Gaurav Raghav
Hi Wojciech Matulewicz,
I have tried using this before and i faced this problem.
When i click on create proposal, the screen just refreshes and the CO execution doesnt ends.
Without ending this field, however things work fine.
here is the code:
Method technicalDescription()
IGPAttributeInfo date = output.addAttribute("DATE", IGPAttributeInfo.BASE_DATE);
date.setMultiplicity(IGPAttributeInfo.MULITIPLICITY_1_1);
Method execute()
Date currDate = new Date(System.currentTimeMillis());
contextElement.setDate(currDate);
Method complete()
output.setAttributeValue("Date", wdContext.currentContextElement().getDate());
If i comment out this code, the CO execution works out fine, but on addition of this code the screen refreshes and CO execution doesnt end.
Am i doing something wrong???
please help me out with this.
Thanks.
Cheers
Gaurav Raghav
Hi All,
I used the code given by Wojciech Matule and it is working fine now.
Thanks a lot.
Cheers
Gaurav Raghav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mandrake,
Yes there is a place to put the JAVA Code.
Follow these steps:
Create a Web Dynpro Application in SAP NW Developer Studio
Switch to Web Dynpro perspective
Create a Component
Open the Java editor of Component Controller/View Controller to put the necessary Java code.
Follow this doc for details.
Hope it helps.
Welcome to ESA.
Cheers
Gaurav Raghav
Hi,
You can use following code to get system date and day.
public static final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss";
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
sdf.format(cal.getTime());
you can specify format according to you and can get day, date and time.
Reena
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.