HR_INFOTYPE_OPERATION update

hi,
i was using HR_INFOTYPE_OPERATION to update pa0219 DB table......
but its going to dump.....guide me...here is what i was passing to this....
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
      EXPORTING
        infty         = lc_0219
        number        = lv_pernr
        SUBTYPE       = p_pa0219-SUBTY
       OBJECTID      = p_pa0219-OBJPS
        validityend   = p_pa0219-endda
        validitybegin = p_pa0219-begda
        record        = p_pa0219
        operation     = lv_oper
        tclas         = 'A'
        dialog_mode   = '0'
        nocommit      = ''
      IMPORTING
        return        = lstr_bapireturn
        key           = lstr_bapikey.
    MOVE lstr_bapireturn TO return.
    IF sy-subrc = 0.
    ENDIf.

Hi,
Try this:
*This FM fisrt to fill out the internal table
  CALL FUNCTION 'HR_INFOTYPE_GETDETAIL'
       EXPORTING
            INFTY         = '0006'
            NUMBER        = EMPLOYEENUMBER
            SUBTYPE       = SUBTYPE
            OBJECTID      = OBJECTID
            LOCKINDICATOR = LOCKINDICATOR
            VALIDITYEND   = VALIDITYEND
            VALIDITYBEGIN = VALIDITYBEGIN
            RECORDNUMBER  = RECORDNUMBER
            TCLAS         = 'A'
       IMPORTING
            RETURN        = RETURN
            RECORD        = P0006
       EXCEPTIONS
            OTHERS        = 0.
  IF NOT RETURN IS INITIAL.
    EXIT.
  ENDIF.
*Next, put the values you want to change
  P0006-PERNR = EMPLOYEENUMBER                  .
  P0006-SUBTY = SUBTYPE                         .
  P0006-INFTY = '0006'                          .
  P0006-OBJPS = OBJECTID                        .
  P0006-SPRPS = LOCKINDICATOR                   .
  P0006-BEGDA = VALIDITYBEGIN                   .
  P0006-ENDDA = VALIDITYEND                     .
  P0006-SEQNR = RECORDNUMBER                    .
  P0006-ANSSA = SUBTYPE                         .
  P0006-NAME2 = CONAME                          .
  P0006-STRAS = STREETANDHOUSENO                .
  P0006-LOCAT = SCNDADDRESSLINE               .
  P0006-ORT01 = CITY                            .
  P0006-ORT02 = DISTRICT                        .
  P0006-PSTLZ = POSTALCODECITY                  .
  P0006-STATE = STATE                           .
  P0006-LAND1 = COUNTRY                         .
  P0006-TELNR = TELEPHONENUMBER                 .
  P0006-COM01 = COMMTYPE1.
  P0006-NUM01 = COMMNUMBER1.
  P0006-COM02 = COMMTYPE2.
  P0006-NUM02 = COMMNUMBER2.
  P0006-COM03 = COMMTYPE3.
  P0006-NUM03 = COMMNUMBER3.
  P0006-COM04 = COMMTYPE4.
  P0006-NUM04 = COMMNUMBER4.
  P0006-COM05 = COMMTYPE5.
  P0006-NUM05 = COMMNUMBER5.
  P0006-COM06 = COMMTYPE6.
  P0006-NUM06 = COMMNUMBER6.
  CALL FUNCTION 'HR_INFOTYPE_OPERATION'
       EXPORTING
            INFTY          = '0006'
            NUMBER         = EMPLOYEENUMBER
            SUBTYPE        = SUBTYPE
            OBJECTID       = OBJECTID
            LOCKINDICATOR  = LOCKINDICATOR
            VALIDITYEND    = VALIDITYEND
            VALIDITYBEGIN  = VALIDITYBEGIN
            RECORDNUMBER   = RECORDNUMBER
            RECORD         = P0006
            OPERATION      = CHANGE
            NOCOMMIT       = NOCOMMIT
       IMPORTING
            RETURN         = RETURN
       EXCEPTIONS
            OTHERS         = 0.

Similar Messages

  • HR_INFOTYPE_OPERATION updates for a PERNR not passed to it

    Hi All,
    We have a case where an Internal Employee has left the company and he is rehired as an External. In this case, the same User Id has two different PERNRs. The old PERNR will be in Withdrawn status while the new one will be Acitve.
    I am using HR_INFOTYPE_OPERATION to update IT0002 for the new External's PERNR.
    Even though I pass only the new PERNR and the External's record to the FM, it updates in IT0002 for both the PERNRs.
    Can anyone pls shed some light on why this happens ?
    Thanks a lot.
    Naila

    Intresting ..
    i Know i am wrong but check with your FC
    So Generally if the same employee is hired into organisation we need to use the same PERNR and make Him Re-hire and Change the department...
    So some where you are combining the previous pernr and this pernr ...Just check where ..Mean while if i get information will let you know///Second pernr concept comes with Concurrent employement
    Ask your FC how is he generating the SECOND pernr based on old pernr.
    Regards
    sas

  • Need to delimit infotype pa2006 record 'HR_INFOTYPE_OPERATION'

    Hi
    I need to delimit infotype record of infotype pa2006  in my own function module.
    start date =  01.01.2009
    delimit date = 01.01.2010
    PA2006
      SELECT * FROM PA2006 INTO IT_PA2006
                    WHERE PERNR EQ PERNR
                      AND ENDDA LE '99991231'.
      ENDSELECT.
      IF SY-SUBRC = '0'.
        WA_TAB1-INFTY = '2006'.
        WA_TAB1-FNAME = 'P2006-PERNR'.
        WA_TAB1-FVAL = IT_PA2006-PERNR.
        APPEND WA_TAB1 TO IT_TAB1.
        WA_TAB1-INFTY = '2006'.
        WA_TAB1-FNAME = 'P2006-BEGDA'.
        WA_TAB1-FVAL = IT_PA2006-BEGDA.
        APPEND WA_TAB1 TO IT_TAB1.
        WA_TAB1-INFTY = '2006'.
        WA_TAB1-FNAME = 'P2006-ENDDA'.
        WA_TAB1-FVAL = IT_PA2006-ENDDA.
        APPEND WA_TAB1 TO IT_TAB1.
        WA_TAB1-INFTY = '2006'.
        WA_TAB1-FNAME = 'P2006-KTART'.
        WA_TAB1-FVAL = IT_PA2006-KTART.
        APPEND WA_TAB1 TO IT_TAB1.
        WA_TAB1-INFTY = '2006'.
        WA_TAB1-FNAME = 'P2006-BEGUZ'.
        WA_TAB1-FVAL = IT_PA2006-BEGUZ.
        APPEND WA_TAB1 TO IT_TAB1.
        WA_TAB1-INFTY = '2006'.
        WA_TAB1-FNAME = 'P2006-ENDUZ'.
        WA_TAB1-FVAL = IT_PA2006-ENDUZ.
        APPEND WA_TAB1 TO IT_TAB1.
        WA_TAB1-INFTY = '2006'.
        WA_TAB1-FNAME = 'P2006-ANZHL'.
        WA_TAB1-FVAL = IT_PA2006-ANZHL.
        APPEND WA_TAB1 TO IT_TAB1.
        WA_TAB1-INFTY = '2006'.
        WA_TAB1-FNAME = 'P2006-DESTA'.
        WA_TAB1-FVAL = IT_PA2006-DESTA.
        APPEND WA_TAB1 TO IT_TAB1.
        WA_TAB1-INFTY = '2006'.
        WA_TAB1-FNAME = 'P2006-DEEND'.
        WA_TAB1-FVAL = IT_PA2006-DEEND.
        APPEND WA_TAB1 TO IT_TAB1.
    ENDIF.
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
      EXPORTING
        INFTY                  = 2006
        NUMBER                 = PERNR
       SUBTYPE                = IT_PA2006-SUBTY
      OBJECTID               =
      LOCKINDICATOR          =
       VALIDITYEND            = DATE
       VALIDITYBEGIN          = IT_PA2006-BEGDA
      RECORDNUMBER           =
        RECORD                 = IT_TAB1
        OPERATION              = 'MOD'
      TCLAS                  = 'A'
      DIALOG_MODE            = '0'
      NOCOMMIT               =
      VIEW_IDENTIFIER        =
      SECONDARY_RECORD       =
    IMPORTING
       RETURN                 = RETURN
      KEY                    =
    Why it is not delimit the infotype record. Let me know if any other way to do the same.

    Hi friend please do this
    "Need to lock the employee before delimiting
    CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
        EXPORTING
          number        = px_infty_key-pernr
    IMPORTING
           return       = px_bapireturn.
    "in the 'HR_INFOTYPE_OPERATION' we need to specify all the details of the infotype what i have mentioned belo
      CHECK px_bapireturn-type NA 'AEX'.
      CLEAR: px_bapireturn.
      CALL FUNCTION 'HR_INFOTYPE_OPERATION'       " Updation of Employee Record
        EXPORTING
         infty                  = px_infty_key-infty
         number                 = px_infty_key-pernr
         subtype                = px_infty_key-subty
         objectid               = px_infty_key-objps
         lockindicator          = px_infty_key-sprps
         validityend            = px_infty_key-endda     "just give the date which you want to delimit with
         validitybegin          = px_infty_key-begda
         recordnumber           = px_infty_key-seqnr
         record                 = px_infty_data
         operation              = lc_mod
         tclas                  = 'A'
         dialog_mode            = '0'
         nocommit               = space
       IMPORTING
         return                 = px_bapireturn
         key                    = px_bapikey.
    "Unlock the employee after the operation
      CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'       " Unlock the Employee Record
        EXPORTING
          number        = px_infty_key-pernr.
    I think will will solve your problem.
    Just try it and let me know if you have any issues.
    Thanks and Regards,
    Sri Hari Anand Kumar

  • HR ABAP : Custom Infotype updations through FM HR_INFOTYPE_OPERATION

    Hi All,
              Actually, I want to update the custom infotype 3 fields as per my user inputs. I am fetching the data from the PA table acoording to sy-datum falling in the begda, enda limitations. now I am changing the field with new values in the work area. And pass with the following data to the FM.
              But I am getting the error 'No data stored for 9008 in the selected period', eventhough it is already having a data in the database table. I had seen prvious therads, but could not get how they solved the issue.
    Please provide the inpus for the following code.
              ( I had also passed the validity start and end from the database entry. at this moment it gets dumped at the statement
      assign record to <record> casting type (tabname). "XDP UniCode
    where tabname is proposed from t777d-ppnnn. which is a structure and having a value as P9008. If i change the value at debug point to PA9008. it works fine. is there anything extra i need to do to solve this issue? )
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
    EXPORTING
    infty = '9008'
    number = pernr
    "SUBTYPE =
    "OBJECTID =
    "LOCKINDICATOR =
    "VALIDITYEND =
    "VALIDITYBEGIN =
    "RECORDNUMBER =
    record = wa_pa9008
    operation = 'MOD'
    "TCLAS = 'A'
    "DIALOG_MODE = '0'
    "NOCOMMIT =
    "VIEW_IDENTIFIER =
    "SECONDARY_RECORD =
    IMPORTING
    return = l_bapireturn
    key = bapipakey_tab
    Regards,
    Brijesh Patel

    Hi,
    Check this code once
    Read Infotype9004 Record for the personnel No
        CALL FUNCTION 'HR_READ_INFOTYPE'
          EXPORTING
            tclas           = A
            pernr           = pernr
            infty           = 9004
          IMPORTING
            subrc           = v_subrc
          TABLES
            infty_tab       = it_pa9004
          EXCEPTIONS
            infty_not_found = 1
            OTHERS          = 2.
    Read it_pa9004 into wa_pa9004 with some condition.
    if sy-subrc eq 0.
    Lock the employee for processing infotype 9004
        CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
          EXPORTING
            number = wa_pa9004-pernr.
      v_begda = wa_9004-begda.
          v_endda = wa_9004-endda.
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
            EXPORTING
              infty         = c_9004
              number        = wa_9004-pernr
              subtype       = c_0001
              validityend   = v_endda
              validitybegin = v_begda
              record        = wa_9004
              operation     = c_mod
              tclas         = c_a
             dialog_mode   = c_0
              dialog_mode   = '2'
            IMPORTING
              return        = wa_return.
    CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
          EXPORTING
            number = wa_pa9004-pernr.
    endif.
    reward the points if it is helpful.
    Regards,
    Srilatha

  • 'HR_INFOTYPE_OPERATION' MOD is not updating my infotype

    Hi all,
    I have a custom field called ZXXXX in both 2010 and 0015, I'm trying to clear it up if it's populated and update certain infotype record for the particular employee.
    but I was able to clear ZXXXX in infotype 0015 but not 2010,  I'm using the same code but not understand why it works for infotype 0015 but not 2010. any thought?
    Below is the code, thanks all!
    DATA l_return1 TYPE bapiret1.
    DATA l_return2 TYPE bapiret1.
    START-OF-SELECTION.
    GET PERNR.
      RP-PROVIDE-FROM-LAST P0015 SPACE  PNPBEGDA PNPENDDA.
      RP-PROVIDE-FROM-LAST P2010 SPACE  PNPBEGDA PNPENDDA.
          CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
            EXPORTING
              NUMBER = PERNR-PERNR.
                LOOP AT P2010 WHERE ZXXXX IS NOT INITIAL AND pernr = pernr-pernr.
            CLEAR P2010-ZXXXX.
            CALL FUNCTION 'HR_INFOTYPE_OPERATION'
              EXPORTING
                INFTY                  = '2010'
                NUMBER                 = P2010-PERNR
                SUBTYPE                = P2010-SUBTY
                OBJECTID               = P2010-OBJPS
                RECORDNUMBER           = P2010-SEQNR
                LOCKINDICATOR          = P2010-SPRPS
                VALIDITYEND            = P2010-ENDDA
                VALIDITYBEGIN          = P2010-BEGDA
    *           RECORDNUMBER           =
                RECORD                 = P2010
                OPERATION              = 'MOD'
    *            TCLAS                  = 'A'
    *            DIALOG_MODE            = '0'
    *           NOCOMMIT               =
    *           VIEW_IDENTIFIER        =
    *           SECONDARY_RECORD       =
              IMPORTING
                RETURN                 = L_RETURN1
    *           KEY                    =
          ENDLOOP.
          LOOP AT P0015 WHERE ZXXXX IS NOT INITIAL AND pernr = pernr-pernr.
            CLEAR P0015-ZXXXX.
            CALL FUNCTION 'HR_INFOTYPE_OPERATION'
              EXPORTING
                INFTY                  = '0015'
                NUMBER                 = P0015-PERNR
                SUBTYPE                = P0015-SUBTY
                OBJECTID               = P0015-OBJPS
                RECORDNUMBER           = P0015-SEQNR
                LOCKINDICATOR          = P0015-SPRPS
                VALIDITYEND            = P0015-ENDDA
                VALIDITYBEGIN          = P0015-BEGDA
    *           RECORDNUMBER           =
                RECORD                 = P0015
                OPERATION              = 'MOD'
    *            TCLAS                  = 'A'
    *            DIALOG_MODE            = '0'
    *           NOCOMMIT               =
    *           VIEW_IDENTIFIER        =
    *           SECONDARY_RECORD       =
              IMPORTING
                RETURN                 = L_RETURN2
    *           KEY                    =
          ENDLOOP.
            CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
              EXPORTING
                NUMBER = PERNR-PERNR.
            END-OF-SELECTION.

    Hi Ben,
    Let's forget about using FM 'HR_INFOTYPE_OPERATION' for the moment for IT2010 and try to implement this another way - please use the code below for the IT2010 change only.
      DATA:
        lif_msg_handler  TYPE REF TO if_hrpa_message_handler,
        lo_msg_handler   TYPE REF TO cl_hrpa_message_list,
        lv_ok            TYPE boole_d,
        ls_old_2010      TYPE pskey,
        ls_new_2010      TYPE P2010.
    * instantiate the message handler object
      CREATE OBJECT lo_msg_handler.
    * assign a reference to a rereference variable using the CAST operation
      lif_msg_handler ?= lo_msg_handler.
      CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
              EXPORTING
                NUMBER = PERNR-PERNR.
      LOOP AT P2010 WHERE ZXXXX IS NOT INITIAL.   
               "AND pernr = pernr-pernr.  "<=== you don't need this AND condition as you are using LDB already
         ls_old_2010 = p2010-pskey.
         ls_new_2010 = P2010.
         ls_new_2010-aedtm = sy-datum.      "<===== so that record history is correctly maintained
         ls_new_2010-uname = sy-uname.      "<===== so that record history is correctly maintained
         CLEAR ls_new_2010-ZXXXX.
    * transfer the infotype record to the infotype buffer first
        CALL FUNCTION 'HR_ECM_MODIFY_INFOTYPE'
          EXPORTING
            PNNNN           = ls_new_2010               "<======= New/Modfied record
    *        text_tab        =
    *        modify_text  =
             OLD_PSKEY = ls_old_2010                    "<======== Old/Existing record
    *        no_auth_check   =
            message_handler = lif_msg_handler
          IMPORTING
            is_ok           = lv_ok.
    * process forward only if the transfer to buffer was successful
    *  - if unsuccessful...
        IF lv_ok IS INITIAL.
    *     "<==== Handle your exceptions here.....and CONTINUE processing the next row in the current loop
        ELSE.
    *  - if successful...
    * now flush to transfer from infotype buffer to SAP database
          CALL FUNCTION 'HR_ECM_FLUSH_INFOTYPE'
            EXPORTING
    *        NOCOMMIT              = 'X'      
              message_handler       = lif_msg_handler
           IMPORTING
             is_ok                 = lv_ok.
       ENDIF.
    ENDLOOP.
    * unlock the employee - processing now complete
    CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
              EXPORTING
                NUMBER = PERNR-PERNR.
    I'm confident that this will solve your problem - please let me know if it did not.
    Cheers,
    Sougata.

  • 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

  • Using HR_INFOTYPE_OPERATION to update IT0021 and IT0106

    We're trying to update dependent data information using FM hr_infotype_operation but it doesn't seem to be working properly for IT0106. It does work for changes i make for IT0021, though.
    We have the requirement to modify an existing dep record, delimit the record, or add a new dependent record depending on some other logic.
    I know in the FM, you can specify a secondary structure. In the case of IT0021, it's secondary structure would be IT0106.
    I'm passing these fields to my p0106 structure:
    pernr
    subty
    begda
    endda
    aedtm
    uname
    perid
    but i'm not able to update the P0106 record. Any help would be appreciated.
    thanks,
    robert.

    ok great, i believe that fixed it. i think i had a couple of problems that when fixed separately didn't work, but when I put them altogether, it worked.
    my p0106 struc was not declared properly and the view identifier was not set (this pernr's was indeed 10).
    I need to fill in the rest of the p0106 struc from the existing record and it should work fine.
    thanks a ton.
    data: p0021_struc TYPE p0021,
          p0106_struc TYPE p0106,
          p_p_pskey   TYPE pskey.
      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
        EXPORTING
          infty            = p_pskey-infty
          number           = p_pskey-pernr
          subtype          = p_pskey-subty
          objectid         = p_pskey-objps
          lockindicator    = p_pskey-sprps
          validityend      = p0021-endda         " '99991231'
          validitybegin    = p0021-begda
          record           = p0021_struc
          operation        = mode
          tclas            = 'A'
    *      dialog_mode      = '2'
          nocommit         = p_test
          VIEW_IDENTIFIER  = p0003-viekn
          secondary_record = p0106_struc
        IMPORTING
          return           = return
          key              = familykey
        EXCEPTIONS
          OTHERS           = 0.
    Message was edited by: robert phelan

  • Updating infotype 0041 using HR_INFOTYPE_OPERATION?

    Hi All:
    How do we update the dates in infotype 0041 using HR_INFOTYPE_OPERATION? lets say we have 6 dates populated in 41  and we another employee has 9 dates populated. We are reading these records and need to update the dates for all the employee records.
    Thanks
    Venkata

    Hi Venkata,
    What you can do is use the HR_INFOTYPE_OPERATION in Change or MOD(Modify) mode i.e.
    pass 'MOD' in operation parameter.
    Your recordnumber parameter should have the sequence number from infotype record you are updating (field SEQNR). All other parameters should be as it is had been for INS or insert operation.
    Regards.

  • Infotype is not updating through  'HR_INFOTYPE_OPERATION'

    Hi Frds,
    I am trying to update the infotype 2006 leave quota for casual leave. After execution of all code the screen automatically closing itself. Its not modifying the record .  I am writing this code in include of exit PBAS0001. Can anybody help regarding this.
    CALL FUNCTION 'HR_READ_INFOTYPE'
                EXPORTING
                TCLAS                 = 'A'
                  PERNR                 =  lw_pa0000-PERNR
                  INFTY                 =  '2006'
                BEGDA                 = '18000101'
                ENDDA                 = '99991231'
                BYPASS_BUFFER         = ' '
                LEGACY_MODE           = ' '
              IMPORTING
                SUBRC                 =
                TABLES
                  INFTY_TAB             =   lt_2006
              EXCEPTIONS
                INFTY_NOT_FOUND       = 1
                OTHERS                = 2
              IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
              ENDIF.
              read table lt_2006 into lw_2006 with key pernr = innnn-PERNR.
             LW_2006-AEDTM = sy-datum.
              lw_2006-ANZHL = v_cs_quota.
    First Enqueue
              CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
              EXPORTING
                NUMBER = LW_2006-PERNR
              IMPORTING
                RETURN = RETURNE.
             ------------- Update
              CALL FUNCTION 'HR_INFOTYPE_OPERATION'
              EXPORTING
                INFTY = '2006'
                NUMBER = LW_2006-PERNR
                SUBTYPE = LW_2006-SUBTY
                OBJECTID = LW_2006-OBJPS
                LOCKINDICATOR = LW_2006-SPRPS
                VALIDITYEND = LW_2006-ENDDA
                VALIDITYBEGIN = LW_2006-BEGDA
               RECORDNUMBER = LW_2006-SEQNR
                RECORD = LW_2006
                OPERATION = 'MOD'
                TCLAS = 'A'
                DIALOG_MODE = '0'
              IMPORTING
                RETURN = RETURN
                KEY = KEY.
             --------- Dequeue
              CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
              EXPORTING
                NUMBER = LW_P2006-PERNR.
      ENDIF.

    Thank you, Yes Its updating in 2006....but only sy-datum and username are updating .....Leave quota i am changing from 4 to 3 . its not updating, but showing in screen when i used dialog = 2.  Also the same screen appearing 3 times and when i am trying to click on save button its ending with an error 'internal maximum number of sessions reached' , then screen automatically closing by itself.

  • FM HR_INFOTYPE_OPERATION to update IT581

    Dear Freinds,
    I'm trying to upload / update the infotype 581 thru excel data sheet by using FM HR_INFOTYPE_OPERATION.
    the FM HR_INFOTYPE_OPERATION returing the error message "Rent amount is required".
    please help.
    Regards,
    R R Suthar

    Hi,
    Many times  this FM  behaves like this and return Errors like this.same error encontered  was  of infotype 14 upload. than  i have used BDC  tools for the same.
    If u have to  Upload data  than try to use BDC/LSMW objects inseted of  Std.FM  for more control on the code.
    Hope this will help u ....

  • Infotype updation- alternate solution for FM HR_INFOTYPE_OPERATION.

    Hi Expert ,
    Right now i am using FM HR_INFOTYPE_OPERATION to insert data to infotype 19.
    Problem i am facing is data to be inserted is very large and this takes lot of time.
    Is there any other FM which updates infotype in mass i mean using internal table?  Since in this FM cant pass internal table so i have to call this FM for every PERNR.
    Thanks & Regards ,
    JIgar Thakkar.

    Hi Jigar
    As suggested by Rahul,  Use the FM: HR_PSBUFFER_INITIALIZE. This will improve the performance of your code to a great extend. I would personally, use HR_MAINTAIN_MASTERDATA or HR_INFOTYPE_OPERATION to update the infotype 0019. However, both are buffering the data and doing some EXPORT to memory. The result of this is that after a few hundred calls to HR_INFOTYPE_OPERATION or HR_MAINTAIN_MASTERDATA, the buffer gets big enough to impact the performance of the function module. After thousand of updates with HR_INFOTYPE_OPERATION or HR_MAINTAIN_MASTERDATA, each call will take many seconds and your ABAP program will be unusable. Because you run it for high volumes only in the SAP production system, thatu2019s when youu2019ll really see the impact.
    The solution is simple. Call this function module to clear the buffer.
    CALL FUNCTION 'HR_PSBUFFER_INITIALIZE'.
    Hope this helps.
    Harsh

  • Using hr_infotype_operation to update it0021 problem

    I am using hr_infotype_operation to update data for it0021 and it0528.
    In pa30, just in it0021 and different to update data for it0021 and it0528, IT0528 is not allowed maitain
    when i am using hr_infotype_operation to update data for it0021 and it0528 one by one, the problem occurs, it 0528 is not update.
    Any idea?

    Hi,
    The FM HR_INFOTYPE_OPERATION infact copy a BDC & performs all the screen validations that normally occur in PA30. It uses the CALL DIALOG option.
    Also,  set the MODE to '2' which is like the display ALL option in the CALL TRANSACTION.
    This will let you see the error in the foreground.
    Regards,
    Shamma

  • [hr_infotype_operation fails] update it230 in it8 via clientspecified IT

    Hi there
    I need some help to solve my problems with updating infotype 230 from a clientspecified Infotype.
    How it works:
    I have a client-specified Infotype (9100) that recalculates specific dates for the public sector (typical german stuff ). Those data, stored at infotype 0230, is maintained via it0008 where a small subscreen is included, to enter those Data.
    At Infotype 9100 the user can start modifying data by pushing the button "modify IT0008 Data".
    At PAI the fcode calls a perform where "HR_INFOTYPE_OPERATION" passes the Data to IT0008.
    I think everything works fine und the return structure is initial, what means: allright, nothing went wrong!
    BUT: no data is transferred to the database tables!! If I press the button a second time, the system crashes with a dump ...
    If I use "2" at dialogmode, infotype 8 is shown and the data is correctly inserted into the correct fields ...
    The problem is: the FM "HR_INFOTYPE_OPERATION" works fine, but the Data is not send to / updated in the DB tables of IT230.
    Here's the coding:
    ****ps_0008 and ps_0230 are the datasets, containing the data to modify my infotype(s)
    ****p_viekn is the viewidentifier
      CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
        EXPORTING
          number = ps_0008-pernr
        IMPORTING
          return = gv_return_struc.
      IF NOT gv_return_struc IS INITIAL.
    *** Errorhandling
        EXIT.
      ENDIF.
      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
      EXPORTING
        infty         = '0008'
        number        = ps_0008-pernr
        subtype       = ps_0008-subty
        validityend   = ps_0008-endda
        validitybegin = ps_0008-begda
        record        = ps_0008
        view_identifier = p_viekn
        secondary_record = ps_0230
        operation     = 'MOD'
        dialog_mode   = '0'
      IMPORTING
        return        = gv_return_struc
        key           = gv_record_key.
      CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
        EXPORTING
          number = ps_0008-pernr.
    thankyou for your help

    Thanks
    I already tried to commit with ABAP "COMMIT WORK". Is this similar to your proposal?!?!
    But yesterday I found a first workaround, thats working great!
    I export neccessary Data to ABAP-Memory (with EXPORT obj to MEMORY ID xyz) , calling an external programm (SUBMIT report AND RETURN)
    The external Programm does nothing more than getting the Data from ABAP-Memory (by IMPORT obj FROM MEMORY ID) and calling the function modul "HR_INFOTYPE_OPERATION" to modify the Infotype
    Now I try to solve it with a simple function module (don't know why I didn't think about it earlier) ....
    So, my question is answered and maybe this thread can help someoneelse with the same problems

  • How to UPDATE MASTER DATA RECORD PA0377 using FM HR_INFOTYPE_OPERATION

    How to UPDATE MASTER DATA RECORD IN INFOTYPE 0377 DIRECTLY using function module HR_INFOTYPE_OPERATION ? When i use operation = 'MOD'  im getting an ERROR as NO DATA STORED FOR 0377 IN SELECTION PERIOD.
           Can anyone please help me how to use HR_INFOTYPE_OPERATION to UPDATE MASTER DATA RECORD.
    Thanks,
    Karthi.

    Hi,
    please check this code
    it is very useful
    infotypes: 0105.
    parameters: p_pernr type p0105-pernr,
                p_subty type p0105-subty,
                p_begda type p0105-begda,
                p_endda type p0105-endda,
                p_opera type pspar-actio,
                p_usrid type p0105-usrid,
                p_commt as checkbox.    "Useful only when NO_COMMIT is 'X'
    data: w_return type bapireturn1,    "Error handling data
          w_key type bapipakey,         "If record has been created or changed the created/ changed
                                        "record's key (PSKEY) will be populated
          v_message type string.        "For printing returned messages
    call function 'BAPI_EMPLOYEE_ENQUEUE'
      exporting
        number = p_pernr
      importing
        return = w_return.
    if w_return is initial. "Employee is not locked
      p0105-pernr = p_pernr.
      p0105-subty =
      p0105-usrty = p_subty.
      p0105-begda = p_begda.
      p0105-endda = p_endda.
      p0105-usrid = p_usrid.
    *Calls Internally HR_MAINTAIN_MASTERDATA
      call function 'HR_INFOTYPE_OPERATION'
        exporting
          infty         = '0105'
          number        = p_pernr
          subtype       = p_subty
          validityend   = p_endda
          validitybegin = p_begda
          record        = p0105
          operation     = p_opera
          dialog_mode   = '0'
          nocommit      = 'X'
        importing
          return        = w_return
          key           = w_key.
    endif.
    if w_return is not initial.
      message id w_return-id type w_return-type number w_return-number
              with w_return-message_v1 w_return-message_v2 w_return-message_v3
              w_return-message_v4 into v_message.
      case w_return-type.
        when 'A' or 'E'.
          format color col_negative. write:/ v_message.
        when others.
          format color col_heading. write:/ v_message.
      endcase.
      call function 'BAPI_EMPLOYEE_DEQUEUE'
        exporting
          number = p_pernr.
    else.
      format color col_positive. write:/ 'Record Updated Successfully.'.
      if w_key is not initial.
        write:/ 'Key contains',
              / 'Personnel Number:', w_key-employeeno,
              / 'Subtype (absence type):', w_key-subtype,
              / 'Start date of Absence:', w_key-validbegin,
              / 'End date of Absence:', w_key-validend.
      endif.
      commit work.
    endif.
    Thanks and regards
    durga.K

  • Updating hr infotype pa0305 with 'HR_INFOTYPE_OPERATION'

    Hi everyone i'm trying to update hr infotype pa0305 using fm HR_INFOTYPE_OPERATION but it doesn't work  maybe using in worng way.
    Maybe someone knows how can i use the second structure q0305 passing trough the parameter called "secondary records".
    Thanks in advance,

    Sorry for the late, the problem was that the part structure of  p305 is empty; the part of wage type and amount exactly.
    CLEAR lv_return .
        CALL FUNCTION 'HR_INFOTYPE_OPERATION'
          EXPORTING
            infty                  = '0305'
            number                 = wa_alvgrid2_error-pernr
            subtype                = ''
            OBJECTID               =
            LOCKINDICATOR          =
           validityend            = wa_alvgrid2_error-endda
           validitybegin          = wa_alvgrid2_error-begda
            RECORDNUMBER           =
            record                 = st_0305
            operation              = 'INS'
            tclas                  = 'A'
            dialog_mode            = '2'
             nocommit               = ' '
            view_identifier        = '15'
            secondary_record       = st_q0305
         IMPORTING
           return                 = lv_return
            KEY                    =.
    maybe I am in wrong when I pass the secondary record.

Maybe you are looking for

  • Photoshop CS5 creates file and then doesn't allow me to open it.

    I created a file on Photoshop CS5, saved it, and now when I try to open it says: "Could not complete your request because the file is not compatible with this version of Photoshop." How can I open the file? How come the same program cannot open its o

  • Deploying WAR file using IAS Test Drive edition...

    Hi: Is it okay to deploy a build using a WAR file instead of an EAR file? Is there any documentation for deploying WAR files? All the available docs and examples start with EAR files. Thanks, George

  • Valuation Type Wise Standard Cost

    Hi SAP Experts, I can not update the valuation type wise standard cost. It is going updated only at the Header level in the material master. We have activated the batch valuatin and also the split valuation for materials. At the header level in the m

  • GL Hiearchy Extraction

    Hi  All FAGL_FSV_POS_READ Function module has not given all the information from Financial Statement Version using tcode FSE3. It gives only the first parent node information.. I need to retrieve all the node information. Pls any one help to suggest

  • How can I cancel  mistaken purchase from iTunes recently

    Would you be able to help me to cancel my recent purchase from itune that was done by mistake?