Append records to infotype 4002

I need to append records to infotype 4002,  I am using the HR_MAINTAIN_MASTERDATA fm and it is not updating.  I know you can't update records via PB40 but I'm doing this using abap.
Any help/ suggestion on whic function module will be able to do this
Thanx

Let me rephrase my question:  I want to delimit a record to infotype 4002 'Vacancy Assignment'.  I am using the following code.
  CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
    EXPORTING
      pernr              = a_num
      actio              = 'INS'
      tclas              = 'B'
      begda              = it_4002-begda
      endda              = it_4002-endda
      dialog_mode        = '0'
    IMPORTING
      return1            = return1
      hr_return          = hr_return
    TABLES
      proposed_values    = it_pprop[].
I can't use 'HR_INFOTYPE_OPERATION' FM as it works well for PA infotypes,  even if I set tclas to 'B' it gives a short dump.

Similar Messages

  • Problem while inserting a record to infotype 416

    Iam facing a problem while inserting a record to the infotype 416 for a personnel no using the FM 'HR_INFOTYPE_OPERATION'.I have created a FM to insert a record to the infotype 416.In that FM iam using the FM 'HR_INFOTYPE_OPERATION' to create a record for infotype 416.while executing  my FM the FM 'HR_INFOTYPE_OPERATION' is returning the return value 0.But when i check in PA30 for the infotype 416,there is no record created for that personnel no.Also in the table PA0416 the record is not get created.SO what might be the problem.can anyone please provide me help on this.
    I have attached the code of my FM for ur reference.
    FUNCTION Y_ESS_FL_ENCASH.
    DATA: G_COMPENSATION_AMOUNT LIKE PA0416-AMONT,
          G_RETURN TYPE BAPIRETURN1.
    DATA T_PA0416 LIKE P0416 OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'HR_READ_INFOTYPE'
        EXPORTING
           TCLAS                 = 'A'
           PERNR                 = '00000014'
           INFTY                 = '0416'
         BEGDA                 = sy-datum
         ENDDA                 =  sy-datum
           BYPASS_BUFFER         = 'X'
         LEGACY_MODE           = ' '
    IMPORTING
         SUBRC                 =
          TABLES
            INFTY_TAB             = T_PA0416
    EXCEPTIONS
      INFTY_NOT_FOUND       = 1
      OTHERS                = 2
        LOOP AT T_PA0416
        WHERE SUBTY = '1002'.
        ENDLOOP.
        IF SY-SUBRC <> 0.
          CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
            EXPORTING
               NUMBER = '00000014'
            IMPORTING
               RETURN = G_RETURN.
          IF SY-SUBRC <> 0.
             MESSAGE I016(RP) WITH ' RECORD IS ALREADY LOCKED'.
          ENDIF.
          T_PA0416-PERNR = '00000014'.
          T_PA0416-SUBTY = '1002'.
          T_PA0416-INFTY = '0416'.
          T_PA0416-OBJPS = ''.
          T_PA0416-SPRPS = ''.
          T_PA0416-SEQNR = ''.
          T_PA0416-AEDTM = SY-DATUM.
          T_PA0416-UNAME = SY-UNAME.
          T_PA0416-ENDDA = SY-DATUM.
          T_PA0416-BEGDA = SY-DATUM.
          T_PA0416-NUMBR = '10'.
          T_PA0416-WGTYP = '1530'.
          T_PA0416-AMONT = '15000'.
          T_PA0416-WAERS = 'INR'.
          T_PA0416-QUONR = '1'.
          APPEND T_PA0416.
          CALL FUNCTION 'HR_INFOTYPE_OPERATION'
            EXPORTING
              INFTY                  = '0416'
              NUMBER                 = '00000014'
              SUBTYPE                = '1002'
      OBJECTID               =
      LOCKINDICATOR          =
             VALIDITYEND            = '31129999'
             VALIDITYBEGIN          = SY-DATUM
            RECORDNUMBER           = ''
              RECORD                 = T_PA0416
              OPERATION              = 'INS'
              TCLAS                  = 'A'
      DIALOG_MODE            = '0'
            NOCOMMIT               = 'X'
      VIEW_IDENTIFIER        =
      SECONDARY_RECORD       =
            IMPORTING
              RETURN                 = G_RETURN.
      KEY                    =
          IF G_RETURN+0(1) EQ 'E'.
                  MESSAGE I086(ZHR) WITH 'Record is not inserted in IT416'.
          ELSE.
              COMMIT WORK.
          ENDIF.
          CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
            EXPORTING
              NUMBER = '00000014'
            IMPORTING
              RETURN = G_RETURN.
        ENDIF.
    ENDFUNCTION.

    Hi Murthy
    With a first glance, I think you have given a wrong parameter value to "validityend". It should be '99991231' not '31129999' .
    If your problem still persists, try inserting the data online from PA30. If your input causes no errors, then please state what the return parameter contains.
    Regards
    *--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

  • Insert record in infotype 0581 using function module

    Hello experts,
    I am using function module HR_INFOTYPE_OPERATION to insert a record in infotype 0581, but its giving exception CX_HRPA_INVALID_INFOTYPE. This infotype is time constraint 1.So how can i handle this.
    Reply will be really helpful <removed by moderator>.
    Edited by: S Harshit on Feb 17, 2012 6:49 AM
    Edited by: Thomas Zloch on Feb 17, 2012

    Hi Mallikarjuna,
    I am trying to pass the rent amount, but unable to, here is the code.
    TYPES: BEGIN OF IT_P0581.
    INCLUDE STRUCTURE P0581.
    TYPES END OF IT_P0581.
    DATA: INFTYKEY LIKE BAPIPAKEY,
    RETURN LIKE BAPIRETURN1.
    DATA: P0581_TAB TYPE TABLE OF IT_P0581 WITH HEADER LINE.
    P0581_TAB-PERNR = 01400038.
    P0581_TAB-INFTY = '0581'.
    P0581_TAB-BEGDA = '20111010'.
    P0581_TAB-ENDDA = '99991231'.
    P0581_TAB-RTAMT = 3000 .
    append P0581_TAB.
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
    EXPORTING
    INFTY = P0581_TAB-INFTY
    NUMBER = P0581_TAB-PERNR
    SUBTYPE = ''
    VALIDITYEND = P0581_TAB-ENDDA
    VALIDITYBEGIN = P0581_TAB-BEGDA
    RECORD = P0581_TAB
    OPERATION = 'INS'
    NOCOMMIT = ''
    RECORDNUMBER = '000'
    DIALOG_MODE = '2'
    IMPORTING
    RETURN = RETURN
    KEY = INFTYKEY
    EXCEPTIONS
    OTHERS = 0.

  • Any FM to delimit record of infotype 1017 ?

    Hi Experts.
    I want to delimit the record of infotype 1017 so is there any function module to do so?
    I can do that using BDC but the problem is that I want to delimit a particular "PD Profile" which is not getting feasible using BDC.
    Thanks in Advance

    Hi ,
    since the infotype 1017 is an Organization Management infotypes you need to use the RH_*  standard function modules.
    To delimit the infotype without a BDC program you have to can use the following sequence:
    1) move the IT 1017 row to delimit into a wor area of type P1017.
    2) append the work area of point 1 into a table of type P1017.
    3) Call the FM RH_DELETE_INFTYPE using the table of point 2 as parameter.
    4) modify the end date of the local work area in point 1)
    5) repeat the step 2 using an empty internal table
    6) Call the FM  RH_INSERT_INFTY using the table of point 5 as parameter.
    7) Call the RH_UPDATE_DATABASE.
    example
    DATA: lt_p1017 TYPE TABLE OF p1017, 
                         lw_p1017 type p1017.
                 * move your data into lw_p1017  
               APPEND lw_p1017  TO lt_p1017.
            CALL FUNCTION 'RH_DELETE_INFTY'
                   EXPORTING
              *   LOAD                      = 'X'
                  vtask                        = 'B'
              *   ORDER_FLG                 = 'X'
              *   COMMIT_FLG                = 'X'
             *   AUTHY                            = 'X'
             *   PPPAR_IMP                 =
            *   KEEP_LUPD                 =
             *   WORKF_ACTV             = 'X'
              TABLES
               innnn                         = lt_p1017
         *   ILFCODE                     =
             EXCEPTIONS              
               error_during_delete       = 1
               no_authorization          = 2
               delete_first_record       = 3
               corr_exit                 = 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.
       ELSE.
    hope it's helpfull,
    best regards luigi
    Edited by: luigi la motta on May 24, 2010 3:50 PM

  • How to append records in a file, through file adapter.

    Hi All,
    How to append records in a file, through file adapter.
    I have to read data from database and need to append all records in a file.
    Thanks in Advance.

    Hi,
    I think you have a while loop to hit the DB in your Process (As you said you have to fetch data from DB 10 times if 1000 rec are there)
    First sopy your DB O/P to one var
    and from second time append to previous data.(Otherwise you can directly use append from starting instead of copy and append)
    When loop completes you can transform to File adapter Var.
    Otherwise you can configure yourFileadapter such that it will aapend current records to previous records.
    You can use 'Append= true' in your file adapter wsdl.
    It will append previous records to current records in the same file.
    Regards
    PavanKumar.M

  • How to append records to a field symbols?

    Hi all,
    is there a way to append records from an internal table fto a field symbol of type table.

    Hi Daphne,
    Changing internal table to which field symbol is pointing will automatically change data accessed by field-symbol as it is only pointer to internal table..
    Regards,
    Mohaiyuddin..

  • How to append records in MSAccess through Java using JDBC:ODBC

    Hello,
    I was able to retrieve records from MSAccess database through JAVA over the JDBC-ODBC bridge.
    If I want to append records to a table (for eg. photo1 table containing photono., length, breadth, area as
    columns) I could not able to do so through JAVA.
    I am using JTable with the above fields. The user is displayed with the JTable and he has to enter
    data inside the JTable and press a button titled "Append". Then the JAVA program should append
    whatever the user has entered in the JTable as a single record inside the MSAccess database.
    Can anyone help me please?

    hi i too am having similar problem. i am able to create a table in ms access through java but when i insert values i get a msg that it has inserted the values but when i check the table by opening ms-access there are no values in the table.
    the insert statement i am using is
    " insert into tk1 values(3,'tarun')"
    further i tried using the methods commit, setAutoCommit etc with the connection object. -NO GO.
    can you help me ?

  • Fetching last but one record from Infotype

    Hello Everyone,
    Can you kindly let me know how to fetch the last but one records of IT0171 and IT0000, then compare the endda of both of the records.
    Thank you for your help.
    Regards,
    Vinod

    Hi,
    First sort your internal table by ENDDA descending.
    Then read index 2. This will give you the last but one record.
    INFOTYPES: 0171.
    CALL FUNCTION 'HR_READ_INFOTYPE'
      EXPORTING
        pernr           = '506'
        infty           = '0171'
        begda           = '18000101'
        endda           = '99991231'
      TABLES
        infty_tab       = p0171
      EXCEPTIONS
        infty_not_found = 1
        OTHERS          = 2.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ELSE.
      SORT p0171 BY ENDDA descending.
      READ TABLE p0171 INDEX 2.  ---> reads the previous record of the last entry.
      write:/ 'test'.
    ENDIF.
    Regards,
    Soumya.

  • Issue adding records to Infotype 0002

    Hi All,
    I am trying to insert records into Infotype 0002. I am using HR_INFOTYPE_OPERATION to do this. It works fine for all the employees but fot the ones who have Reference Personnel numbers. The system lets me to add the record to those employees through PA30 online or through BDC program with a warning message "No record with the same key for personnel number xxxxxxx",  but if I use the FM HR_INFOTYPE_OPERATION or HR_MAINTAIN_MASTERDATA, it sometimes gives me hard error message " The Social Insurance number already assigned to another employee" in the foreground and when executed in background I get a short dump with exception " CX_HRPA_INVALID_BUFFER_ACCESS".
    I debuged the standard code and the exception occurs in Include UP50RU02 in method IF_HRPA_MASTERDATA_BUFFER~INSERT.
    Short dump:
    The exception 'CX_HRPA_INVALID_BUFFER_ACCESS' was raised, but it was not caught
      anywhere along
    the call hierarchy.
    Since exceptions represent error situations and this error was not
    adequately responded to, the running ABAP program
      'CL_HRPA_MASTERDATA_BUFFER=====CP' has to be
    terminated.
    Please let me know if I am doing something wrong.
    Thanks,
    Danny.

    Hi Daniel,
    I would not worry about using FM 'HR_INFOTYPE_OPERATION' or 'HR_MAINTAIN_MASTERDATA' for the purpose of inserting PA infotype records for employees. I had developed a generic module last year to insert any PA infotype record which will use the standard PA business logic framework i.e. include all standard checks and validation, calls all Exits/BAdIs before inserting the record as it would when you are saving the infotype record via PA30. I basically created a wrapper FM to simplify the calling of some other standard FMs. Use it if you like (and if it works in your system keeping in mind config is different in every system) but please do handle all the Exceptions after the call (by reading the Message Handler Interface IF_HRPA_MESSAGE_HANDLER) to confirm there was no data inconsistency or other problems at the time of the update. Below is the sample code:
    The generic customer Function Module
    FUNCTION zpa_insert_any_infty_record.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(IS_PNNNN) TYPE  ANY
    *"     REFERENCE(IT_TEXT_TAB) TYPE  HRPAD_TEXT_TAB OPTIONAL
    *"     REFERENCE(IV_NO_AUTH_CHECK) TYPE  BOOLE_D DEFAULT SPACE
    *"     REFERENCE(IV_LOCK) TYPE  SPRPS DEFAULT TRUE
    *"  EXPORTING
    *"     REFERENCE(EIF_MESSAGE_HANDLER) TYPE REF TO
    *"        IF_HRPA_MESSAGE_HANDLER
    *"     REFERENCE(EV_OK) TYPE  BOOLE_D
    *"  EXCEPTIONS
    *"      EX_PERNR_LOCKED
    * FUNCTION...... ZPA_INSERT_ANY_INFTY_RECORD                           *
    * FUNCTION GROUP.ZPA_FG_EMP_LEAVE_BOOKING                              *
    * TITLE......... Insert any PA infotype record for an employee         *
    * AUTHOR........ Sougata Chatterjee                                    *
    * DATE WRITTEN.. 23/08/2010                                            *
    * SAP RELEASE... ECC 6.0                                               *
    * SPECIFICATION. N/A - Reuseable Object                                *
    * =====================================================================*
    * DESCRIPTION... This function is a generic module that will insert    *
    *                a PA infotype record into the employee master data as *
    *                per the import structure IS_PNNNN. This module wil be *
    *                particularly useful when requirement is to create     *
    *                other infotype records for the same employee within a *
    *                User-Exit or a BAdI.                                  *
    * ASSUMPTIONS... Infotype record to be updated is a PA Infotype.       *
    * =====================================================================*
    * MODIFICATION HISTORY                                                 *
    * Date       Userid       Change No & Description                      *
      DATA:
        lif_msg_handler  TYPE REF TO if_hrpa_message_handler,
        lo_msg_handler   TYPE REF TO cl_hrpa_message_list.
    * instantiate the message handler object
      CREATE OBJECT lo_msg_handler.
    * assign a reference to a rereference variable using the CAST operation
      lif_msg_handler ?= lo_msg_handler.
    * insert the infotype record into the employee master data
      PERFORM insert_infotype USING    is_pnnnn
                                       it_text_tab
                                       iv_no_auth_check
                                       iv_lock
                                       lif_msg_handler
                              CHANGING ev_ok.
    * pass back the message handler to the calling program if it was requested
      CHECK eif_message_handler IS REQUESTED.
      eif_message_handler = lif_msg_handler.
    ENDFUNCTION.
    For some reason I couldn't format the subroutine code here in SDN as it is scrambling the whole page but you could use the link here to find the [subroutine code|http://www.mediafire.com/file/9923qui7dm4xqpg/Form%20Insert_Infotype.html] and an [example code|http://www.mediafire.com/file/ihg83agkf0mbc9k/z_calling_program.html] for the program calling this FM including exception handling etc.
    Let me know if the links are not working...I'm happy to email them to you if you want.
    Hope this helps.
    Cheers,
    Sougata.

  • How to add record in infotype 82 and correspondingly to infotype 2001?

    Hi All,
    I need to create leaves. I can do it by using "HR_INFOTYPE_OPERATION" and create records in infotype 2001.
    But I also need to create corresponding records in infotype 0082.
    I have the leave types as stored in infotype 2001, like PCPI, PVCL etc.
    But I found that the SUBTY value stored in infty 2001 is different from that stored in infty 0082.
    How can I find the relation between these two SUBTY so that I can create the records in both infotypes.
    Please reply back if someone knows how to create the leaves in these 2 infotypes.

    Hi Ganesh,
    I could get the relation between the SUBTY in infty 2001 and infty 0082 from the table T554S.
    But I could not add the records to the two infotypes simultaneously. I am adding them one after another.

  • Creating new record in infotype during BADI

    Hi all,
    We want to use the BADI HRPAD00INFTY "Update / Infotype maintenance" for trigering an automatic creation of some infotype records using FM HR_INFOTYPE_OPERATION.
    The creation should only happen when a new record of infotype 2001 subtype GT01 is created.
    Every time when we try something we get an error on the first insert we do using the FM.
    The Enqueue goes fine (returns subrc = 0) but when doing the insert with the FM we get the error "EPG                  428A complex application error has occurred" in the return.
    We checked the data that we're passing thru the FM and there everything is fine.
    Is it possible that due to the lock of the original save is generating we can't insert anything else and how can we work around this problem?
    We also have this problem when using the user exit and we tried to do a submit to another report but there we can't even make the lock.
    Regards,
    Olivier

    Forum post in ABAP, General: Infotype reecord creation in a BAdI - Issue
    Infotype 0008 reecord creation in a BAdI - Issue
    Reward Points if useful.

  • Error in PA40: missing secondary record for infotype 0001

    Hi Experts,
    while changing the job code of employee i am getting below error in the PA40 transaction for IT0001 .
    Error : missing secondary record for infotype 0001 Key
    could you please tell me why this message is coming.
    Advance thanks,
    Regards
    Ram

    Hi,
    Please check out whether any user exits are maintained.
    Check ZXPADU01/ZXPADU02 includes.
    Please also check out whether there are dynamic actions configured for IT0000 and IT0001 via V_T588Z.
    Regards,
    Dilek
    Edited by: Dilek Ersoz Adak on Dec 16, 2009 3:19 PM

  • Delete Employee Records in Infotype 14

    Hi all,
    Is there any standard program that will delete records from infotype 14... Thanks a lot

    Hi Jim
    I do not know any programs for this but you can write your own utilizing the FM 'HR_INFOTYPE_OPERATION' with delete mode. For more details about the FM you can refer to Re: HR: creating IT "0015 - Additional Payments" item

  • How to upload records into Infotype 382(Awards)

    Hi,
      Could anyone suggest me how to upload records into infotype 382(Awards) of an Employee.
    For solutions points rewarded.
    Regards,
    Radhu

    Hi
    you can develop a <b>BDC</b> for transaction <b>PA30</b>
    using infotype 382.
    (or)
    can upload using batch input recording in <b>LSMW</b>.
    regards,
    Thangesh

  • Unable to Determine the Change Date and Time for records in infotype 2011

    Hi Everyone,
    We need to know on when the clock-in and clock-out records were interfaced to SAP in infotype 2011.
    The change date/time field in infotype 2011 is blank/not populated. Hence, we're unable to determine on when the clock-in records were updated in infotype 2011.
    It is not possible to get the audit logs for infotype 2011 as it is switched off.
    We found this table TEVEN and just the same thing, the field "change on" is blank.
    Kindly help us on how we can determine the change date and time for records in infotype 2011.

    Hi Prasad,
    Here's the scenario.
    On June 3, it was reported that staff's clock-in record on june 1, 7:00AM is missing in infotype 2011.
    However, when I checked infotype 2011, the record is there.
    So, they are now asking me on when this record was updated in infotype 2011 as they are thinking that there might be some delays in sending of the data to SAP.
    The created on and created at in table TEVEN shows the same, june 1, 7:00AM which seems to be not true as on june 3, it was reported to be missing.
    Can you help further on this?

Maybe you are looking for

  • Urgent help needed with Lucida Grande

    I have to use this font for a project, I can't get away with Lucida sans, it HAS to be Lucida Grande. I don't quite know what is going on but I have some text in Lucida Grande Regular which is all fine, I tried creating another text box but it's show

  • Dynamin VPN/GRE can't ping other side of tunnel

    I am new at this VPN stuff and tryiong to setup a GRE Dynamic IP VPN between my offfice and home.  Here is what I ahve done thus far: OFFICE interface Tunnel0 ip address 172.30.1.1 255.255.255.252 no ip redirects ip mtu 1400 ip nhrp map multicast dyn

  • Location of DW CS3 files on a Mac

    I am running Dreamweaver CS3 on a Mac Pro running OSX 10.4 Tiger. I am about to upgrade to 10.5 Leopard and I want to do a clean install of all my CS3 products. I will have a full backup of my HD and I want to copy all my preferences for CS3 software

  • Outlook 2013 not opening

    I am using MS Office 2013 Professional Plus in Windows 7 Ultimate. When I tried to open outlook 2013 today, it just stops at "loading profile" dialog and then continuously showing that dialog. And not opening outlook further. During 6/7 before it was

  • Creating Company A as a Vendor(XK01) in Company code B.

    Hi Experts Can you explain the process of creating Company A as a Vendor(XK01) in Company code B. I will surely assign points for the correct answer. Thanks Rajanikanth K