Skip to Content
author's profile photo Former Member
Former Member

How to read data from cluster PCL2

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Aug 13, 2009 at 11:15 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 13, 2009 at 11:07 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 13, 2009 at 11:20 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 13, 2009 at 11:22 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.