I have a custom z_table containing document id (key), username and two status fields - in progress and completed. My goal is to count how many documents are in progress and completed by the distinct users.
I would like to populate the status fields of the internal table of type Z_table with 1s and 0s as follows and then I could use the aggregate functions to count. For displaying the data I am using class cl_salv_table
. Below is an example how my table should look like:
- Doc ID-----User-----In progress-----Completed --
¦ 201 ¦ user1 ¦ 1 ¦ 1 ¦
--------------------------------------------------
¦ 202 ¦ user2 ¦ 1 ¦ 0 ¦
--------------------------------------------------
How could I fill the fields "In progress" and "Completed" with 1s and 0s based by a condition? The condition I know. Could anybody help me with this please?
Thank you very much!