on 04-15-2014 6:12 AM
Hi Experts,
Can any one tell me how to create the Attedence calender using the Webdynpro java ???
For Ex: if an employee came to office only half day to office i have to show that date date with lite green color, if employee is absent for whole day i have show that date as Red color, full present with green color...
Regards,
Mahesh.
hi Mahesh ,
for this purpose if you are using a table , like table having row corresponding to a employee A, with columns as Date, Employee ID, Status, and Table node is EmpDtl with attributes as EmployeeID, CurrentDate, and Status where employeeid and status is of type string and currentdate is of type Date
and show status as he is present absent etc .
for status column in the table delete the text view, rightclick-> insert table cell editor-> insert UI element of type Image, in this for property src bind a context attribute status of the table node
the value of status at runtime will be
1. ~sapicons/s_s_ledg.gif -- green color
2. ~sapicons/s_s_ledr.gif -- red color
3. ~sapicons/s_s_ledi.gif -- gray color
hope this helps , but displaying the date itself in different colors im not sure about that.
Regards
Govardan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Govardhan,
Thanks for the reply.
My Requirement is to use the Calender directly not the table.
My doubt is as you suggested we will get the details like employee id , name and status from the ECC using bapi.Based on the status how to change the color of the date in calender????
Thanks and Regards,
Mahesh
yes it is possible , but here in case you are getting date from bapi , bind the attribute to text view ui element , here you have one property called semantic color , if that is selected to positive then your date gets diplayed in Green and negative it displays the same in red color.
created one context attribute datasemantic of type WDTextViewSemanticColor i.e you have to choose type ->Java Native Type - > Browse -> type wdtextviewsematic .... you get the data type and in run time...
you can set the value as
if(employee was present)
wdcontext.currentcontextelement().set(WDTextViewSemanticColor.POSITIVE) ;
etc at run time this way you can display ..i hope this solves your requirement
Regards
Govardan
Hi Govardhan,
Thanks for the explanation , Now i got some idea to develop the calender.
Not only red&green, i have use yellow and orange
Orange indicates the employee was present only for half,so employee can click the orange color date and he can change the checkin/out timings
I have one more question, How can i bind the color to the calender???
Please correct me if i am wrong......
Regards,
Mahesh
Hi Mahesh,
like which version you are using 7.0 or 7.3 ?
in 7.0
for calendar -- i mean you are using input feild binded with attribute of type date ?
or calendar -- date navigator ?
for Input feild and date navigator UI element the above semantic color property is not available .
Hence suggested to bind it to a text view UI element.
Regards
Govardan
HI mahesh ,
Try reading this
it will help you.
Regards
Govardan Raj
Hi Govardhan,
Sorry for the late reply.
I want to use calender year....
And can you please share me if you have a code for reading the checkin/out timinges from the bapi and setting the color to the Calender...??
Is it possible to set the date as a link??
plese correct me if i am wrong..
Regards,
Mahesh
HI mahesh,
Checkin/out timgings from bapi --? im not clear with this.
it is possible to set date as link -- here you have to use simpledate format
simpledateformat sdf = new simpledateformat("dd/MM/yyyy ");
String dateinStringfrmt = sdf.format(your date attribute);
wdcontext.currentcontextelement().setdateinstringformat( dateinStringfrmt );
and bind this context element dateinstringformat to link to action UI element.
in this way you can show the date as link.
i.e
convert date to string format and set that to attribute of type string and bind that to link to action UI element
Regards
Govardan Raj
Hi Govardhan,
Checkin/out timgings from bapi --? i will fetch the data from the RFC(Where RFC will have SAP HR Data like when employee logged in and logged out, if employee worked for 9 hrs i have to set the date ex:16/04/2014 as Green and if he worked for 4 hrs i have to set the date as orange color) and set the color of the date appropriatly.
on click of any date ex:15/04/2014, i have get the date,logged in time and logged out time.So,that employee can change the timings and send it to the manager for approval.
Regards,
Mahesh
Hi mahesh,
As specified earlier, you can bind the string format of date to link to Action UI element, to show it in link form,
Here on create an action for this Link To Action, and insert code to pop up a window that shows view having details of logged in and logged out detail from BAPI
Regards
Govardan
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.