HR_INFOTYPE_OPERATION in WD4A

Hi all,
My requirement is to update or create a new record in custom infotype.For that I'm using the function module HR_INFOTYPE_OPERATION in the eventhandler for SAVE button in the view .but when I click the button SAVE, the infotype is not getting updated.But if I write an SQL update statement, it's working.But I want to use the function module.When I used the Function module in a report program,just to test it, by passing the same parameters, the Function module is working correctly.Also no messages are coming into the return parameter. I want to know if we can't use the function module in the Webdynpro.If so what's the solution to my problem

Hi,
Before we update any record then we need to explicitly sue the FM reated to Locks.
In SE37 check the related FM
or try this
CALL FUNCTION 'ENQUEUE_EPPRELE' " lock
CALL FUNCTION 'HR_INFOTYPE_OPERATION' " Make changes
CALL FUNCTION 'DEQUEUE_EPPRELE' " Remove lock
Regards
Lekha.

Similar Messages

  • 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

  • Popup instead of list when using WD4A ALV Grid Drop Down By Key

    I am develop a WD4A application and I am using an ALV grid.  I have set the cell editor for one column wiht the following code:
    CREATE OBJECT lr_ddbk
        EXPORTING
          SELECTED_KEY_FIELDNAME = 'ZCURRENCY'.
      Data: lv_key_visable TYPE abap_bool,
            lv_key_visible_fieldname TYPE string.
       lr_ddbk->set_type( if_salv_wd_c_uie_drdn_by_index=>type_key_value ).
    *  lv_key_visable = lr_ddbk->GET_KEY_VISIBLE( ).
    *  lv_key_visible_fieldname = lr_ddbk->GET_KEY_VISIBLE_FIELDNAME( ).
    *  lr_ddbk->SET_KEY_VISIBLE( abap_false ).
      lr_alv_column->SET_CELL_EDITOR( lr_ddbk ).
    This code works fine.  I then fill the drop down with the following code:
    *...Build the currency drop down list
      DATA lv_default_currency TYPE wdr_context_attr_value.
      DATA lv_currency_count TYPE STRING.
      DATA ls_tcurt TYPE tcurt.
      CLEAR ls_contextvalue_set.
      CLEAR lt_contextvalue_set. REFRESH lt_contextvalue_set.
      CLEAR lv_default_currency.
      loop at it_ac_attr into ls_ac_attr.
        if ls_ac_attr-attr_id eq 'CUR'.
          select single * from tcurt into ls_tcurt
               Where spras = 'EN' AND
                     waers = ls_ac_attr-value.
          If sy-subrc = 0.
            ls_contextvalue_set-value = ls_ac_attr-value.
         ls_contextvalue_set-value = ls_ac_attr-value.
            ls_contextvalue_set-text = ls_tcurt-ktext.
            IF ls_ac_attr-DFT_FLAG = 'X'.
              lv_default_currency = ls_contextvalue_set.
            ENDIF.
            append ls_contextvalue_set to lt_contextvalue_set.
          endif.
        Endif.
      endloop.
      lo_nd_zebuy_describe_item_info = lo_nd_zebuy_describe_item->get_node_info( ).
      lo_nd_zebuy_describe_item_info->set_attribute_value_set(
                                    exporting
                                       name = 'ZCURRENCY'
                                      value_set = lt_contextvalue_set ).
    *...End build currency drop down list
    This code works fine.  The issue I am having is that the drop down is behaving like a search help field rather than a drop down list.  Meaning a popup comes when I drop down the list.  The popup has the values I have set.  I don't want a popup I want a drop down list.  Additionallly the field is editable (meaning I can type a value into the field as well as select a value).  I want the user to only be able to select values from the list.  Any help with this issue would be appreciated.

    I fugured out what I was doing wrong.  I was setting the cell editor to cl_salv_wd_uie_input_field later in the code by mistake.

  • How to call a WD4A Application of another system

    Hi,
    I have the need to call a WebDynpro Application of another system via a URL call, thet the application should be opend in the CRM WebUI Window (statefull ) .
    Calling the application via a button event & transaction launcher works fine, but i need to call it from a BSP page. So my idea was to create an iframe, but this obviously opens a new window:
    <html>
      <head>
        <title>IFrames - Webdynpro Test</title>
      </head>
      <body>
        <iframe src=<%= lv_url_route %>"
          width="100%" height="500" scrolling="auto" frameborder="1" transparency>
              </iframe>
      </body>
    <html>
    Can anybody help?!?!
    Thanx & best regards,
    Oliver
    Edited by: Oliver Pregler on Jul 28, 2008 3:26 PM

    Hi Oliver,
    unfortunately I know nothing about BSP-Applications, but this is how I call my WD4A-Application using a FM from CRM:
    data: lr_empty_parent type ref to cl_gui_container,
          lr_viewer       type ref to cl_gui_html_viewer.
    data: lv_url(200)     type c.
    lv_url = 'http://www.xyz.com'.
      create object lr_viewer
        exporting
          parent             = lr_empty_parent
        exceptions
          cntl_error         = 1
          cntl_install_error = 2
          dp_install_error   = 3
          dp_error           = 4
          others             = 5.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                  with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
      lr_viewer->detach_url_in_browser(
        exporting
          url              = lv_url
        exceptions
          cntl_error       = 1
          dp_error_general = 2
          others           = 3 ).
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                   with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
      cl_gui_cfw=>flush( ).
    If it helps you - fine. If not - forget it
    Best regards
    Jörg Racz

  • Regarding HR_INFOTYPE_OPERATION fm submiting VIA JOB

    Hello Experts,
      I am submitting a program VIA job, in side my submit program i m using this FM HR_INFOTYPE_OPERATION, but this function module not updating any values.
    when i goto the job and tryed debug the job that time  the values are updating.
    is this FM will work only in fore ground.
    and also we i have passed the dialog_mode parameter as "1" also.
    any inputs...
    Thanks,
    Suresh

    see this:
    tables: pa0105.
    infotypes: 0105.
    DATA : I_RETURN TYPE BAPIRETURN1,
           I_KEY TYPE BAPIPAKEY,
           PERNR TYPE P0001-PERNR,
           I_P0105 TYPE TABLE OF P0105 WITH HEADER LINE,
           ENDDA TYPE P0105-ENDDA,
           BEGDA TYPE P0105-BEGDA.
    MOVE '00000010' TO PERNR.
    BEGDA = SY-DATUM + 1.
    ENDDA = SY-DATUM + 1.
    i_p0105-pernr = PERNR.
    i_p0105-infty = '0105'.
    i_p0105-subty = '0002'.
    i_p0105-endda = ENDDA.
    i_p0105-begda = BEGDA.
    I_P0105-USRTY = '0002'.
    I_P0105-USRID = id.
    APPEND i_p0105.
    CALL FUNCTION 'DEQUEUE_ALL' .
    CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
      EXPORTING
        NUMBER = PERNR.
    IF SY-SUBRC = 0.
       WRITE 'Employee Locked Successfully'.
    ENDIF.
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
      EXPORTING
        INFTY         = '0105'
        NUMBER        = PERNR
        SUBTYPE       = '0002'
        VALIDITYEND   = BEGDA
        VALIDITYBEGIN = ENDDA
        RECORD        = i_p0105
        OPERATION     = 'INS'
        TCLAS         = 'A'
        DIALOG_MODE   = '0'
        NOCOMMIT      = 'X'
      IMPORTING
        RETURN        = I_RETURN
        KEY           = I_KEY.
    IF SY-SUBRC = 0.
       WRITE : 'FM returns sy-subrc 0'.
    ENDIF.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'.
    Edited by: pratyush v on Feb 19, 2009 11:31 AM
    Edited by: pratyush v on Feb 19, 2009 11:31 AM

  • Modify "standard view" settings for an ALV in a WD4A view

    Hi fellow developers
    I have placed an ALV on  WD4A view.
    In the WDMODIFYVIEW I try to manipulate the ALV settings but somehow the settings of the "standard view" overrule my commands.
    The settings of the "standard view" are not modifiable from within the function.
    Is there a possbility to change the settings of this "standard view" that is being used for this ALV?
    Kind regards
    Wouter Heuvelmans
    Pyramid Applied Solution

    Execute your application in administration mode, afterwards you can change the settings using settings link of the ALV and save the same as part of "Standard View". If you want settings only for a user then ask user create a view of there own and set the same as default view.
    Even if you maniuplate ALV Layout settings ( other then Initial settings set during ALV call ) the same will be overruled by the default view set in the ALV i.e. Initial settings. 
    Regards
    Rohit Chowdhary

  • HR_INFOTYPE_OPERATION is not working in user exit ZXPADU02

    Hi frndz,
      i want to delimit/modify record in infotype 0014 after checking some condition when user clicks on SAVE in infotype 0008.
    For this i'm using the code like below.
    In Include ZXPADU02.
    when '0008'.
    IF sy-ucomm = 'UPD'.
    chek <condition>
    if sysubrc = 0.
    Lock employee.
    Delimti(LIS9) record in IT0014 using HR_READ_INFOTYPE_OPERATION.
    Unlock employee.
    endif.
    Here every thing working fine but record is not getting delimitted.
    Could anybody please help me any other possibilities to solve it.
    Thanks and Regards,
    Venkat

    Hi,
    I tried to use the FM HR_INFOTYPE_OPERATION in ZXPADU02 but I found that it will
    not update data in the real DB table(PAXXXX).I found that in FM 'HR_MAINTAIN_MASTERDATA' from FM 'HR_INFOTYPE_OPERATION' will set the field 'PSPAR-PBPFL' as 'X'.
    In standard program, it looks like if this field is set it will not do the logic to update the DB table. So I put the code in other report and then call in the ZXPADU02. I think it's about LUW.
    Code as follows to understand.
    data:
          lw_p0008      LIKE p0008,
          lw_pskey      LIKE pskey,
          lv_option,
              EXPORT lw_p0008 lw_pskey lv_option
                to memory id 'ZXPADU02_0008'.
              submit ZHRR_PA_ZXPADU02_0008
                     and return.
    Inside program ZHRR_PA_ZXPADU02_0008
    IMPORT w_p0008 lw_pskey lv_option
        FROM MEMORY ID 'ZXPADU02_0008'.
      CALL FUNCTION 'ENQUEUE_EPPRELE'
            EXPORTING
              pernr          = lw_p0008-pernr
            EXCEPTIONS
              foreign_lock   = 1
              system_failure = 2
              OTHERS         = 3.
      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
        EXPORTING
          infty                  = '0008'
          number                 = lw_p0008-pernr
          subtype                = lw_pskey-subty
          objectid               = lw_pskey-objps
          lockindicator          = lw_pskey-sprps
          validityend            = lw_pskey-endda
          validitybegin          = lw_pskey-begda
          recordnumber           = lw_pskey-seqnr
          record                 = lw_p0008
          operation              = lv_opera
    *      TCLAS                  = 'A'
    *      DIALOG_MODE            = '1'
    *      nocommit               = 'X'
    *     VIEW_IDENTIFIER        =
    *     SECONDARY_RECORD       =
        IMPORTING
          return                 = lw_return
    *      KEY                    =
      IF NOT lw_return IS INITIAL AND
         lw_return-type EQ 'E'.
        MESSAGE e000(38) WITH lw_return-message.
      ENDIF.
      CALL FUNCTION 'DEQUEUE_EPPRELE'
        EXPORTING
          pernr = lw_p0008-pernr.
    If this not works, then go for dynamic action from V_T588Z as suggested by Suresh.
    Regards
    Eswar

  • Problem with multiple calls to hr_infotype_operation in a loop

    Hi,
    Im using infotyp 2003 with the following situation. For a date, e.g. 2011/07/20 and a person_nr I have several time entries, like 08:00-09:00, 10:00-12:00, 15:00-17:00. Now I read the entries with  HR_READ_INFOTYPE and store them back unmodified with hr_infotype_operation in a loop in the same report.
    data: i_p2003 type standard table of p2003.
    CALL FUNCTION 'HR_READ_INFOTYPE'
             EXPORTING
    *          TCLAS                 = 'A'
               pernr                 = person_nr
               infty                 = '2003'
             BEGDA                 = '20110720'
              ENDDA                 = '20110720'
    *          BYPASS_BUFFER         = ' '
    *          LEGACY_MODE           = ' '
    *        IMPORTING
    *          SUBRC                 =
             tables
               infty_tab             =  i_p2003
            EXCEPTIONS
              INFTY_NOT_FOUND       = 1
              OTHERS                = 2.
    loop at i_p2003 assigning <p>.
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
            EXPORTING
              infty         = '2003'
              number       = person_nr
              validityend   = '20110720'
              validitybegin = '20110720'
              record        = <p>
              operation     = 'MOD'
              dialog_mode   = '0'
            IMPORTING
              return        = return_struct
              key           = personaldatakey
            EXCEPTIONS
              OTHERS        = 0.
    endloop.
    the first call to hr_infotype_operation succeeds but the following operations fail because of collision. This example is stupid, I know, but it shows the core of a problem I have in a more complex report.
    I face the problem that several calls to HR_INFOTYPE_OPERATION cause a collision error even if there cannot be a collision because the data are unchanged.
    Any hints on this.
    Regards,
    JOP

    Hi, you must execute a 'BAPI_EMPLOYEE_ENQUEUE' before 'HR_INFOTYPE_OPERATION' and a 'HR_EMPLOYEE_DEQUEUE' after.
    See next example:
    Bloqueo del empleado
    CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
      EXPORTING
        NUMBER = PERNR.
    IF SY-SUBRC IS INITIAL.
    Si se pudo bloquear el empleado intenta
    insertar el infotipo
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
      EXPORTING
        INFTY         = '2001'
        NUMBER        = P0001-PERNR
        SUBTYPE       = i_p2001-subty
        VALIDITYEND   = acdate
        VALIDITYBEGIN = acdate
        RECORD        = i_p2001
        RECORDNUMBER  = '000'
        OPERATION     = 'INS'
        TCLAS         = 'A'
        DIALOG_MODE   = '0'
        NOCOMMIT      = ' '
      IMPORTING
        RETURN        = I_RETURN
        KEY           = I_KEY.
    IF SY-SUBRC IS INITIAL.
      VARGT = 'Y'.
    ELSE.
      VARGT = 'N'.
    ENDIF.
    No se hace COMMIT debido que el estandar lo realiza
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    Desbloqueo del empleado
    CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
    EXPORTING
    NUMBER = PERNR.
    Regards,
    Diego.

  • Error while modifying HR infotype PA0105 using HR_INFOTYPE_OPERATION

    Hello All,
    I am not able to modifying the infotype PA0105.
    Currently I am using the FM HR_INFOTYPE_OPERATION.
    But I am not able to modify the record.
    Has anyone faced any such situation...
    Please help..!!
    Useful pointers will be appreciated...
    Thanks & Regards,
    Tarun Gambhir

    Hope this helps you out...
          C_INS   LIKE PSPAR-ACTIO VALUE 'INS',
          W_000-PERNR = T_SAIDA-PERNR.
          W_000-INFTY = C_0000.
          W_000-ENDDA = C_DATA.
          W_000-BEGDA = T_PA0000-BEGDA.
          W_000-AEDTM = SY-DATUM.
          W_000-UNAME = SY-UNAME.
          W_000-MASSN = C_16.
          W_000-MASSG = S_MASSG-LOW.
          W_000-STAT1 = SPACE.
          W_000-STAT2 = C_3.
          W_000-STAT3 = C_1.
          W_PSPAR-PERNR = T_SAIDA-PERNR.
          W_PSPAR-INFTY = C_0000.
          W_PSPAR-PLANS = T_P0001-PLANS.
          W_PSPAR-WERKS = T_P0001-WERKS.
          W_PSPAR-PERSG = T_P0001-PERSG.
          W_PSPAR-PERSK = T_P0001-PERSK.
          CALL FUNCTION 'HR_INFOTYPE_OPERATION'
            EXPORTING
              INFTY            = C_0000
              NUMBER           = T_SAIDA-PERNR
              LOCKINDICATOR    = SPACE
              VALIDITYEND      = C_DATA
              VALIDITYBEGIN    = V_BASE
              RECORD           = W_000
              OPERATION        = C_INS
              SECONDARY_RECORD = W_PSPAR
            IMPORTING
              RETURN           = T_RET_FUNC                     "#EC *
              KEY              = T_KEY.                         "#EC *
    Greetings,
    Blag.

  • Runtime error while updating entries of infotype usin HR_INFOTYPE_OPERATION

    Hi,
    I uploading entries of customized infotype using HR_INFOTYPE_OPERATION function module.
    It is giving me run-time error as,
    ShrtText
        An exception that could not be caught occurred.
    What happened?
        The exception 'CX_HRPA_VIOLATED_PRECONDITION' was raised but was not caught at
         any stage in the
        call hierarchy.
        Since exceptions represent error situations, and since the system could
        not react adequately to this error, the current program,
         'CL_HRPA_INFOTYPE_FACTORY======CP', had to
        be terminated.

    Hi,
    Refer to this link..Re: CX_HRPA_VIOLATED_PRECONDITION using HR_INFOTYPE_OPERATION to insert rec

  • 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

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

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

  • Check with HR_MAINTAIN_MASTERDATA and HR_INFOTYPE_OPERATION

    Hello,
    I have two questions about these FMs :
    1) Is it possible to use 'CHK' action with the FM HR_MAINTAIN_MASTERDATA ?
    2) When I use the FM HR_INFOTYPE_OPERATION with action CHK no record is created, but after that, with action INS, the infotype record is created twice even if I use the instruction ROLLBACK WORK.
    How to clear the memory after the CHK action?
    Best regards,
    K.

    Hi Karim,
    <li>I believe that ACTION is the parameter which is being passed to HR_MAINTAIN_MASTERDATA and
    HR_INFOTYPE_OPERATION  function modules. IF you go and see referenced field domain values you will see  the following, But I can't see CHK value in the domain.
    COP     Copy
    DEL     Delete
    DIS     Display
    EDQ     Lock/unlock
    INS     Create
    LIS9     Delimit
    MOD     Change
    INSS     Create for Actions is not converted to Change
    Thanks
    Venkat.O

  • Mix of Parameters & Select Options in a Selection screen in WD4A

    Hi All.
    I just created my first selection screen in WD4A couple of days back.
    Now, we have to mix up some parameters and select-options just like in normal ABAP.
    But I could only find a way to insert a "Range" into the WD4A screens via "Create_Range_table".
    Supposing I have 2 select-options, then 2 parameters - i.e. no Pattern or range or intervals options (simple = option); then again 2 select-options.
    Can't we make a simple Parameter option in WD4A selection screen? I know we can make no_extension and no_intervals as true so that it does look like a parameter. But still user can enter a pattern search in it like a select-option.
    Hope my query is clear.
    Another question is : As far as I understood, we ALWAYS need a IT_RESULT table in the method ADD_SELECTION_FIELD. Then why is it not mandatory in the method? 
    Thanks in adv.

    Hi Aishi,
    In an early version of SelectOptions, the parameter it_result was mandatory. Some time later, a developer contacted me and showed me an example where it was benefitial to first create the field and to pass in the range table at a later point in his algorithm. This can be done by calling set_range_table_of_sel_field( ). Hence, the parameter has become optional. Of course, a range table needs to be specified before the page gets rendered.
    Best regards,
    Thomas

Maybe you are looking for

  • Problem in product configuration

    hi all, In B2B webshop we are facing the following problem    We added a configurable product into shopping basket     moved to the configuration page  of that product and entered parts and accepted the configuration   but after that the prices under

  • Reg : EXISTS function in OBIEE

    Hi all, I have a req where the condition for a column is as below select count(distinct shipment_header_id) from F_ERP_PO_RECEIPTS a where exists (select 'X' from F_ERP_PO_RECEIPTS_TRX b               where b.TRANSACTION_TYPE = 'RECEIVE'             

  • How can i figure out how many GB my old iphone is?

    I have an old iphone 4 on verizon. i lost the packaging and i already erased/deactivated it so i cant get onto it to find out. There is no serial number on the back of the iphone. Help please? Thank you n

  • MOSS 2007 Monthly Calendar view wont accept a single digit month

    If any of my users try to change the Month of the Monthly Calendar view, by clicking the arrows to the left of the current display month, they get a blank page. The url they are sent to is as follows: https://~/Lists/Calendar/calendar.aspx?CalendarDa

  • How to convert a result tree fragment to NodeSet

    Dear Guru-s: I encountered a problem during the BPEL development, as following: scenario: Position: Transformation Activity Requirement: I should establish a complex data transformation, which need to assign an element of process input schema to a No