on 05-10-2013 10:24 AM
Hello experts/guru's ,
I have requirement to display the time and attendance data in Web application.
Below is the format to display the data in ALV.
Employee No. | Date 1 | Date 2 | Date 3 | Date 4 | Date 5 | Date 6 | Date 7 | Date 8 | Date 9 | Date 10 | Date 11 | Date 12 | Date 13 | Date 14 | |
10001 | Time_In | 9.00 am | 0.00am | 9.00 am | |||||||||||
Time_Out | 6.00 pm | 0.00pm | 2.00 pm | ||||||||||||
Status | Present | abscent | half day | ||||||||||||
Employee No. | Date 1 | Date 2 | Date 3 | Date 4 | Date 5 | Date 6 | Date 7 | Date 8 | Date 9 | Date 10 | Date 11 | Date 12 | Date 13 | Date 14 | |
10002 | Time_In | 9.00 am | 0.00am | 9.00 am | |||||||||||
Time_Out | 6.00 pm | 0.00pm | 2.00 pm | ||||||||||||
Status | Present | abscent | half day |
I have a question is this possible to display data in such format in Webdynpro.
If yes please guide me else suggest some possible format or way to display such data.
Thanks & Regards
Prajyot.
Hi,
There are several things that will require some effort:
1) if you sort the first column, you should activate value grouping (so as not to repeat the value for each row)
http://scn.sap.com/thread/511450
2) the time is not displayed that way in standard so you have to convert it somehow (in text, with a dedicated conversion exit maybe, ...)
3) for the 2nd column (Time_In, Time_Out, Status), I would add an invisible technical column in order to sort it correctly on the server side (it might not be in the "right" order for all languages you are using) and forbid sorting on this 2nd column
4) for the date columns, you will have to set the title at runtime (check this document http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0b6a153-a132-2d10-bcb3-ac5853325... with the column header objet and the SET_TEXT method
Hope it helps!
Best regards,
Guillaume
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prajyot,
You need to set the sort on the first field ie Employee number.
For that you need to configure your ALV.
Get the model ref using
lo_cmp_usage = wd_this->wd_cpuse_<alv usage name>( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.
lo_interfacecontroller = wd_this->wd_cpifc_<alv usgae name>( ).
lo_model = io_interfacecontroller->get_model( ).
* Set the sort property for the field
lt_fields = lo_model->if_salv_wd_field_settings~get_fields( ).\
Now select your column using the fieldname and apply the sort property.
READ table lt_fields into ls_field where fieldname = 'EMP_NUM'.
ls_field-r_field->if_salv_wd_sort~create_sort_rule( ).
I have implemented the same and its working fine..
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.