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: 

Get vacation quota

Former Member
0 Kudos

hi guys,

i need to know if an employee has enough quota to have vacations, i know that that info comes from it 2006, my problem is that with out time managment, every employee earn vacation days during the year.

so sometimes in it 2006 you will have enough quota, but if u try to give them vacation by pa30, sap return a message that the employee does not have enough vacation quota.

i need some function that returns me the real value, not the one from it 2006,

i debbuged pa30 and uses the function HR_DEDUCE_QUOTA, is there another way to get this?

tks in advance.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

This FM will give you deductions.

  CALL FUNCTION 'HR_GET_QUOTA_DEDUCTION'
    EXPORTING
      pernum           = p_pernr
      sbegda           = pn-begda
      sendda           = pn-endda
    TABLES
      qdisded          = dedu
    EXCEPTIONS
      record_not_found = 1
      OTHERS           = 2.

this FM will give you accruals which get listed in PT50.

  CALL FUNCTION 'HR_TIME_RESULTS_IN_INTERVAL'
    EXPORTING
      int_pernr             = p_pernr
      int_begda             = pn-begda
      int_endda             = pn-endda
      int_cltyp             = '1'
    TABLES
      int_time_results      = time_results
    EXCEPTIONS
      no_period_specified   = 1
      wrong_cluster_version = 2
      no_read_authority     = 3
      cluster_archived      = 4
      technical_error       = 5
      OTHERS                = 6.

Other importan FM is HR_GET_QUOTA_DATA

hope this helps.

A

<i><b>Reward points for each helpful answer.</b></i>

4 REPLIES 4

Former Member
0 Kudos

This FM will give you deductions.

  CALL FUNCTION 'HR_GET_QUOTA_DEDUCTION'
    EXPORTING
      pernum           = p_pernr
      sbegda           = pn-begda
      sendda           = pn-endda
    TABLES
      qdisded          = dedu
    EXCEPTIONS
      record_not_found = 1
      OTHERS           = 2.

this FM will give you accruals which get listed in PT50.

  CALL FUNCTION 'HR_TIME_RESULTS_IN_INTERVAL'
    EXPORTING
      int_pernr             = p_pernr
      int_begda             = pn-begda
      int_endda             = pn-endda
      int_cltyp             = '1'
    TABLES
      int_time_results      = time_results
    EXCEPTIONS
      no_period_specified   = 1
      wrong_cluster_version = 2
      no_read_authority     = 3
      cluster_archived      = 4
      technical_error       = 5
      OTHERS                = 6.

Other importan FM is HR_GET_QUOTA_DATA

hope this helps.

A

<i><b>Reward points for each helpful answer.</b></i>

0 Kudos

Hi Amandeep,

i look for some examples with this 2 functions, and im lost,

i read hat u do a report using this 2 functions.

can u post an example in how to use this FM?

tks in advance

0 Kudos

1.

2. <b>HR_GET_QUOTA_DEDUCTION</b>

DATA:dedu         LIKE ptdisded OCCURS 0 WITH HEADER LINE.
  CALL FUNCTION 'HR_GET_QUOTA_DEDUCTION'
    EXPORTING
      pernum           = p_pernr
      sbegda           = pn-begda
      sendda           = pn-endda
    TABLES
      qdisded          = dedu
    EXCEPTIONS
      record_not_found = 1
      OTHERS           = 2.

3. <b>HR_TIME_RESULTS_IN_INTERVAL</b>

DATA: time_results TYPE ptm_time_results OCCURS 0 WITH HEADER LINE.
  CALL FUNCTION 'HR_TIME_RESULTS_IN_INTERVAL'
    EXPORTING
      int_pernr             = p_pernr
      int_begda             = pn-begda
      int_endda             = pn-endda
      int_cltyp             = '1'
    TABLES
      int_time_results      = time_results
    EXCEPTIONS
      no_period_specified   = 1
      wrong_cluster_version = 2
      no_read_authority     = 3
      cluster_archived      = 4
      technical_error       = 5
      OTHERS                = 6.

hope this helps.

Cheers

Amandeep

Reward points for each helpful answer.

0 Kudos

Tks,

any general explanation of the parameters?

tks in advance