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

BADI creation and implementation

Hi all ,

i have to create an implementation for the BADI u2018HRBAS00INFTYu2019 . i have to put the code in one of the methods such that all the infotypes are affetcted . so to acheive this il use a case stmt to seggregate the infotypes.

my doubt is how will i come to know which all infotypes will call this BADI.

TIA

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Sep 09, 2009 at 05:44 AM

    You can use parameter INNNN to trigger any infotype in this badi.

      CHECK sy-tcode EQ 'PA40'.
      DATA: subrc TYPE  sy-subrc,
            infty_tab TYPE TABLE OF prelp INITIAL SIZE 0 ,
             i0000  TYPE  p0000.
    
      CALL FUNCTION 'HR_READ_INFOTYPE'
        EXPORTING
          tclas           = tclas                   
          pernr           = innnn-pernr                        
          infty           = '0000'                             
          begda           = innnn-begda                         
          endda           = innnn-endda                         
        IMPORTING
          subrc           = subrc
        TABLES
          infty_tab       = infty_tab
        EXCEPTIONS
          infty_not_found = 1
          OTHERS          = 2.
      IF sy-subrc = 0 AND NOT infty_tab[] IS INITIAL.
        CLEAR st_prelp.
        READ TABLE infty_tab INTO st_prelp WITH KEY sprps = space.
        CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
          EXPORTING
            prelp = st_prelp
          IMPORTING
            pnnnn = i0000.
      ELSE.
        CLEAR i0000.
      ENDIF.
    * if action is 01(Hiring only )
      CHECK  i0000-massn = '01'.
      CASE innnn-infty.
        WHEN '0006'.
          SELECT SINGLE pernr INTO innnn-pernr FROM pa0021
          WHERE pernr = innnn-pernr.
          IF sy-subrc NE 0 .
            MESSAGE 'Enter details for IT0021 to Proceed' TYPE 'E'.
          ENDIF.
          ENDCASE.
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 09, 2009 at 06:21 AM

    Hi gautam,

    Thanks for the reply.

    the code should work for all the transactions like PA40, PP01, Po03 etc whnenever a postion is assigned to a pernr and thereby showing an error if the position is already assigned to anyother pernr.

    so will this work if i put different checks for all the transactions? but im not sure if there are any othere transactions which use this BADI.

    Do we have any table which records which all infotypes have used this BADI.

    TIA

    Add a comment
    10|10000 characters needed characters exceeded

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.