HR_INFOTYPE_OPERATION invoked in infotype's PAI

Hi all,
Can i invoke the HR_INFOTYPE_OPERATION function to insert a record in another infotype for the same PERNR in the PAI of an infotype??

Hi joseph,
1.  The usage is like this :
DATA : p0008 LIKE TABLE OF p0008 WITH HEADER LINE.
DATA : ret TYPE bapireturn1,
       k TYPE bapipakey.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
  EXPORTING
    infty                  = '0008'
   number                 = mypernr
  subtype                = '3'
  OBJECTID               =
  LOCKINDICATOR          = 'X'
  VALIDITYEND            = p0008-endda
  VALIDITYBEGIN          = p0008-begda
  RECORDNUMBER           =
    record                 = p0008
   operation              = 'MOD'
     operation              = 'INS'
  TCLAS                  = 'A'
   dialog_mode            = '0'
   NOCOMMIT               = nc
  VIEW_IDENTIFIER        =
  SECONDARY_RECORD       =
IMPORTING
   return                 = ret
   key                    = k
2. Further
3. if we call this FM from some independent program,
   we need to lock the pernr using
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
     EXPORTING
          number = mypernr
      IMPORTING
           return = l_bapireturn.
4. But since u may call this FM from user exit,
   the pernr will already be locked,
   and u need not use point no 3.
regards,
amit m.

Similar Messages

  • Using FM HR_INFOTYPE_OPERATION to update infotype 0001.

    We're using FM HR_INFOTYPE_OPERATION to update the infotype 0001 (Organisation). We basically have the Cost center field grayed out on the entry screen so can not update it via BDC, which the cirrent method that we use to create new employees, based on data passed in from a third party system. When then attempt to update the employee record (using Copy) and the FM mentioned.
    We first get the details of the infotype using FM HR_INFOTYPE_GETDETAIL, and this work perfectly, returning all the information required. We the update the structure returned by the RECORD parameter and then use the FM HR_INFOTYPE_OPERATION, like so:
        call function 'HR_INFOTYPE_OPERATION'      
          exporting                                
             infty         =  '0001'               
             number        =  gs_p0001-pernr  
             SUBTYPE       =                       
             OBJECTID      =                       
             lockindicator = 'X'                   
             validityend   = '99991231'            
             validitybegin = gs_p0001-einda   
             RECORDNUMBER  = '001'                 
             record        = gs_p0001             
             operation     = 'COP'   
             nocommit      = 'X'             
       importing                           
        return        = gt_bapireturn1   
        key           = gs_bapipakey     
    exceptions                          
        others        = 1.            
    However, we receiving an error in the gt_bapireturn1 itab basically giving the error PG 184. When I look up the error it basically says that to update this info type we need an exclusive lock, which I would have thought exists when using the LOCKINDICATOR parameter. The previous FM ( HR_INFOTYPE_GETDETAILS) returns blank against the SPRPS fileld (Lock indicator) when reading the infotype data, so it's not previously locked or anything.
    We're using version 4.0b, which I know is pretty old, but surely this update should work.
    Has anyone encountered this problem before, and, do you think I should be able to update this field even though it's grayed out on the screen ?.
    Jason
    Edited by: Jason Stratham on Mar 16, 2010 11:41 AM

    I read that I should be using the enqueue and dequeue FM's despite the LOCKINDICATOR parameter.
    This I have now done, but am now receiving an error PG 428 'A complex application error has occurred', but I'm none the wiser in knowing why this error has occurred. Has anyone encountered this error before?.
    I'm beginning to feel that despite being told that I can use the HT_INFOTYPE_OPERATION  function module it may well purely imitate the front screen processing, which does not allow us to change the cost center value. Is there any way that this might be done. We're on version 4.0b, and I'm sure that in later version there might be a BAPI that almost directly updates it. I guess there's no such method for 4.0b?.
    Jason
    Edited by: Jason Stratham on Mar 16, 2010 12:06 PM

  • Calling HR infotype operation in a webdynpro ABAP application

    Hi,
    is it possible to call hr_infotype_operation on an infotype which has custom control to update the infotype.
    Because i have observed that all the 9 series infotypes which have custom control in them are giving short dump when hr_infotype_operation is used on them.
    Please reply
    Divya

    Hi experts ,
    I am trying to use FM HR_INFOTYPE_OPERATION to update infotype 9205,
    for this i need to pass infotype as exporting parameter.
    but i am not able to use INFOTYPES statement to declare
    the infotype in the view method .
    how can i use the FM now in my webdynpro application
    points are sure.
    Thanks,
    Sushant

  • FM 'HR_INFOTYPE_OPERATION' problem

    Hi experts, I use FM 'HR_INFOTYPE_OPERATION' to change infotype 0002. But it hasn't been changed. Can anyone tell me where is the problem? (In debug all the fields I want to change have currect values) The code as following.
           CALL FUNCTION 'HR_INFOTYPE_OPERATION'
            EXPORTING
              infty         = '0002'
              number        = L_PERNR
              validityend   = LS_PA0002-ENDDA
              validitybegin = LS_PA0002-BEGDA
              record        = LS_PA0002
              operation     = 'MOD'          "MODIFY
              nocommit      = ''
            IMPORTING
              return        = ls_return
              key           = ls_key
            EXCEPTIONS
              OTHERS        = 1.
    Thanks!
    Edited by: wuyia nata on Aug 26, 2008 11:24 AM
    Edited by: wuyia nata on Aug 26, 2008 11:25 AM
    Edited by: wuyia nata on Aug 26, 2008 11:27 AM

    Hi,
    Check this below code
    We need to explicitly use the Enqueue and Dequeue FM.
    READ TABLE t_res INTO fs_res INDEX 1. " only one record this tabke has. you can also loop the table for N entires.
    CALL FUNCTION 'ENQUEUE_EPPRELE'
         EXPORTING
    *   MODE_PREL            = 'E'
    *   MANDT                = SY-MANDT
           pernr                = fs_res-pernr
           infty                = '0002'
    *   SUBTY                =
    *   OBJPS                =
    *   SPRPS                =
    *   ENDDA                =
    *   BEGDA                =
    *   SEQNR                =
      EXCEPTIONS
       foreign_lock         = 1
       system_failure       = 2
       OTHERS               = 3
        IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        IF fs_res-pernr = '00000004'.
          fs_rec = fs_res.
          fs_rec-inits = 'tom'.
          fs_rec-nachn = 'hanks'.
          fs_rec-vorna = 'L'.
        ENDIF.
        CALL FUNCTION 'HR_INFOTYPE_OPERATION'
          EXPORTING
            infty                  = '0002'
            number                 = fs_rec-pernr
    *   SUBTYPE                =
    *   OBJECTID               =
    *   LOCKINDICATOR          =
       validityend            = fs_rec-endda
       validitybegin          = fs_rec-begda
    *   RECORDNUMBER           =
            record                 = fs_rec
            operation              = 'MOD'
      IMPORTING
       return                 = fs_return
    *   KEY                    =
        APPEND fs_return TO t_return.
        CLEAR fs_return.
        CALL FUNCTION 'DEQUEUE_EPPRELE'
      EXPORTING
    *   MODE_PREL       = 'E'
    *   MANDT           = SY-MANDT
       pernr           = fs_res-pernr
       infty           = '0002'
    *   SUBTY           =
    *   OBJPS           =
    *   SPRPS           =
    *   ENDDA           =
    *   BEGDA           =
    *   SEQNR           =
    Regards
    Lekha

  • Infotype operation on infotype 0008

    Dear Freinds,
                While using the HR_INFOTYPE_OPERATION for the infotype 0008 , i have one specific problem being encountered .
    the scenario is when iam having multiple Wage types for an employee..then i couldnt upload all the wages types . Only the
    the wage type which is last one is being uploaded .
    ex
    pernr        wage type
    1001          101
                     102
                     103
    so when i see after uploading the data for the employee no
    1001 only the wage type 103 being uploaded but not 101 & 102 at all.
    could any one please let me know what i should do in order to get all the wages types.
    Thanks & regards

    In the record you have to fill diferent fields, if you have more then one wage you have to fill fields LGA01, LGA02, LGA03 and so on. I dont know what your input is (file or database) but i sugest creating the internal table with the same field names and then move-corresponding itab to it0008. If you specify a bit more i can give you an more exact example.

  • Put a default value in an infotype with a BADI ?

    We want to put a default value in the administrators fields of the infotype 0001 (depending on the company code) when the user create/change it.
    A standard feature exist but onluy for the administrator group.
    Because we want to follow the technological evolution of SAP, we try to use a badi instead of a user-exit.
    So, we found this badi definition: HRPAD00INFTY (method BEFORE_OUTPUT).
    Problem: all the parameters (including the infotype value) are IMPORT parameters.
    So we can't modify the infotype content...
    Do anyone know how to modify the content of an infotype with a BADI ?
    Or do we must continue to use user-exit in such cases ?

    If one was just learning about userexits, BAdIs and the new Enhancement Framework as well as infotype PBO and PAI, this can be a bit of a mountain to climb, but these two documents might be useful.
    <a href="/people/sergey.korolev/blog/2005/03/14/the-time-for-me-to-have-a-badi-of-my-own time for me to have a BADi of my own</a>
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/u/266">what the New Enhancement Framework Is For – Its Basic Structure and Elements For Beginners (Five Parts)</a>
    I "enhanced" the first article's solution with the second article's tutorial to cut my teeth on the new framework while providing myself with a means to use BAdIs for infotype PBOs/PAIs.  Thank you very much to the authors!

  • How to upload data for custom infotype

    Hi  Friends
    Can we use HR_INFOTYPE_OPERATIONS   FM  for custom infotype too  or is there other way or other Standard FM to upload data for custom infotype  starting with 9000..etc.
    Points will be there for sure.
    Thanks
    Meeta & Roopa

    Thanks for quick response.
    my qns is can we use Standard FM like HR_INFOTYPE_OPERATIONS  for custom infotype too ?
    in my requirment  input will come from portal form and in background  Java Wd is going to use these FM  but i have this big  doubt can we use these standard FM for  uploading data in custom infotype as well or else is there any other way.. but for sure we can't use BDC and LSMW in this requirement .
    Thanks Meeta & Roopa

  • Updation of PD infotypes

    Is there any FM / BAPI / BADI that does a similliar operation to HR_INFOTYPE_OPERATION for PD infotypes?
    Kindly help.

    <b><REMOVED BY MODERATOR></b>
    The function module HR_INFOTYPE_OPERATION cannot be used to update the PD infotypes..
    PL try RH_INSERT_INFTY or RH_UPDATE_INFTY to meet your reqt.
    Arya
    Message was edited by:
            Alvaro Tejada Galindo

  • Bdc recording of infotype 24 for qualification

    Hi Frn's ,
      i want to record bdc of infotype 24  for qualification . but i am not able to input the value of qualification in table control . for this i have to search click the create button given in bottom and after that a pop up is raising  to search the value , when i am  putting the value and hitting the enter , pop up of serch help is raising ,
      the problem begins from here ...
       now i am selecting that single value by clicking the check box .....but in recording there is no effect of this .... so finally i am not able to select that value ....
      please somebody give me the solution ..
      Thanks and Regards.
      Priyank Dixit

    Hi ,
    i think u can also use HR_INFOTYPE_OPERATION to create infotype records , see its documentation to know how to use it .
    or search on sdn to get sample programs.
    regards
    Prabhu

  • Class to update infotype

    Hi friends,
    Can you please give the details of class(not HR_INFOTYPE_OPERATION) for updating infotypes?
    Thanks in advance,
    Anu

    Hi Anu,
    If "Class " mentioned by you related to time constrins,
    A time constraint indicates whether more than one infotype record may be available at one time. The following time constraint indicators are permissible:
    1: An infotype record must be available at all times. This record may have no time gaps. You may not delete the record last stored on the database because all records of this infotype would otherwise be deleted.
    2: Only one record may be available at one time, but time gaps are permitted.
    3: Any number of records may be valid at one time, and time gaps are permitted.
    Other possible time constraint indicators are as follows:
    A: Only one record may ever exist for this infotype. It is valid from 01/01/1800 to 12/31/9999. Splitting is not permissible.
    View V_T582B Infotypes Which are Created Automically controls whether the system automatically creates the infotype record for an employee hiring or an applicant data entry action.
    Infotypes with time constraint A may not be deleted.
    B: Only one record may ever exist for this infotype. It is valid from 01/01/1800 to 12/31/9999. Splitting is not permissible.
    Infotypes with time constraint B may be deleted.
    T: The time constraint varies depending on the subtype.
    Z: Refers to time management infotypes. The time constraint for these infotypes depends on the time constraint class defined in view V_T554S_I Absence: General Control. Collision checks are defined in view V_T554Y Time Constraint Reaction.

  • WHY BDC for infotypes?

    Hi Gurus!
    Was wondering when is it obligatory to use BDC instead of function module to upload data?
    Aint it so that this function module HR_INFOTYPE_OPERATION works fine even when the infotype is enhanced?
    Reward points for good answers.
    Regards

    Hi,
    Sometimes BDC is required instead of FM 'HR_INFOTYPE_OPERATION', cause the infotype might be using some other include infotypes or strucutres for maintaining the data. for examples :
    1. Infotype 25(Appraisals), the data is stored in some other tables hence the above FM will not work.
    2.Infotype 0045(Loans) stored the payment details in IT 78 which cannot be update simultaneoulsy along with IT 0045,you need to call above FM twice for both IT 45 & IT 78, incase any one gives error you need to again call the same FM for deletion.
    In all case where data is stored in different table rather than corresponing infotype table,I doubt the above FM will work. Hope this justifies.
    Regards,
    Dadarao.

  • User Exit in HR-ABAP.

    Hi to all,
    Can any body help me in User-Exit in Hr-Abap. send me ur mail id i wil send u functional specs.
    Thanks
    hiddu.

    The most common enhancements for HR can be found in PBAS0001.
    Here you will find the user exits for infotypes PBO  & PAI.
    http://sap.ittoolbox.com/groups/technical-functional/sap-hr/implementing-user-exit-for-it0041-452836
    This link should help

  • How to include dynamic action in bdc

    Hi All,
    I want to update infotype 17 when an employee has joined through PA40 (Joining action).So i have written a dynamic action for this .But this dynamic ation does not get called in bdc for joining action.
    So infotype 17 is not maintained if we do joining through bdc.
    I have tried with user-exit zxpadu02 also, calling hr_infotype_operation on saving infotype 0001.But it gives return as 'Employee does not exist'.
    Since that infotype 0001 is still not saved.
    So what to do.
    Yogesh

    Hi Amit,
    For your information we can call dynamic action from BDC.
    go through this link
    how to include dynamic actions in bdc

  • Need to update Enddate on Garnishment Doc and G ordr usg BDC in trans PA30

    Hi
    I have done the Record which changes the end date on the garnishment Doc and Garnishment Order in transaction PA30. But i need to run a program in a batch which will read the data from a flat file and update all the employees above date.
    Now i got the reading from the flat file part done. But the Automatically created program from BDC is not updateing. Its looping through and every thing but the following part is not working. BTW the Auto program added lots of field and stuff. but i just need to update Enddate every thing else should be the same. so i commented out some of the lines. And I was trying to get only the employee number from the flat file. But if i need more stuff as input that can be arranged too.
    So here is my code where it suppose to update the endda. Please tell me why its not working...
    perform bdc_dynpro      using 'SAPMP50A' '1000'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RP50G-PERNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RP50G-PERNR'
                                  rec-PERNR_001.
    perform bdc_field       using 'RP50G-TIMR6'
                                  rec-TIMR6_005.
    perform bdc_dynpro      using 'SAPMP50A' '1000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=MOD'.
    perform bdc_field       using 'RP50G-PERNR'
                                  rec-PERNR_001.
    perform bdc_field       using 'BDC_CURSOR'
                                  'T582S-ITEXT(04)'.
    perform bdc_field       using 'RP50G-SELEC(04)'
                                  rec-SELEC_04_004.
    perform bdc_field       using 'RP50G-TIMR6'
                                  rec-TIMR6_005.
    perform bdc_dynpro      using 'MP019400' '2000'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'P0194-ENDDA'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    *perform bdc_field       using 'P0194-BEGDA'
    *                              rec-BEGDA_006.
    perform bdc_field       using 'P0194-ENDDA'
                                  rec-ENDDA_007.
    perform bdc_field       using 'P0194-GCASE'
                                  rec-GCASE_008.
    *perform bdc_field       using 'P0194-GSTAT'
    *                              rec-GSTAT_009.
    *perform bdc_field       using 'P0194-RCVDD'
    *                              rec-RCVDD_010.
    *perform bdc_field       using 'P0194-GPRIO'
    *                              rec-GPRIO_011.
    *perform bdc_field       using 'P0194-ORIGN'
    *                              rec-ORIGN_012.
    *perform bdc_field       using 'P0194-GCATE'
    *                              rec-GCATE_013.
    *perform bdc_field       using 'P0194-LIFNR'
    *                              rec-LIFNR_014.
    *perform bdc_field       using 'P0194-ORREG'
    *                              rec-ORREG_015.
    *perform bdc_field       using 'P0194-ORCNT'
    *                              rec-ORCNT_016.
    *perform bdc_field       using 'P0194-SCHID'
    *                              rec-SCHID_017.
    *perform bdc_field       using 'P0194-RULNR'
    *                              rec-RULNR_018.
    perform bdc_dynpro      using 'MP019400' '2000'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'P0194-BEGDA'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=UPD'.
    *perform bdc_field       using 'P0194-BEGDA'
    *                              rec-BEGDA_019.
    perform bdc_field       using 'P0194-ENDDA'
                                  date.
    "perform bdc_field       using 'P0194-GCASE'
    "                              rec-GCASE_021.
    "perform bdc_field       using 'P0194-GSTAT'
    "                              rec-GSTAT_022.
    "perform bdc_field       using 'P0194-RCVDD'
    "                              rec-RCVDD_023.
    "perform bdc_field       using 'P0194-GPRIO'
    "                              rec-GPRIO_024.
    "perform bdc_field       using 'P0194-ORIGN'
    "                              rec-ORIGN_025.
    "perform bdc_field       using 'P0194-GCATE'
    "                              rec-GCATE_026.
    "perform bdc_field       using 'P0194-LIFNR'
    "                              rec-LIFNR_027.
    "perform bdc_field       using 'P0194-ORREG'
    "                              rec-ORREG_028.
    "perform bdc_field       using 'P0194-ORCNT'
    "                              rec-ORCNT_029.
    "perform bdc_field       using 'P0194-SCHID'
    "                              rec-SCHID_030.
    "perform bdc_field       using 'P0194-RULNR'
    "                              rec-RULNR_031.
    perform bdc_transaction using 'PA30'.

    Uncomment the Begda field ...
    *perform bdc_field       using 'P0194-BEGDA'
                                 rec-BEGDA_006.
    *perform bdc_field       using 'P0194-BEGDA'
                                 rec-BEGDA_019.
    Also please check what are the mandatory fields that needs
    to be entered ...
    An alternative to writing the BDC is to USE FM
    HR_INFOTYPE_OPERATION to update infotypes....

  • Function Module for book Training Program for an employee

    Hi All,
    As we are having the Standard function module "HR_INFOTYPE_OPERATION" for PA infotypes.
    So is there any function module by using that function module in program we can Book,Cancel, Rebook , Prebook a training program for an employee as we can Book,Cancel, Rebook , Prebook through transaction code PSV1 in Training Module .
    And i want to know the table names where the data insert / update when we book a training program for an employee through transaction code PSV1 in Training & event Module.
    can anyone help...?
    Regards,
    Priya.

    Hi,
    use FM 'RH_PARTICIPATION_INSERT' for Book attendance .

Maybe you are looking for

  • Document name restrictions

    Hi,  I was asked to restrict document names. Users mustn't be able to add a file named 'movies.doc' unless it starts with our company's name. It must be 'companyName_movies.doc'. Can this be achieved? I am using SharePoint Online. Thank you in advanc

  • What is the proper method to do an internet recovery.  I tried Command R and it did not work.

    I am having problems with my iMac, I cannot log on.  I tried doing the internet recovery with the assistance of Apple support but when it went to restart it had the same problem as I have when trying to log in.  (Mostly gray screen with one login id

  • Lion killed my 2007 MacBook Pro

    Installed Lion successfully on my 2007 MacBook Pro. First run went OK. Tried restarting and won't boot. No Chime... nothing. SMC reset and PRAM reset don't do anything. Sleep light comes on for split second, optical disk engages momentarily, then all

  • Quotation - Sales - Billing  Overview

    Dear all, We are looking for an overview report which shows the flow from the quotation documents + item, sales documents + item and the Billing documents + item. In this flow we would like to see the document numbers themselves, the throughput times

  • I can't open Elements after I download it from the website.

    I recently had to replace my hard drive on my iMac. After doing so, I tried to download Photoshop Elements after logging into the Adobe website. I download and when I hit the "open" button, nothing happens. Does anybody have any insight on how to fix