Use of HR_INFOTYPE_OPERATION in EXIT_SAPFP50M_002

Hi all,
On creation of an absence record (IT2001) we need to insert a new Substitution record (IT2003).  Originally we tried to use HR_INFOTYPE_OPERATION in EXIT_SAPFP50M_002 however this will not work because they are both in the same LUW.  I have searched for similar requests on this in the forum and the only one with a suggestion was to create an RFC to perform the update which I tried but instead I get the 'EPG-428 A complex application error has occurred'.  I have also tried using the BADI 'HRPAD00INFTY' but get the complex error here too.
We are also going to look into using a Dynamic action instead of using the exit however I just wondering if anyone has found a workaround or know of a way to insert/update an infotype record while amending another through EXIT_SAPFP50M_002.  Obviously without doing a direct update to PA2003!
Thanks,
Sinead.

Hi all,
On creation of an absence record (IT2001) we need to insert a new Substitution record (IT2003).  Originally we tried to use HR_INFOTYPE_OPERATION in EXIT_SAPFP50M_002 however this will not work because they are both in the same LUW.  I have searched for similar requests on this in the forum and the only one with a suggestion was to create an RFC to perform the update which I tried but instead I get the 'EPG-428 A complex application error has occurred'.  I have also tried using the BADI 'HRPAD00INFTY' but get the complex error here too.
We are also going to look into using a Dynamic action instead of using the exit however I just wondering if anyone has found a workaround or know of a way to insert/update an infotype record while amending another through EXIT_SAPFP50M_002.  Obviously without doing a direct update to PA2003!
Thanks,
Sinead.

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

  • Problem inserting in Infotype 0002 using FM HR_INFOTYPE_OPERATION

    Hello.
    Im having some trouble uploading data to the PA0002 infotype table. In my program , I upload all the information from a txt file. In this file, every line correponds to an entry of the table.
    To do this, I use the SPLIT sentence to insert in a pa0002 structure, all the values that come from the file line. After that, I use the HR_INFOTYPE_OPERATION to insert the data.
    This works for almost all the tests i made, except for one case: when I have to pass the P0002-ANZKD (number of children) field to the FM.
    The problem here is that when I call the function module the value seems to be correct. But when I make a debug  inside the FM, i noticed that this value is not displayed correctly when the FM makes the move operation to insert this value in the corresponding FVAL field for the PROPOSED_VALUES table. Also, all the values going after this field are not represented correctly in the PROPOSED_VALUES table.
    P0002-ANZKD is a DEC type field, so to make it work with SPLIT, i had to specify ANZKD as a type c field in my structure (everything else is as equal as P0002).  And I also tried uploading the data, first to my structure and later I make a MOVE-CORRESPONDING to an exact P0002 structure, but I get the same result in this case too .
    Does anybody now how can solve this issue?
    Thanks in advance,
    Juanma.

    Hi,
    I've managed to solve the problem. Changing the size of the anzkd field of my structure (greather than 3) and then passing all the values to a  p0002 stucture,  gave me the opportunity to upload succesfully the data into pa0002 with the FM.
    Thank you for your help Anil,
    Juanma.

  • Creation of record in 2001 using FM - HR_INFOTYPE_OPERATION

    Hi fellow ABAP,
    I'm new to using HR_INFOTYPE_OPERATION, I want to make this one an alternative way to create record in IT 2001 instead of using Batch Input.. but it returns me error
    Runtime Errors:         ASSIGN_BASE_TOO_SHORT
    Short text        :        Fehler in ASSIGN-Zuweisung im Programm "SAPLHRMM".
    I ran HR_INFOTYPE_OPERATION at SE37 with these parameters:
    INFTY                   =    '2001'
    NUMBER              =    '00001003'
    SUBTYPE             =    '2250'
    OBJECTID             =   ' '
    LOCKINDICATOR   =   'X'
    VALIDITYEND        =   '06/02/2009'
    VALIDITYBEGIN     =   '06/02/2009'
    RECORDNUMBER =   '000'
    RECORD               =   '2001'
    OPERATION          =   'CREATE'
    TCLAS                   =   'A'
    DIALOG_MODE      =   '0'
    NOCOMMIT            =   'X'
    VIEW_IDENTIFIER  =   ' '
    SECONDARY_RECORD =  ' '
    is there something I missed? and how can I pass value for the creation of IT2001?
    thanks so much in advance...

    Hi Dude,
    Go through this code for 2002..
    tables: pa0001, pa0171, pa0378.
    DATA  BEGIN OF i0378.
            include structure p0378.
    DATA  END   OF i0378.
    DATA: START_DATE LIKE SY-DATUM.
    DATA  RETURN LIKE  BAPIRETURN1.
    selection-screen begin of block p1.
    * This select option allows for testing on limited employees
    * or for splitting the update into multiple runs.
    SELECT-OPTIONS pernr for pa0001-pernr.
    selection-screen end of block p1.
    selection-screen skip.
    selection-screen begin of block b1.
    * The plan year date is normally the first day of the next year
    PARAMETERS: py_date LIKE SY-DATUM.
    * This date is the beginning of the enrollment period for managers
    PARAMETERS: MGR_DATE LIKE SY-DATUM.
    * This date is the beginning of the enrollment period for hourlys
    PARAMETERS: HRLY_DATE LIKE SY-DATUM.
    selection-screen end of block b1.
    INITIALIZATION.
      py_date = sy-datum.
      py_date(4) = py_date(4) + 1.
      py_date+4(4) = '0101'.
    START-OF-SELECTION.
    select * from pa0171
      where pernr in pernr
        and endda ge py_date
        and begda le py_date.
    * skip ineligible employees
      if pa0171-bstat eq 'INEL'.
        continue.
      endif.
    * determine start date of enrollment based on benefit group
      if pa0171-bengr eq 'MNGR'.
        start_date = mgr_date.
      elseif pa0171-bengr eq 'HRLY'.
        start_date = hrly_date.
      else.
    *   ERROR HANDLING GOES HERE
        continue.
      endif.
    * create IT0378 record for this person   
      clear i0378.
      i0378-pernr = PA0171-pernr.
      i0378-barea = PA0171-barea.
      i0378-event = 'OPEN'.
      i0378-begda = start_date.
      i0378-infty = '0378'.
      i0378-aedtm = sy-datum.
      i0378-uname = sy-uname.
      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
           EXPORTING
                INFTY         = '0378'
                NUMBER        = i0378-pernr
                SUBTYPE       = 'OPEN'
                VALIDITYBEGIN = i0378-begda
                RECORD        = i0378
                OPERATION     = 'INS'
           IMPORTING
                RETURN        = return
           EXCEPTIONS
                OTHERS        = 1.
      if sy-subrc ne 0 or return-type ne ' '.
    *   ERROR HANDLING GOES HERE
      endif.
    ENDSELECT.

  • Infotype not getting created using FM HR_INFOTYPE_OPERATION

    I am trying to create infotype 210 from user exit ZXPADU02 using below code.
    DATA :  v_return TYPE bapireturn1,
               v_return1 TYPE bapireturn1,
               v_return2 TYPE bapireturn1,
               v_key TYPE bapipakey,
               v_return3 TYPE bapireturn1.
      p0207 = gt_p0207.
      MOVE-CORRESPONDING p0207 TO p0210.
      p0210-infty = '0210'.
      p0210-begda = p0207-begda.
      p0210-taurt = 'PR'.
      p0210-txsta = '01'.
      p0210-amtex = '0'.
      CLEAR : p0210-aedtm.
      CLEAR : p0210-uname.
      CLEAR: v_return,v_return1,v_key.
      CALL FUNCTION 'BAPI_EMPLOYEET_ENQUEUE'
        EXPORTING
          number        = p0210-pernr
          validitybegin = p0210-begda
        IMPORTING
          return        = v_return.
      IF v_return IS INITIAL.
        CALL FUNCTION 'HR_INFOTYPE_OPERATION'
          EXPORTING
            infty         = '0210'
            number        = P0210-PERNR
            subtype       =  'PR'
           objectid      = p0210-objps
           lockindicator = p0210-sprps
            validityend   = P0210-ENDDA
            validitybegin = P0210-BEGDA
           recordnumber  = p0210-seqnr
            record        = P0210
            operation     = 'INS'
          IMPORTING
            return        = v_return1.
      ENDIF.
      CALL FUNCTION 'BAPI_EMPLOYEET_DEQUEUE'
        EXPORTING
          number        = p0210-pernr
          validitybegin = p0210-begda
        IMPORTING
          return        = v_return.
    But infotype 210 is not getting created.
    When i check it from PA30, i get error
    "No data stored for Residence Tax Area in the selected period"
    Can anyone tell me what is the problem here.
    Full points will be rewarded.

    HI,
    check the value coming on the screens are properly.Use DIALOG_MODE as foreground and check whether all fields getting populated.
    Check any default values need to be populated.
    Regards,
    Manoj.

  • Not modfying ithe infotype while using FM HR_INFOTYPE_OPERATION

    Hi Experts,
    When i am using this FM HR_INFOTYPE_OPERATION its not modifying the infotype 14.Can you please suggest me. Please see my below code. Can please let me know if i am wrong..
    form INSERT_DATA_0014 .
        loop at pa_0014.
    CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
       EXPORTING
         number        = pa_0014-pernr
      IMPORTING
        RETURN        = it_return.
    IF it_return-id EQ 'E'.
      WRITE: / v_pernr, 'Enqueue failed'.
      else.
        write: 'successfully locked'.
        ENDIF.
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
      EXPORTING
        infty                  = '0014'
        number                 = pa_0014-pernr
      SUBTYPE                = pa_0014-SUBTY
    OBJECTID               = pa_0014-OBJPS
      LOCKINDICATOR          = pa_0014-SPRPS
       VALIDITYEND            = pa_0014-begda
       VALIDITYBEGIN          = pa_0014-endda
      RECORDNUMBER           = pa_0014-SEQNR
        record                 = pa_0014
        operation              = 'MOD'
    TCLAS                  = 'A'
       DIALOG_MODE            = '0'
       NOCOMMIT               = ''
      VIEW_IDENTIFIER        =
      SECONDARY_RECORD       =
    IMPORTING
       RETURN                 = l_bapireturn
       KEY                    = bapipakey_tab
    IF l_bapireturn-id NE space.
      WRITE: / v_pernr, 'error'.
      ELSE.
        WRITE: /'SUCCESSFULLY INSERTED'.
      ENDIF.
    CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
      EXPORTING
        number        = v_pernr
    IMPORTING
       RETURN        = l_bapireturn
    IF l_bapireturn-id NE space.
       WRITE: / v_pernr, 'Enqueue failed'.
       else.
         write: /'record successfully modified'.
        ENDIF.
    endloop.
    endform.    
    Thanks,
    Munna.

    Hi,
    Check the entire return internal table I_BAPIRETURN of FM HR_INFOTYPE_OPERATION what it has got to say ( a error message will be there which will tell where is the problem ). If it is initial then check the table PA0014 if the record has been modified. If its still not modified then check if at all it can be manually by PA30. If it doesnt get modified even manually then this is some configuration related issue.
    Regards.

  • How to delimit records using FM HR_INFOTYPE_OPERATION  ( in background )

    Hi all,
    Has anyone used HR_INFOTYPE_OPERATION with OPERATION = 'LIS9' to delimit a record? I keep on getting 'A complex application error has occurred' error message. When I go into dialog mode = '2', the FM will go into the Overview Screen and I realized that the Delimit Date on the top right of the screen is not what I specify as the new record's ENDDA but the original record's ENDDA. Also I have to manually click on Delimit icon on the top left of the screen before it gets delimited.
    Question:
    How do I pass in the delimited date to HR_INFOTYPE_OPERATION? I put it in the RECORD-ENDDA field but it doesn't seem to work?
    Thanks

    rohan,
    why dont you use change mode (mod) and just change the default end date to the date you want the record delimited? that is also delimiting.
    is this requirement for batch job?

  • 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

  • Copy and delete using FM - HR_INFOTYPE_OPERATION..

    Hi All,
    I would like to copy the record and delete the record using the FM - HR_INFOTYPE_OPERATION..
    Scenario : For Example IT 0010
    Existing Record
    BEGDA                      ENDDA
    01.01.2005     30.09.2007
    I would like to copy the records with new begda - 01.10.2007, this is working fine and I am doing the commit work after FM - HR_INFOTYPE_OPERATION with Action COPY.. After this I have put a break point and cross checked theire are two records in IT 0010
    BEGDA                      ENDDA
    01.01.2005     30.09.2007
    01.10.2007     31.12.9999
    After this again I am using HR_READ_INFOTYPE with BEGDA and ENDDA as 01.10.2007, I was expecting the latest record that begda with 01.10.2007 but I am getting the old record that 01.01.2005 and 31.12.2007….!! When I cross check using PA20/PA0010 It shows two records but when I use HR_READ_INFOTYPE it still access the old records…!!, how do we overcome this , for me I need to record with begda 01.10.2007 and endda 31.12.9999 so that I can delete it…!!
    Please suggest..
    Regards,
    Mangalagi S V

    Dear Suresh,
    Thanks for the suggestion., it's worked..!!
    Regards,
    Mangalagi S V

  • Using HR_INFOTYPE_OPERATION dont call user exit

    Hi ,
    I need to write BAPI that create entry in infotype .
    I am using FM "HR_INFOTYPE_OPERATION" ...
    This FM don't call the user exit EXIT_SAPFP50M_002 ....
    Am i using the FM correctly ?
    How can i use the FM with the user-exit .
    Thanks .

    Hi,
    Why do you want to call user-exit. What it your requirement?
    Regards,
    Atish

  • About to use HR_INFOTYPE_OPERATION to create customer infotype issue:

    hi
    i want to create infotype use function(HR_INFOTYPE_OPERATION).
    this infotype is customer infotype.
    the first scenario is:
      i'm be sure no data about one employee in this infotype(9004).
      to call with data upload function and put data into internal table IT_PA9004.
      and the table data as follow:
    one line: it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
              it_pa9004-begda = '20080201' , it_pa9004-endda = '20080930'
              it_pa9004-zzvalue = 50 (customer field).
    two line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
              it_pa9004-begda = '20080201' , it_pa9004-endda = '20080930'
              it_pa9004-zzvalue = 60 (customer field).
    three line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
              it_pa9004-begda = '20080101' , it_pa9004-endda = '20081031'
              it_pa9004-zzvalue = 70 (customer field).
    four line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
              it_pa9004-begda = '20080101' , it_pa9004-endda = '20081031'
              it_pa9004-zzvalue = 80 (customer field).
    i run the programme and get information is:
    11022887 insert ok.
    11022887 insert ok.
    11022887 insert ok.
    11022887 insert ok.
    but i use the transation PA30 to view all data:
    in database just exist one row:
    four line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
              it_pa9004-begda = '20080101' , it_pa9004-endda = '20081031'
              it_pa9004-zzvalue = 80 (customer field).
    the second scenario is:
    in database the infotype have exist one row:
               pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ02',
               pa9004-begda = '20080318' , pa9004-endda = '20080318'
               pa9004-zzvalue = X (customer field).
    and i create another row:
    line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ02',
              it_pa9004-begda = '20080318' , it_pa9004-endda = '99991231'
              it_pa9004-zzvalue = 80 (customer field)
    i run the programme and get information is:
    11022887 insert ok.
    the three scenario is:
        set  HR_INFOTYPE_OPERATION of import parameter operation = 'MOD'
        in any scenario will get error :not exist subtype .
    what heppend about HR_INFOTYPE_OPERATION working,i had to use this function to
       create other infotype of SAP owner.
       and will create successfully.
    so i thank it may be config Constraints about customer infotype.
    is time Constraints effect?
    so i want to how to check it?
    and if i want to create one infotype for customer using PM01 what some thing
    must be taken into account.
    think you advance.
    partial source code as follow:
    FORM ACTION_INSERT .
      DATA: P_FLAG TYPE C.
      DATA: WA_LOG LIKE LINE OF DATA_LOG.
      DATA: PP_ACTION TYPE PSPAR-ACTIO.
      LOOP AT IT_PA9004.
        CLEAR P_FLAG.
        CALL FUNCTION 'HR_PSBUFFER_INITIALIZE'.
        PERFORM lock_employee USING IT_PA9004-pernr CHANGING P_FLAG.
        PP_ACTION = IT_PA9004-ACTION.
        PERFORM HR_INFOTYPE_OPERATION USING IT_PA9004 PP_ACTION CHANGING P_FLAG.
        IF P_FLAG IS INITIAL.
          if test_run = space.
            COMMIT WORK.
          else.
            ROLLBACK WORK.
          endif.
          write:/ it_pa9004-pernr,'insert ok'.
        ELSE.
          ROLLBACK WORK.
          write:/ it_pa9004-pernr,'error'.
        ENDIF.
        PERFORM unlock_employee USING IT_PA9004-pernr .
      ENDLOOP.
    ENDFORM.                    " ACTION_INSERT
    FORM LOCK_EMPLOYEE  USING    P_PERNR
                        CHANGING PP_FLAG.
      CHECK PP_FLAG IS INITIAL.
      CLEAR P_RETURN.
      CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
        EXPORTING
          number = P_PERNR
        IMPORTING
          return = P_RETURN
        EXCEPTIONS
          OTHERS = 01.
      CALL FUNCTION 'HR_INITIALIZE_BUFFER'
        EXPORTING
          pernr = P_PERNR.
      IF P_RETURN IS NOT INITIAL.
        PP_FLAG = '1'.
      ENDIF.
    ENDFORM.                    " LOCK_EMPLOYEE
    FORM HR_INFOTYPE_OPERATION  USING    P_PA9004 LIKE IT_PA9004
                                         P_ACTION type PSPAR-ACTIO
                                CHANGING PP_FLAG.
      CHECK PP_FLAG  IS INITIAL.
      DATA: bapipakey type bapipakey,
            P_SUBTY TYPE P9004-SUBTY,
            PP_9004 TYPE TABLE OF  P9004 WITH HEADER LINE.
      CLEAR P_RETURN.
      REFRESH PP_9004.
      MOVE-CORRESPONDING P_PA9004 TO PP_9004.
      IF P_ACTION = 'INS'.
        PP_9004-AEDTM = SY-DATUM.
        PP_9004-UNAME = SY-UNAME.
      ENDIF.
      IF P_ACTION = 'MOD'.
        PP_9004-AEDTM = SY-DATUM.
        PP_9004-UNAME = SY-UNAME.
      ENDIF.
      APPEND PP_9004.
      P_SUBTY = P_LGART.
      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
        EXPORTING
          infty         = '9004'
         subtype       = 'FQ03'
          subtype       = P_SUBTY
          number        = PP_9004-pernr
          validityend   = PP_9004-ENDDA
          validitybegin = PP_9004-begda
         RECORDNUMBER  = pp_9004-seqnr
          record        = PP_9004
           operation     = 'INS'
         operation     = P_ACTION
          nocommit      = 'X'
        IMPORTING
          return        = P_RETURN
          key           = bapipakey
        EXCEPTIONS
          OTHERS        = 0.
      IF P_RETURN IS NOT INITIAL.
        PP_FLAG = '9'.
      ENDIF.
    ENDFORM.                    " HR_INFOTYPE_OPERATION
    FORM UNLOCK_EMPLOYEE  USING    P_PERNR.
      CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
        EXPORTING
          number = p_pernr
        IMPORTING
          return = P_RETURN
        EXCEPTIONS
          OTHERS = 01.
    ENDFORM.                    " UNLOCK_EMPLOYEE

    hi
    i want to create infotype use function(HR_INFOTYPE_OPERATION).
    this infotype is customer infotype.
    the first scenario is:
      i'm be sure no data about one employee in this infotype(9004).
      to call with data upload function and put data into internal table IT_PA9004.
      and the table data as follow:
    one line: it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
              it_pa9004-begda = '20080201' , it_pa9004-endda = '20080930'
              it_pa9004-zzvalue = 50 (customer field).
    two line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
              it_pa9004-begda = '20080201' , it_pa9004-endda = '20080930'
              it_pa9004-zzvalue = 60 (customer field).
    three line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
              it_pa9004-begda = '20080101' , it_pa9004-endda = '20081031'
              it_pa9004-zzvalue = 70 (customer field).
    four line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
              it_pa9004-begda = '20080101' , it_pa9004-endda = '20081031'
              it_pa9004-zzvalue = 80 (customer field).
    i run the programme and get information is:
    11022887 insert ok.
    11022887 insert ok.
    11022887 insert ok.
    11022887 insert ok.
    but i use the transation PA30 to view all data:
    in database just exist one row:
    four line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
              it_pa9004-begda = '20080101' , it_pa9004-endda = '20081031'
              it_pa9004-zzvalue = 80 (customer field).
    the second scenario is:
    in database the infotype have exist one row:
               pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ02',
               pa9004-begda = '20080318' , pa9004-endda = '20080318'
               pa9004-zzvalue = X (customer field).
    and i create another row:
    line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ02',
              it_pa9004-begda = '20080318' , it_pa9004-endda = '99991231'
              it_pa9004-zzvalue = 80 (customer field)
    i run the programme and get information is:
    11022887 insert ok.
    but in database just exist the first data
               pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ02',
               pa9004-begda = '20080318' , pa9004-endda = '20080318'
               pa9004-zzvalue = X (customer field).
    the three scenario is:
        set  HR_INFOTYPE_OPERATION of import parameter operation = 'MOD'
        in any scenario will get error :not exist subtype .
    what heppend about HR_INFOTYPE_OPERATION working,i had to use this function to
       create other infotype of SAP owner.
       and will create successfully.
    so i thank it may be config Constraints about customer infotype.
    is time Constraints effect?
    so i want to how to check it?
    and if i want to create one infotype for customer using PM01 what some thing
    must be taken into account.
    think you advance.
    partial source code as follow:
    FORM ACTION_INSERT .
      DATA: P_FLAG TYPE C.
      DATA: WA_LOG LIKE LINE OF DATA_LOG.
      DATA: PP_ACTION TYPE PSPAR-ACTIO.
      LOOP AT IT_PA9004.
        CLEAR P_FLAG.
        CALL FUNCTION 'HR_PSBUFFER_INITIALIZE'.
        PERFORM lock_employee USING IT_PA9004-pernr CHANGING P_FLAG.
        PP_ACTION = IT_PA9004-ACTION.
        PERFORM HR_INFOTYPE_OPERATION USING IT_PA9004 PP_ACTION CHANGING P_FLAG.
        IF P_FLAG IS INITIAL.
          if test_run = space.
            COMMIT WORK.
          else.
            ROLLBACK WORK.
          endif.
          write:/ it_pa9004-pernr,'insert ok'.
        ELSE.
          ROLLBACK WORK.
          write:/ it_pa9004-pernr,'error'.
        ENDIF.
        PERFORM unlock_employee USING IT_PA9004-pernr .
      ENDLOOP.
    ENDFORM.                    " ACTION_INSERT
    FORM LOCK_EMPLOYEE  USING    P_PERNR
                        CHANGING PP_FLAG.
      CHECK PP_FLAG IS INITIAL.
      CLEAR P_RETURN.
      CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
        EXPORTING
          number = P_PERNR
        IMPORTING
          return = P_RETURN
        EXCEPTIONS
          OTHERS = 01.
      CALL FUNCTION 'HR_INITIALIZE_BUFFER'
        EXPORTING
          pernr = P_PERNR.
      IF P_RETURN IS NOT INITIAL.
        PP_FLAG = '1'.
      ENDIF.
    ENDFORM.                    " LOCK_EMPLOYEE
    FORM HR_INFOTYPE_OPERATION  USING    P_PA9004 LIKE IT_PA9004
                                         P_ACTION type PSPAR-ACTIO
                                CHANGING PP_FLAG.
      CHECK PP_FLAG  IS INITIAL.
      DATA: bapipakey type bapipakey,
            P_SUBTY TYPE P9004-SUBTY,
            PP_9004 TYPE TABLE OF  P9004 WITH HEADER LINE.
      CLEAR P_RETURN.
      REFRESH PP_9004.
      MOVE-CORRESPONDING P_PA9004 TO PP_9004.
      IF P_ACTION = 'INS'.
        PP_9004-AEDTM = SY-DATUM.
        PP_9004-UNAME = SY-UNAME.
      ENDIF.
      IF P_ACTION = 'MOD'.
        PP_9004-AEDTM = SY-DATUM.
        PP_9004-UNAME = SY-UNAME.
      ENDIF.
      APPEND PP_9004.
      P_SUBTY = P_LGART.
      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
        EXPORTING
          infty         = '9004'
         subtype       = 'FQ03'
          subtype       = P_SUBTY
          number        = PP_9004-pernr
          validityend   = PP_9004-ENDDA
          validitybegin = PP_9004-begda
         RECORDNUMBER  = pp_9004-seqnr
          record        = PP_9004
           operation     = 'INS'
         operation     = P_ACTION
          nocommit      = 'X'
        IMPORTING
          return        = P_RETURN
          key           = bapipakey
        EXCEPTIONS
          OTHERS        = 0.
      IF P_RETURN IS NOT INITIAL.
        PP_FLAG = '9'.
      ENDIF.
    ENDFORM.                    " HR_INFOTYPE_OPERATION
    FORM UNLOCK_EMPLOYEE  USING    P_PERNR.
      CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
        EXPORTING
          number = p_pernr
        IMPORTING
          return = P_RETURN
        EXCEPTIONS
          OTHERS = 01.
    ENDFORM.                    " UNLOCK_EMPLOYEE

  • Is it possible to change the UNAME using the FM 'HR_INFOTYPE_OPERATION'..??

    Hi folks,
    I'm trying to bring an infotype record from a SAP Server 'A' to a SAP Server 'B'. The users want an 'Z' application to do it.
    I thought to use the HR_INFOTYPE_OPERATION to INS (insert) or MOD (modify) the record, getting the data from A and put it on B.
    The problem is that the users want to continue keeping the UNAME and AEDTM as in the original record. It means, do not change the record. For Example:
    CURRENT SCENARIO
    SERVER A                       
    UNAME: USER_A        
    AEDTM: July 03, 2010
    SERVER B: Data inserted or modified using the FM 'HR_INFOTYPE_OPERATION'
    UNAME: USER_B
    AEDTM: Jan 24, 2012
    WANTED SCENARIO
    SERVER A                       
    UNAME: USER_A        
    AEDTM: July 03, 2010
    SERVER B: Data inserted or modified using the FM 'HR_INFOTYPE_OPERATION'
    UNAME: USER_A
    AEDTM: July 03, 2010
    Does anybody know if it is possible using the FM 'HR_INFOTYPE_OPERATION'...?
    or
    Does anybody know what's the best way to do that?
    Thanks and best regards friends...

    The issue is fixed after changing the cable connected with e1000g3.

  • 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.

  • HR_INFOTYPE_OPERATION not working when called from Dynamic action

    Hi ,
           Senario  : I would like to execute a form from dynamic action which
    creates a record in 0015 (Additional payment IT) .
           I have writen the code as shown below am using FM HR_INFOTYPE_OPERATION
    . When i execute the program from se38 it is creating a record, however it is
    not created when it is called from dynamic action..when i debugged the code in
    inside the FM HR_INFOTYPE_OPERATION there is a FM HR_MAINTAIN_MASTERDATA where
    they are using call dialog (statement) and
    sy-oncom = 'N'   when called from Dynamic action and
    sy-oncom = 'S'   when called executed directly.
    I tried to change the sy-oncom to S while run from Dynamic action it created
    the record.
    So Can anyone explain me abt sy-oncom and how can i resolve the issue..
    code..
    REPORT ZHRPYENH01 .
    perFORM TERMIATION_9000.
    INCLUDE DBPNPMAC.
          FORM Termiation_9000                                          *
    FORM TERMIATION_9000.
    INFOTYPES : 0015.
    *data : i .
    *i ='c'.
    *break-point.
    *message i000(000) with i.
      TABLES : PRELP.
      DATA : P9000 TYPE PA9000." with header line.
      DATA : P0000 TYPE STANDARD TABLE OF  P0000 WITH HEADER LINE.
    DATA : P0015 TYPE STANDARD TABLE OF  P0015 WITH HEADER LINE.
      DATA : HIRE_DATE  LIKE SY-DATUM,
             TERM_DATE  LIKE SY-DATUM.
      DATA : MOLGA LIKE T500L-MOLGA VALUE '25',
             SEQNR LIKE PC261-SEQNR.
      DATA : RGDIR TYPE STANDARD TABLE OF PC261 WITH HEADER LINE.
      DATA : ACTUAL_PERIOD LIKE PA9000-RETENTION.
      DATA : PNP-SW-FOUND TYPE SY-SUBRC ,
             PNP-SY-TABIX TYPE SY-TABIX.
      DATA : TER_PERNR LIKE PA0001-PERNR.
      DATA : REF_PERNR LIKE PA0001-PERNR.
      data : key type BAPIPAKEY.
      data : payed_amount type p0015-BETRG.
    data : future_payment_amount type p0015-BETRG.
    data : p0002 like pa0002.
      types : begin of t_deduction ,
              deducation_date like p0015-begda,
              future_payment_amount type p0015-BETRG.
      types : end of t_deduction.
    data :  future_deduction type standard table of t_deduction with
    *header line.
      data :  future_deduction type  t_deduction .
    data : RETURN type  BAPIRETURN1.
    *data : deduction_p0015 like standard table of p0015 with header line.
    data : deduction_p0015 like p0015 .
    xxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxx
    ****Prepare 0015 data for deduction
    *deduction for payed amount
    clear deduction_p0015.
    *refresh deduction_p0015.
    deduction_p0015-pernr = REF_PERNR.
    *deduction_p0015-pernr = TER_PERNR.
    deduction_p0015-lgart = 'M120'.
    deduction_p0015-begda = sy-datum + 1 .
    deduction_p0015-endda = sy-datum + 1 .
    deduction_p0015-BETRG = payed_amount.
    deduction_p0015-WAERS = 'SGD'.
    deduction_p0015-ZUORD =  TER_PERNR.
    *append deduction_p0015.
    **deduction for future payment amount
    *loop at future_deduction.
    *clear deduction_p0015.
    *deduction_p0015-pernr = REF_PERNR.
    **deduction_p0015-pernr = TER_PERNR.
    *deduction_p0015-lgart = 'M120'.
    *deduction_p0015-begda = FUTURE_DEDUCTION-DEDUCATION_DATE.
    *deduction_p0015-endda = FUTURE_DEDUCTION-DEDUCATION_DATE.
    *deduction_p0015-BETRG = future_deduction-future_payment_amount.
    *deduction_p0015-WAERS = 'SGD'.
    *deduction_p0015-ZUORD =  TER_PERNR.
    *append deduction_p0015.
    *endloop.
    Create a deduction wage type in 0015 for the employee
    break-point.
    CLEAR RETURN.
    CALL FUNCTION 'BAPI_EMPLOYEET_ENQUEUE'
      EXPORTING
        NUMBER              = REF_PERNR
        VALIDITYBEGIN       = '18000101'
    IMPORTING
       RETURN              = return
    if not return is initial.
    message E000(000) with
    'Referred Employee could not be locked for referal  payment deducation,
    please try after some time'.
    endif.
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
      EXPORTING
        INFTY                  = '0015'
        NUMBER                 = REF_PERNR
       SUBTYPE                = 'M120'
      OBJECTID               =
      LOCKINDICATOR          =
       VALIDITYEND            = SY-DATUM
       VALIDITYBEGIN          = SY-DATUM
      RECORDNUMBER           =
        RECORD                 = deduction_p0015
        OPERATION              = 'COPY'
      TCLAS                  = 'A'
       DIALOG_MODE            = '2'
      NOCOMMIT               =
      VIEW_IDENTIFIER        =
      SECONDARY_RECORD       =
    IMPORTING
       RETURN                 = return
       KEY                    = key
    break-point.
    COMMIT WORK.
    if not return is initial.
    *return-TYPE
    *ID
    *NUMBER
    *MESSAGE
    message I000(000) with return-MESSAGE.
    endif.
    CALL FUNCTION 'BAPI_EMPLOYEET_DEQUEUE'
      EXPORTING
        NUMBER              = REF_PERNR
        VALIDITYBEGIN       = '18000101'
    IMPORTING
       RETURN              = return
    xxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxx
    Thanks and regards
    -Senthil Bala
    Message was edited by: senthil bala

    Hi Senthil
    Why at all U want a subroutine to create a record in IT0015 through Dynamic action.There are some standard codes available to update infotypes.
    Let me give U an example
    14     9CON     BETRG     4     2     I     INS,0015 This will create a record in IT0015 when IT0014 is updated with Wagetype 9CON
    14     9CON     BETRG     4     3     W     P0015-LGART='5400' Set wagetype for IT0015(Here U can use a subroutine call to set the wagetype)
    14     9CON     BETRG     4     4     W     P0015-BETRG=P0014-BETRG set amount for IT0015(Here U can use a subroutine call to get the amount)
    14     9CON     BETRG     4     5     W     P0015-BEGDA=P0014-ENDDA set the dates(Here U can use a subroutine call to set the dates)
    Hope this will help U.
    Please award points if helpful

Maybe you are looking for

  • Error Occured in CRM_ORDER_MAINTAIN . Kindly help asap.

    I have written folowing code but exception occurs in changing parameter lt_exception of FM maintain.What can be the possible error. msg no - 0004 REPORT  ZTEST_PROGRAM. *Internal tables Data : lt_partner           TYPE              crmt_partner_comt,

  • How can i open my iBook on my Mac, not just on my iPhone

    Hi, how can i open my iBook on my Mac, not just on my iPhone?  I ask this questions in hopes that I can eventually find a way to have the iPhone read a non "Enhanced" iBook to me. I used the Accessibility reader for a brief time but it's very persini

  • Initiate a dial-up connection or detect whether I am connected to the net

    I want to initiate a dial-up connection from my java program and also to detect whether I am connected to the internet or not.

  • DLL for LOB operations

    Hi I am trying to use the createTemporary() method provided by the Oracle OCI Driver to insert a BLOB into the database. I have the oracle client installed in my PC. While executing the above said method an "UnsatisfiedLinkError" is reported. It says

  • Image adjustment question

    Hi there, I am using PS CS3 and am probably an advanced beginner user. I have an image that is washed out...Overexposed? I would like to emphasize the two buildings, the tree trunk and the white flowers in front. Here is my original image: Steps that