Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to read data from cluster PCL2

Former Member
0 Kudos

HI

My requirement is to read time events (Infotype 2011) for an employee for a given period.

For that purpose I want to fetch data from PCL2 database cluster.

Please tell me how to exctract data,which FM to use,table declarations required.

Regards,

Anubhav Gupta

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

Time events are in infotype 2011 (TEVEN and TEVEN_MORE) not in cluster PCL2, in cluster PCL2 you will find derived information like time pairs and time tickets which are saved separately for each employee and period to tables PT (pair table), WST (time tickets), and AT (link table) in cluster B2, database PCL2.

How to read the cluster B2 from database PCL2 has been [answered many times|https://forums.sdn.sap.com/search.jspa?objID=c42&q=readclusterPCL2+], (look for macro [RP-IMP-Cn-xx|http://help.sap.com/saphelp_45b/helpdata/EN/4f/d528ff575e11d189270000e8322f96/content.htm] or FM [HR_FORMS_TIM_GET_B2_RESULTS|https://forums.sdn.sap.com/search.jspa?objID=c42&q=HR_FORMS_TIM_GET_B2_RESULTS])

Regards,

Raymond

6 REPLIES 6

former_member209217
Active Contributor
0 Kudos

Hi,

Please search in SCN There are lot of posts related to this.

raymond_giuseppi
Active Contributor
0 Kudos

Time events are in infotype 2011 (TEVEN and TEVEN_MORE) not in cluster PCL2, in cluster PCL2 you will find derived information like time pairs and time tickets which are saved separately for each employee and period to tables PT (pair table), WST (time tickets), and AT (link table) in cluster B2, database PCL2.

How to read the cluster B2 from database PCL2 has been [answered many times|https://forums.sdn.sap.com/search.jspa?objID=c42&q=readclusterPCL2+], (look for macro [RP-IMP-Cn-xx|http://help.sap.com/saphelp_45b/helpdata/EN/4f/d528ff575e11d189270000e8322f96/content.htm] or FM [HR_FORMS_TIM_GET_B2_RESULTS|https://forums.sdn.sap.com/search.jspa?objID=c42&q=HR_FORMS_TIM_GET_B2_RESULTS])

Regards,

Raymond

Former Member
0 Kudos

Hi ,

Instead of FM, you can write code as follows -

Tables : PLC2.
SELECT-OPTIONS : s_date TYPE plc2-aedtm.
DATA : t_itab TYPE TABLE OF plc2.
SELECT * FROM PLC2  INTO TABLE  t_itab
                            WHERE aedtm in s_date.

Regards

Pinaki

Former Member
0 Kudos

Hi,

you can use the function module HR_FORMS_TIM_GET_B2_RESULTS.

DATA: ls_tim_b2 TYPE hrf_tim_b2        ,
        lt_b2     TYPE  TABLE OF ptr_f_zl,
        ls_b2     TYPE ptr_f_zl          .

  CLEAR:   gt_p2002,g_hrs_wrkd,lt_b2.
  REFRESH: gt_p2002,lt_b2.

  g_bdate2 = g_bdate.
  g_edate2 = g_bdate.

************FM For Fetching Data From B2 Cluster
  CALL FUNCTION 'HR_FORMS_TIM_GET_B2_RESULTS'
    EXPORTING
      pernr                 = pernr-pernr
      begda                 = g_edate2
      endda                 = g_edate
    IMPORTING
      tim_b2                = ls_tim_b2
    EXCEPTIONS
      wrong_cluster_version = 1
      no_read_authority     = 2
      cluster_archived      = 3
      technical_error       = 4
      OTHERS                = 5.
*********Fetching Data From B2 Cluster

Regards

Milan

0 Kudos

Thank you..

Now my requirement is to calculate time difference of ZL table.

Time is : 22:30:00 to 38:32:00

How to calculate it.

Thanks & Regards..

Anubhav

0 Kudos

Hi Anubhav,

Try this 2 FM's

SD_CALC_DURATION_FROM_DATETIME - Find the difference between two date/time and report the difference in hours

SD_DATETIME_DIFFERENCE - Give the difference in Days and Time for 2 dates

Regards

Milan