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

How to restrict the Casual leaves and Sick leaves in continuesly in infotye 2001 in pa30?

Hi Experts,

In pa30 transaction with infotype is 2001 and subtype is cl01 or sl01 , when i am assigning leave type (cl01 or sl01) first check before leave is ( sl01 or cl01) at that time i want to throw an error message and the date range is varying. can you help me about this logic it's urgent requirement i am new to ABAP/HR.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 07, 2013 at 07:31 AM

    Hi experts,

    give me the code or any links related this query? your help very useful to me?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 07, 2013 at 08:26 AM

    Hi,

    Whenever if you have applied leave for exp 01.01.2013 again if you would like apply leave same this date 01.01.2013 system will't accept automatically system will give error message for this we need not to write any program.

    Yours😊

    Mohan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 07, 2013 at 09:23 AM

    Hi Yogesh,

    You can make use of the customer exit to restrict continuous sick or casual leave while creating record 2001. For e.g from your query i understand that if an employee is on casual leave on a particular day the next day he cannot take sick leave continuously.

    Write the below mentioned logic in exit , for checking the entry whether it exist in 2001 or not use the functional module HR_READ_SUBTYPE to check for whether the entry is there in the system for C.L and throw an error when there is C.L and S.L taken continuously.

    Hope the above information was helpful for you.

    Regards,

    Mithun K

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 08, 2013 at 10:33 AM

    Hi Yogesh,

    You can write the logic in the Customer EXIT -> EXIT_SAPFP50M_002 to check the same.

    SKR

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 08, 2013 at 11:01 AM

    Hi experts,

    Thanks for all suggestions, i already found the exit, and wrote some code

    but it will work when i am giving single day, but when i am trying to give some range of dates it's not working, can any one suggest the code for range of dates.

    thanks in advance.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Use this FM to get the Holiday calendar list..

      CALL FUNCTION 'HOLIDAY_GET'

      EXPORTING

      HOLIDAY_CALENDAR = 'AA'

      * FACTORY_CALENDAR = ' '

      DATE_FROM = MT_BEGDA

      DATE_TO = MT_ENDDA

      * IMPORTING

      * YEAR_OF_VALID_FROM =

      * YEAR_OF_VALID_TO =

      * RETURNCODE =

      TABLES

      holidays = MT_WRDY1

      * EXCEPTIONS

      * FACTORY_CALENDAR_NOT_FOUND = 1

      * HOLIDAY_CALENDAR_NOT_FOUND = 2

      * DATE_HAS_INVALID_FORMAT = 3

      * DATE_INCONSISTENCY = 4

      * OTHERS = 5

      .

      IF sy-subrc <> 0.

      * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

      * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      ENDIF.

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.