cancel
Showing results for 
Search instead for 
Did you mean: 

How can we develop a report like Attendance Register?

Former Member
0 Kudos

Hi All,

I have to develop a report like Attendance register..i.e the first column of the table consisting of standard headings and has to display while intializing it self......and respective columns are dates for a month....once i gave any search criteria the data has fetch from backend and it will give the values with respective each heading in the first column via date wise.

Please help to resolve this....

Regards,

Ravi

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Create a Ztable with the requried fields and write the

logic to retrieve the data from this table in a class

and design the layout with 2 views one for selection/input

and a button that triggers the next view. In this 2nd view create a node

with the Ztable structure and bind this node to the Table UI element

and instantiate the class in the WDA and using this instance

call that method that returns the data and bind this

data to the view.

If you want to save the data, then create that method in the class and

call this method inside the SAVE button of WDA.

Refer to following tutorials -

http://help.sap.com/saphelp_nw04s/helpdata/EN/43/1f6442a3d9e72ce10000000a1550b0/content.htm - Assistance class

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7a89b067-0801-0010-8192-a9896a60...

Regards,

Lekha.

Former Member
0 Kudos

Hi Lekha,

Thanks for ur reply....My requirement is not like a general report. It was like a attendance report..

Names DAY1 DAY2 DAY3

Thomus

Robert

Martin

John

Steeve

u2026u2026..

u2026u2026..

My Table/ALV default display is like above....After any inputs and search ....it has to display correponding values of each day w.r.t each person....

Plz let me know if u any queries regarding my requirment....

Regards,

Ravi

Former Member
0 Kudos

Hi,

I got your reuirement. When you show the table in the view, show them with input enabled. I mean table cells with Input fields.

When you do create binding for table, give these days columns as Input field Ui element for user to enter.

Regards,

Lekha.

Former Member
0 Kudos

Hi,

Already the data with respect to days is saved in another process.Just we have to display.....My problem was how can we give the default values for the 1st coumn while initializing it self.....

Regards,

Ravi

Former Member
0 Kudos

Hi,

When you fetch data from your custom database table, and bind it to your node

For eg: After writing the select query, lt_names has all the names that you want to display in your first column.

Suppose your node is CN_DATA, attributes - NAME, DAY1, DAY2 etc.

Data: l_node type ref to if_wd_context_node.
Data: gt_data type wd_this->elements_cn_data, " internal table type node
         gs_data type wd_this->element_cn_data. " workarea type node

loop at lt_data into ls_data. " this internal table has data fetched from your database table using select query
gs_data-name = ls_data-name.
append gs_data to gt_data.
clear gs_data.
endloop.

l_node= wd_context->get_child_node( 'CN_DATA' ).
l_node->bind_table( gt_data ).

Regards,

Radhika.

Former Member
0 Kudos

Hi,

If you have got data into lt_table. then modify the table for the 1st column.

loop at lt_table into ls_table.
lv_tabix = sy-tabix.
"If you have any table for names, then use the READ statement with some key and give that name here
ls_table-name1 = 'XXXXX'.   

modify lt_tabe from ls_table index lv_tabix.
clear ls_table.
endloop.

lr_node->bind_table ( lt_table ).

Regards,

Lekha.