Hi Maricarmen,
you might want to have a look at the class CL_BT126S_A_APPTSR_CN00.
Here the methods
GET_DUE
GET_M_DUE
GET_P_DUE
GET_V_DUE
encode all the logic you need.
When you want to see the methods in action, open up the Activity Search in WebClient.
cheers Carsten