HR_INFOTYPE_OPERATION ISSUE

hi
please give demo code about using HR_INFOTYPE_OPERATION for operation = 'LIS9' ,'COP'.
thank you advance!

Hi
hope this code will help you.
Pls reward if help.
try to make use of FM
'HR_INFOTYPE_OPERATION'
and see the sample code:-
https://www.sdn.sap.com/irj/sdn/wiki?path=/pages/viewpage.action&pageid=13160
REPORT YBDC_NEW_586
no standard page heading line-size 255.
data: begin of i_upload occurs 0,
pernr like pa0586-pernr,
bedda(10) type c,
ebdda(10) type c,
pin01 like pa0586-pin01,
pin02 like pa0586-pin01,
pin03 like pa0586-pin01,
pin04 like pa0586-pin01,
pin05 like pa0586-pin01,
pin06 like pa0586-pin01,
pin07 like pa0586-pin01,
pin08 like pa0586-pin01,
pin09 like pa0586-pin01,
pin11 like pa0586-pin01,
pin12 like pa0586-pin01,
pin13 like pa0586-pin01,
pin14 like pa0586-pin01,
pin16 like pa0586-pin01,
pin17 like pa0586-pin01,
pin18 like pa0586-pin01,
pin19 like pa0586-pin01,
pin20 like pa0586-pin01,
pin21 like pa0586-pin01,
pin22 like pa0586-pin01,
pin23 like pa0586-pin01,
pin24 like pa0586-pin01,
pin25 like pa0586-pin01,
ain01 like pa0586-ain01,
ain02 like pa0586-ain01,
ain03 like pa0586-ain01,
ain04 like pa0586-ain01,
ain05 like pa0586-ain01,
ain06 like pa0586-ain01,
ain07 like pa0586-ain01,
ain08 like pa0586-ain01,
ain09 like pa0586-ain01,
ain11 like pa0586-ain01,
ain12 like pa0586-ain01,
ain13 like pa0586-ain01,
ain14 like pa0586-ain01,
ain16 like pa0586-ain01,
ain17 like pa0586-ain01,
ain18 like pa0586-ain01,
ain19 like pa0586-ain01,
ain20 like pa0586-ain01,
ain21 like pa0586-ain01,
ain22 like pa0586-ain01,
ain23 like pa0586-ain01,
ain24 like pa0586-ain01,
ain25 like pa0586-ain01,
end of i_upload.
data: begin of p586 occurs 0,
icode like pa0586-itc01,
pinvt like pa0586-pin01,
ainvt like pa0586-ain01,
end of p586.
data: p0586 like p0586 ,
ia586 like pa0586 occurs 0 with header line,
return like bapireturn1,
pin_ainvt type pin_ainvt.
S E L E C T I O N - S C R E E N D E F I N I T I O N *
selection-screen begin of block b1 with frame title text-001.
parameters: p_file like rlgrap-filename obligatory,
p_begda like pa0586-begda obligatory,
p_endda like pa0586-endda obligatory.
selection-screen end of block b1.
E V E N T H A N D L I N G - B E G I N *
at selection-screen on value-request for p_file.
perform get_file using p_file.
START OF SELECTION - B E G I N *
start-of-selection.
data: lines like sy-index.
*Getting the file data.
perform upload using p_file.
loop at i_upload.
ia586-pernr = i_upload-pernr.
ia586-endda = p_endda.
ia586-begda = p_begda.
perform col_row.
perform do.
append ia586.
clear : ia586,p586.
refresh : p586.
endloop.
loop at ia586.
move-corresponding ia586 to p0586.
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = p0586-pernr.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0586'
NUMBER = p0586-pernr
LOCKINDICATOR = ''
VALIDITYEND = p0586-endda
VALIDITYBEGIN = p0586-begda
RECORD = p0586
OPERATION = 'INS' or MOD or DEL
NOCOMMIT = ''
tclas = 'A'
IMPORTING
RETURN = RETURN
EXCEPTIONS
OTHERS = 0.
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = p0586-pernr.
clear : p0586.
endloop.
*& Form GET_FILE
Show "Open File" dialog box on F4
-->P_W_FILE Name of the file selected by the user
form get_file using p_w_file.
call function 'KD_GET_FILENAME_ON_F4'
CHANGING
file_name = p_w_file
EXCEPTIONS
mask_too_long = 1
others = 2.
if sy-subrc ne 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform. "GET_FILE
*& Form UPLOAD
Upload the file into the internal table for processing
-->P_LOADFILE Name of file to upload
form upload using p_loadfile.
Read the file into the Internal Table
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = p_loadfile
filetype = 'DAT'
TABLES
data_tab = i_upload.
if sy-subrc ne 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform. "UPLOAD
FORM col_row .
if i_upload-ain01 is not initial or i_upload-pin01 is not initial.
p586-icode = '01'.
p586-pinvt = i_upload-pin01.
p586-ainvt = i_upload-ain01.
append p586.
clear p586.
endif.
if i_upload-ain02 is not initial or i_upload-pin02 is not initial.
p586-icode = '02'.
p586-pinvt = i_upload-pin02.
p586-ainvt = i_upload-ain02.
append p586.
clear p586.
endif.
if i_upload-ain03 is not initial or i_upload-pin03 is not initial.
p586-icode = '03'.
p586-pinvt = i_upload-pin03.

Similar Messages

  • HR ABAP: Issue with using 'nocommit' parameter on FM HR_INFOTYPE_OPERATION

    Issue with using nocommit parameter on FM HR_INFOTYPE_OPERATION:
    My client has a requirement to create the following 4 infotypes in sequence in a LUW, i.e either all are created or none is created.
    9045   (custom infotype)
    0045
    0078
    0015
    I tried to use the nocommit parameter on FM HR_INFOTYPE_OPERATION to insert the 4 infotypes
    in a nocoomit mode and then at the end I have issued
    'Commit Work', but to my surprise only I/T 0015 is created in the database and the first three (9045, 0045 and 0078) did not make it to database.
    I searched many threads on SDN but could not find a solution.
    Please let me know if there could be any solution to implement the LUW.
    YOur inputs will be appreciated.

    Hi ,
    i think u can also try with this FM HR_MAINTAIN_MASTERDATA , see its documentations.
    no commit works like a simulation mode , what u can do is  ,
    call FM for all Infotypes and collect all error msgs if any , then finally call FM for all infotypes again without passing nocommit work ( i.e space).
    regards
    prabhu

  • HR_INFOTYPE_OPERATION -- for PA0002 has issues

    HI All ,
    We  have a strage issue with  Inserting a record into PA0002  using the FM  "HR_INFOTYPE_OPERATION"
    We have added 2   " Z"  fields to PA0002  one is global id   and other is source id.
        While inserting all the values including both Z feilds are passing ,but the global id is  getting updated into PA0002.it is comming as blank where as source id is updating correctly.
    this is has been comming  since 5 days ,before it was working fine only.
    Do you have any clue regarding the same.
    Thanks
    CB

    Hello,
        I am not sure why this is happening. but you can do one thing. When your are running "HR_INFOTYPE_OPERATION" then you can set a break point to that and go to "HR_MAINTAIN_MASTERDATA" and set that dialogue module as 1. Then you can find value is going to screen or not. If passing but not updating DB then the problem might be in custom code for infotype itself.
    Thanks,
    Mrinmoy

  • 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

  • Unicode/OO issues with HR_INFOTYPE_OPERATION in separate LUW

    Hi,
    I've created a separate program that uses FM HR_INFOTYPE_OPERATION in order to allow infotype changes while still being in the PAI of a PA30 infotype operation. 
    Because I have so many requirements for infotype changes to be triggered from PA30 like this, I decided to make the program dynamic as opposed to defining individual versions per infotype required.
    I did this by basically putting the FM parameters as the selection screen entries, defining RECORD and SECONDARY_RECORD as strings NO-DISPLAY and then casting the PNNNN structure onto the string contents in the START-OF-SELECTION, like so:
    * Dynamic data object of unknown line type
      CONCATENATE 'P' p_infty INTO lv_pnnnn.
      CREATE DATA gdo_data1 TYPE (lv_pnnnn).
      ASSIGN gdo_data1->* TO <fs_record>.
      <fs_record> = p_record.
    This has worked for me until very recently for some reason.  Now when I submit the program, I get the error "ABAP/4 processor: UC_OBJECTS_NOT_CONVERTIBLE" in the job log at the point when I make the statement:
    <fs_record> = p_record.
    Where p_record is the string.
    In an unicode/OO environment, any idea on how I can submit a PNNNN structured record through the selection screen of a program  that will dynamically reapply it's structure before submitting to HR_INFOTYPE_OPERATION?
    More pointedly, it looks like I'm successfully transferring from PNNNN structure to string, but dumping when I try to transfer from string back to PNNNN structure.  How can I deal with char and num fields when transferring back to the structure without having to do it field by field?
    Many thanks
    null

    I need it to be enabled in this system so it's checked.  Thanks for the suggestion though.

  • Issue with function module HR_INFOTYPE_OPERATION in badi HRPAD00INFTY

    Hello All,
    I have a business scenario wherein, when user saves data for infotype 0002 from tcode PA30, i have create a new record for infotype 0105 by copying existing record and just changing the date.
    For the same I am using funtion module HR_INFOTYPE_OPERATION inside badi HRPAD00INFTY method AFTER_INPUT.
    When I am running the same function module in a independent program, its running fine. But when I run it inside the badi method, it runs with sy-subrc = 0 and no error, but later in the standard program MP000200,in pai module PRE_INPUT_CHECK, it tries to execute this statement     MOVE <namst> TO <subty> and gives dump, with runtime error MOVE_TO_LIT_NOTALLOWED_NODATA and saying that "Error at assignment: Overwritten protected field.".
    Have tried all the options of function module HR_INFOTYPE_OPERATION, but nothing is helping.
    Kindly let me know if any information on the same.
    Best Regards,
    Rahul Malani

    Have you checked what's in the Subtype field of table T777D for infotype 0002?
      IF t777d-namst ne space.                                  "QNOK025939
        MOVE <namst> TO <subty>.
      ENDIF.
    Usually this sentence won't be executed unless there is something in that field. Usually we don't have subtypes for IT0002.
    Also make sure that the infotype that gives the dump is 0002 and not 0105.
    Regards.

  • Error coming while modifying data in infotype through HR_INFOTYPE_OPERATION

    I have created a report which reads a excel file fom the system and then upload data in infotype 0077 through HR_INFOTYPE_OPERATION. In this report first I check if the record exists in IT0077 for a particular employee , if not then creates a new record with the input file data and if the records exists then I need to modify that record.
    But the problem is that on updation the function module HR_INFOTYPE_OPERATION always return an error that "Infotype doesnot exist", although its exists in the system.
    Why this error comes when once I excuted the report with a pernr number for creation and then I execute with teh same data to modify it, it gives an error in modification.

    iam not sure
    When we create we have to use INS in the code and when we modify we have to use Operation  MOD
    Since Dilek  our Techinical consultant  is there hope your issue is solved

  • HR_MAINTAIN_MASTERDATA issue with PA0171 defaults

    Greetings experts!
    I'm using HR_MAINTAIN_MASTERDATA to create a participant.  I'm running into trouble with PA0171.  The defaults are not correct and even if I hard-code values into the proposed-values table it ignores them.
    I thought I'd try just not sending over 171 at all and then, after HR_MAINTAIN_MASTERDATA finished, I'd use HR_INFOTYPE_OPERATION to create it.  Curiously, however, HR_MAINTAIN_MASTERDATA still tries to populate 171 even though I'm not sending it (I'm setting the DIALOG_MODE parameter to 2 so I can see each screen as it's processed).  Apparently, something else is "triggering" it.
    When I run PA40 the values are defaulted correctly so I must be doing something out of order, perhaps?  The best scenario would for 171 to be defaulted to the correct values automatically but I must be missing something for it to default to the wrong values.
    Any suggestions?
    Here's the order I'm sending in the proposed values:
    0000
    0001
    0002
    0006
    0105
    0008
    0041
    UPDATE
    Also, a colleague of mine discovered that in
    program MP017100
      screen 2000 (infotype 171)
        module p0171
          FM 'HR_BEN_GET_FROM_FEATURE_BAREA'
            subroutine sap_get_emp_barea_from_feature
              subroutine fill_pme30
    there is a call to "HR_READ_INFOTYPE" on line 1352 of "LHRBEN00FEATUREF01" and this always returns "8" meaning no records were found.  Puzzled, we looked at infotype 0000 with the pernr in SE11 and sure enough there's no data there.
    I thought changing to LUW_MODE param of HR_MAINTAIN_MASTERDATA to "0" might solve that issue but it doesn't seem to have any affect.
    Many thanks!
    Edited by: Steve King on Dec 30, 2008 10:09 PM

    Steve,
    The reason for incorrect default values in IT 0171 is, there is code in PBO module of MP017100 which defaults value from features BAREA, BENGR and BSTAT only if the mode is not batch.
    To make it work, you can mimic the code that exist in "module p0171 output" in PBAS0001 user exit to default values.
    regards
    Sridhar

  • 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

  • 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

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

  • Error in executing 'HR_INFOTYPE_OPERATION' from webdynpro application

    Hi Experts,
    I am using FM 'HR_INFOTYPE_OPERATION' for infotype PA0034 operations. I have written below code in assistant class.
    when i execute the class method and pass the parameters this FM executing fine and creates record into pa0034. But when i execute the webdynpro application it is giving error "Invalid parameter EXCEPTION , value ".  Please Help me in solving this issue
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
      EXPORTING
        INFTY                  = '0034'
        NUMBER                 = lv_pernr
        SUBTYPE                =  ls_p0034-subty
        OBJECTID               = ''
        LOCKINDICATOR          = ''
        VALIDITYEND            = ls_p0034-endda
        VALIDITYBEGIN          = ls_p0034-begda
      RECORDNUMBER           =
        RECORD                 = ls_p0034
        OPERATION              = 'INS'
        TCLAS                  = ' '
       DIALOG_MODE            = '0'
      NOCOMMIT               =
      VIEW_IDENTIFIER        =
      SECONDARY_RECORD       =
    IMPORTING
       RETURN                 = ls_return
      KEY                    =
    Thanks
    Vijay

    Hi Vijay,
    So you are passing the values from the screen. So you must have binded the screen fields with the attributes, just make sure that they are of the same type as the importing parameters of the FM
    Regards
    Arjun

  • Regarding the usage of HR_INFOTYPE_OPERATIONS function module in ECM badi i

    Hi All,
    We have requirement where we need to update the infotype 0015 while implementing the badi 'HRECM00_ACTIVATION'.
    To achieve this functionality we are calling the HR_INFOTYPE_OPERATION function module to update the infotype 15. But we are getting the runtime error.
    Can some one suggest how to solve this issue.
    Thanks & Regards,
    Sreelatha Gullapalli.

    thanx for ur reply...
    But i want to use Transmission Medium 5 only as i have the requirement to Send the data as an EMAIL or FAX depending on the Communication Method specified in the Partner Number.
    Actually SAP Help also explains the usage of this medium using the same requirement as mine... but then it never anywhere specified on how the Print Program will be...
    I also checked the standard output type CPAC used in Application V7 to which transmission medium 5 is assigned. And the print program assigned to this output type has no coding on sending the email using the FM. So i am very very confused.... I have seen few postings in this forum on this topic.. but not clear enuf to clarify my confusion...
    Kind Regards,
    Tanuja

  • HR_INFOTYPE_OPERATION - Need help w/Deleting infotype records

    Hello all,
    We have an issue where infotype records got created where the ENDDA is less than the BEGDA (ENDDA = 06/30/2006 and BEGDA = 07/01/2006).  We are trying to delete these using HR_INFOTYPE_OPERATION but we are getting message PG-009 (No data stored for 9001 in the selected period) returned in our tests. 
    BTW, 9001 is one of our customer infotypes. 
    I know I can remove these records using a direct SQL statement, but I would prefer to remove them more gracefully if possible.  Is there a way around this error?  I actually think function module HR_READ_INFOTYPE is raising the error.
    Any suggestions would be greatly appreciated.
    Thanks,
    Al

    You can check report RHRHDC00, I think it can help you with custom infotype too.
    Otherwise you might need to delete the records forcefully using DELETE statement, which is not suggested since all the  standard FM consider BEGDA and ENDDA and in your case they will always return blank.
    You can also check FM -
    HR_ECM_DELETE_INFOTYPE
    Regards,
    Amit
    Reward all helpful replies.

  • HR_INFOTYPE_OPERATION - IT0235

    Hello,
    My requirement is to create new 0235 infotype record. This is working when I am trying modify existing record.
    But not working when I am trying to create new record. Record is getting created with TYP01 /  FRM01 / EXP01 equal to 0 .
    w_p0235-pernr = '00000352'.
    w_p0235-INFTY = '0235'.
    w_p0235-SUBTY = 'FED'.
    w_p0235-TAURT = 'FED'.
    w_p0235-TYP01 = '02'.
    w_p0235-FRM01 = '0'.
    w_p0235-EXP01 = 'X'.
    w_p0235-TYP02 = '03'.
    w_p0235-FRM02 = '0'.
    w_p0235-EXP02 = 'X'.
    w_p0235-TYP03 = '04'.
    w_p0235-FRM03 = '0'.
    w_p0235-EXP03 = 'R'.
    w_p0235-begda = '20100101'.
    w_p0235-endda = '20101231'.
    l_begda = w_p0235-begda.
    l_endda = w_p0235-endda.
    data : g_return type BAPIRETURN1.
        CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
          EXPORTING
            number = '00000352'
          IMPORTING
            return = g_return.
       CALL FUNCTION 'HR_INFOTYPE_OPERATION'
              EXPORTING
                infty         = '0235'
                number        = '00000352'
                subtype       = 'FED'
                validityend   = l_endda
                validitybegin = l_begda
                record        = w_p0235
                operation     = 'INS'
                dialog_mode   =  '2'
                nocommit      = ' '
              IMPORTING
                return        = g_return.
    Pl help
    Edited by: vnair09 on Jul 21, 2010 3:17 PM

    Hi,
    Did you get your problem resolved? I am having the same issue here. Can you or any expert here could provide the solution?
    Thanks a lot.
    Jack

Maybe you are looking for

  • How to enter many receiving lines for one PO Line

    Hi, we are working in oracle applications 11i From Oracle Inventory Responsibility->Transactions->Receiving: Enter Purchase Order Number: Receipts Window: we have a line with item quantity of 100 (for example). I need to receive that item on many lin

  • Same album repeatedly updates when syncing with iPhone

    I have many many albums and tracks purchased via the iTunes store both through iTunes directly and via the iPhone. They all synchronise properly and are on iTunes eventually. There's one album, though, purchased via the iTunes app in June this year.

  • FPCJ with Security deposit error

    Hi I am getting the following information when i post cash receipt entry through FPCJ. 1. I posted security deposit request. 2. I tried to post incoming cash receipt for that request. I am getting following information. Company code  is not defined M

  • Unable to start the server Instance

    Hello!! I am using the JDeveloper(11g) IDE first time.I am reading the help provided with the IDE.Uptill now I know how to create an application.When I run the jsp file for first 2-3 times it runs well, but after that the error comes like "Failed to

  • I've got LR5.7 and Camera Raw 8.7 and my Fuji X-Pro 1 files are not recognized. How to make good ? Thank you

    I've got LR5.7 and Camera Raw 8.7 and my Fuji X-Pro 1 files are not recognized. How to make good ? Thank you