FM 'HR_INFOTYPE_OPERATION' & BADI 'HRPAD00INFTY'

Hello fellow Abapers. I am experiencing problems trying to implement the following.
We have a custom infotype (9127) that has 8 intervals of dates. We want to created an absence if any of these intervals are filled. So, after some research i have found this BADI 'HRPAD00INFTY' and specially the method 'IN_UPDATE'. This method is triggered after pushing the save button, so it's just what i needed. I have already the information i need (after converting prelp structure to pnnnn) and then i try to create a record in INFTY 2001 with FM 'HR_INFOTYPE_OPERATION'.
I have made a small report with this FM and it works just fine, i can create a record i PA2001 just fine, but in the implementation of the BADI it isn't working. I guess it might be something to do with 'locks', not really sure, so if anyone has a suggestion i'd appreciatiate it.
BTW, here is the code i am using :
        CALL FUNCTION 'HR_INFOTYPE_OPERATION'
        EXPORTING
          INFTY                  = '2001'
          NUMBER                 = wa_9127-pernr
          SUBTYPE                = 'L145'
    OBJECTID               =
    LOCKINDICATOR          =
          VALIDITYEND            = <fs2>
          VALIDITYBEGIN          = <fs1>
    RECORDNUMBER           = 0
          RECORD                 = rec2001
          OPERATION              = 'INS'
    TCLAS                  = 'A'
    DIALOG_MODE            = '0'
    NOCOMMIT               =
    VIEW_IDENTIFIER        =
    SECONDARY_RECORD       =
        IMPORTING
          RETURN                 = codret
    KEY                    =
Thanks in advance, Pedro Guarita.

In FM 'HR_INFOTYPE_OPERATION', commit work is executed after infortype was updated.  Infortype 9127 and corresponding BAdi belong to the same SAP LUW. So it leads to commit work has no effect in BAdi.
A common solution is to call u2018HR_INFOTYPE_OPERATION' by a submit program, this will trigger another LUW in a new work process to commit your data. The pain point for this solution is that you have to pass the data to your new program (always use memory).  Also guaranteeing the success is a little bit difficult .
Another solution is to call FM like this: CALL FUNCTION 'HR_INFOTYPE_OPERATION' DESTINATION 'NONE' in BAdi 'HRPAD00INFTY'. Help this will help u.
Regards,
Kevin

Similar Messages

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

  • BADI HRPAD00INFTY is not working in ESS

    Hi Gurus,
       I have a requirement for Infotype 0006 at the time of saving or updating or deleting the infotype record. I used BADI HRPAD00INFTY for this. It is working fine if we go through PA30 T-code.
      If I enter the records into infotype 0006 through ESS then this BADI is not triggering. Tried in SDN and found that for ESS we need to use BADI HRPAD00INFTYBL. In this my problem is how can we get whether it is updation or deletion or creation mode?
      Otherwise can any one provide me another BADI is available for this scenario which will work through ESS.
    Thanks,
    SC

    If you are trying to use this BADI and you don't have access to the current operation being executed (INS, MOD, DEL etc), you can always have access by using the PSYST structure used on the main program of the infotype you are working with.
    You just have to use a field-symbol to get access.
    FIELD-SYMBOLS: <FS> TYPE PSYST.
    ASSIGN('(MP000100)PSYST') TO <FS>.
    CASE <FS>-IOPER.
    WHEN 'MOD'.
    ENDCASE.

  • How to display Error messages through BADI HRPAD00INFTY in ESS ?

    Hi,
    In ESS, I want to perform custom validation on IT1067 ( Health Plan ) and allow only specific combinations of health plans to be selected.   We are on ECC6.0 EhP4 .  This infotype is "NOT PERMITTED" in the new decoupled framework and hence I cannot use NEW BADI's for validation and I am stuck with Classical BADI - HRPAD00INFTY.
    In my classical badi HRPAD00INFTY, after validation, I want to display an error message if "Invalid Combination" is selected by the user.  
    I tried using the following code to display the error message :
              DATA badi_message_handler   TYPE REF TO cl_hrpa_message_list.
              DATA message_handler        TYPE REF TO if_hrpa_message_handler. 
              DATA msg                    TYPE symsg.
              DATA is_ok                  TYPE boole_d.
              CREATE OBJECT badi_message_handler.
              message_handler = badi_message_handler.
              msg-msgid = 'YHBN'.
              msg-msgty = 'E'.
              msg-msgno = '006'.
              msg-msgv1 = c_none_plans. "'Invalid Plan'(z09).
              CALL METHOD message_handler->add_message
                EXPORTING
                  message = msg
                  cause   = message_handler->unknown.
                  is_ok = space.
              badi_message_handler->add_messages( message_handler ).
              RAISE error_with_message.
    The message is displayed in ESS but after that the Java Trace Exception is displayed.   I  want to display the error message in a user friendly way and provide an option to correct the plans.
    Please let me know if anyone has done similar thing or have any suggestions.
    Thanks

    Hi,
    DATA badi_message_handler   TYPE REF TO cl_hrpa_message_list.
              DATA message_handler        TYPE REF TO if_hrpa_message_handler. 
              DATA msg                    TYPE symsg.
              DATA is_ok                  TYPE boole_d.
              CREATE OBJECT badi_message_handler.
              message_handler = badi_message_handler.
              msg-msgid = 'YHBN'.
              msg-msgty = 'E'.
              msg-msgno = '006'.
              msg-msgv1 = c_none_plans. "'Invalid Plan'(z09).
              CALL METHOD message_handler->add_message
                EXPORTING
                  message = msg
                  cause   = message_handler->unknown.
                  is_ok = space.
              badi_message_handler->add_messages( message_handler ).
         *-- Add following--
        Exit.
              RAISE error_with_message.

  • BAdi HRPAD00INFTY - Dynamically change the value of Wage amount in Infotype

    Hello all,
    I am implementing BAdi HRPAD00INFTY for infotype 0008.
    The requirement is, whenever user checks/saves Infotype 8, System should look out FTE wage type exists or not. If it exists then amount should be calculated and get updates for that wage type. If wage type not found insert wagetype FTE and amount in the infotype for the employee.
    I have calculated amount in method AFTER_INPUT of the BAdi. I am trying to reflect the updated amount on the screen using  method CL_HR_PNNNN_TYPE_CAST=>PNNNN_TO_PRELP. but it is not working.
    I also tried to use the same method CL_HR_PNNNN_TYPE_CAST=>PNNNN_TO_PRELP in BEFORE_OUTPUT method.
    Can somebody help me on this?
    Any pointer would be helpful and appreciated.
    Thanks in advance.
    Best Regards,
    Dharitree

    Added by Jeyhun Hajiyev - Azerbaijan Baku DemirBank 05.04.2010
    Function EXIT_SAPFP50M_001 INCLUDE  ZXPADU01
    DATA : lv_message_handler TYPE REF TO if_hrpa_message_handler
               , wa_0008  LIKE p0008
    FIELD-SYMBOLS: <fs_p0008> TYPE ANY.
    IF innnn-infty = '0008'.
      CLEAR : lv_plans
            , ls_hrp1005
            , lv_result
    Transfer the structure p0008 from INNNN
      ASSIGN ('INNNN') TO <fs_p0008> CASTING TYPE p0008.
      CHECK sy-subrc = 0.
      MOVE <fs_p0008> TO wa_0008.
    u201COR
    CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PRELP_TO_PNNNN
    EXPORTING
    PRELP = INNNN
    IMPORTING
    PNNNN = WA_0008.
    u201CChanging in Infotype 0008
          wa_0008-trfst = '01'.
          wa_0008-lga01 = '1000'.    "FOR SEE RESULT YOU MUST ADD THAT LINE
          wa_0008-bet01 = 100. " $ Amount for Q0008-BETRG
      CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp
        EXPORTING
          pnnnn = wa_0008
        IMPORTING
          prelp = innnn.
    ENDIF.

  • Changes in custom infotypes not captured in badi 'HRPAD00INFTY'

    Hi
    I have created a custom infotype 9038 and my requirement is, any changes in the infotype have to be logged in to a custom table. Any changes in standard infotypes are getting captured in badi 'HRPAD00INFTY' - method 'IN_UPDATE' and i am able too update my custom table.  But changes in custom infotype 9038 is not triggering the badi 'HRPAD00INFTY'.
    Could any body suggest which tables should be maintained to trigger the badi or do we need to do any configuration using SPRO?
    Thanks and regards
    Badri

    I created the interface which is running successfully.
    Now i did some changes in target table(data base level).
    I reversed the updated table in model section. Till here its ok
    The table which is updated in the model section is not automatically updated in the interface.
    I have to drop the existed datastore in the interface and and re do the entire process of bringing the updated datastore, mapping,etc..
    Please tell the any alternate way.
    Regards
    suresh

  • Implementing BADI - HRPAD00INFTY

    Hi Experts,
    I am new to BADI (though I know the general steps for implementation - se18 and se19) and would like to know how to implement the method IN_UPDATE from the BADI - HRPAD00INFTY. I am not able to figure out what the parameters IPSPAR, OLD_IMAGE, NEW_IMAGE, OLD_PREF_IMAGE, NEW_PREF_IMAGE are for and how they can be used in coding (am looking for info in addition to what is in the documentation). According to the requirement I need to fill the supervisor ID field P0001–MSTBR and display it when the user saves the infotype record. Any sample code for implementing this method would be very helpful.
    Thanks
    Sri
    Edited by: Sri Maddineni on Mar 12, 2008 5:58 AM

    Hi Sri,
    Please check the documentation for the method below to know the purpose of the fields...
    Update Program: Call-Up During Update
    Functionality
    The method Update: Call During Update (IN_UPDATE) is called in the update task of Personnel Administration in the UPDATE form.
    Parameters
    IPSPAR
    Work fields for dialog control
    OLD_IMAGE
    Before Image: Infotype records prior to change
    NEW_IMAGE
    After Image: Infotype records following change
    OLD_PREF_IMAGE
    Before Image for assignment values
    NEW_PREF_IMAGE
    After Image for assignment values
    to view the documentation
    Go to se18 -> enter the name of the badi -> click display->
    Press on the "documentation" tab
    Athough in all cases documentation may not be available....
    in this case a pop up will come after you press "documentation"
    Scroll towards the bottom and
    click on "Method: Update: Call During Update" highlighted in blue to view the documentation
    reward if helpful
    Regards
    Byju

  • Why badi HRPAD00INFTY can't work in t-code PTMW?

    hi:
    why badi HRPAD00INFTY can't work in t-code PTMW? if I want to do enhancement about PT infty in PTMW,what should i do?

    Please refer to help document for BAPI:HRPAD00INFTY which allows you to react to specific events in Personnel Administration. If you need logic in TMW, implement BADI  PT_BLP_USER. Further information can be found in section 6.a of SAP Note 447097.
    Regards
    Chetan

  • Updation of leaves from HR to Cprojects through BADI HRPAD00INFTY

    Hi Experts,
    I want to update the leaves from HR to Cprojects.
    For that i am using BADI HRPAD00INFTY  
    mplement the method IN_UPDATE from the BADI - HRPAD00INFTY. I am not able to figure out what the parameters IPSPAR, OLD_IMAGE, NEW_IMAGE, OLD_PREF_IMAGE, NEW_PREF_IMAGE are for and how they can be used in coding (am looking for info in addition to what is in the documentation).
    According to the requirement I need to update the ENDDA, BEGDA and AVLUNIT fields in RPM_BUPA_AVL table.
    I can see in the table NEW_IMAGE having the  fields ENDDA and  BEGDA. Here Data1 field having encrypted values.Any sample code for implementing this method would be very helpful.
    Regards
    Subhaskar

    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 messages through BADI HRPAD00INFTY not reflected in Portal

    Hi
         We are on ESS 6 and using web dynpro based Iviews.
         Various custom validations have been configured in R/3 via
         BADI <b>HRPAD00INFTY</b> for leave request.
         But those validations are not getting reflected when creating a leave through
         leave request Iview in portal.I need all those custome R/3 validations
         messages to appear in portal as well.
    Regards
    Mohamed Mansoor

    > In which method should I write the validations and
    > more over the BADI has already been implemented via
    > class CL_PT_ARQ_REQ.
    write your validations in SIMULATE_VIA_BLOP method. You can find current record in IM_ATTABS_TAB. after ur validations, when u want to raise an error message use follwing code.
    CALL METHOD MESSAGE_HANDLER->ADD_MESSAGE
    EXPORTING
    IM_TYPE = 'E'
    IM_CL = 'HRTIM_ABS_REQ'
    IM_NUMBER = 'XXX'
    IM_PAR1 = 'SIMULATE_VIA_BLOP'
    IM_PAR2 = 'IF_EX_PT_ABS_REQ~SIMULATE_VIA_BLOP'
    IM_PAR3 = 'BLOP'
    IM_CONTEXT = ''
    IM_SUBCONTEXT = ''
    IM_CLASSNAME = 'CL_PT_ARQ_BLOP_ADAPTER'
    IM_METHODNAME = 'MESSAGE'.
    Here, IM_CL = 'HRTIM_ABS_REQ' is important.
    This is message class created using se93. and XXX is the message number.
    this should raise an error message on leave screen.
    Cheers!!
    Ashutosh

  • BADI HRPAD00INFTY Implementation

    Hi,
    I have a query related to BADI implementation HRPAD00INFTY. We have implemented this BADI to delimit the record and create a new one of Bank details(infotype 0009). When in PA30, we copy a record whose End date is infinite i.e. 12/31/9999. After copying the record, copied record should get delimited with the end date as last changed date, as todays date. And end date of new record should get set to infinite date as above.
    New record is getting created correctly, but the delimited record's end date is not getting changed. As per analysis, when we try copying the record first time, the dates get set correctly and further not. The IN_UPDATE method of BADI is not getting called in next change sessions.
    Please advise on same or let us know for any solutions if any.
    Thanks,
    Rupali.

    Try like this
    method IF_EX_HRPAD00INFTY~BEFORE_OUTPUT.
      Data: LV_WA(20) Type C Value '(MP002100)VIEW_REPID'.
    Types: T_VIEW_REPID Type T582V-REPID.
      Field-Symbols: <FS_REPID> Type T_VIEW_REPID.
      Assign (LV_WA) To <FS_REPID>.
    endmethod.

  • PO13 and 0001 infotype (HR_INFOTYPE_OPERATION + badi HRBAS00INFTY

    Hello Friends,
    We have cretaed a position description subtype and assigned it to 1002 infotype.
    Query: 1) Adding 2 customer fields(Subtype and description) to infotype 0001 (This is done using PM01).
    2) Using Po13, they assign a subtype(position description) for a particular Position.
    Now the requirement is When they assign subtype to a postion in PO13 and save then these subtype
    and subtype description should be stored in 0001 infotype.
    the position should use to locate the employee and once the employee have been located update 0001.
    for ths I have implemented a PO13 badi HRBAS00INFTY(IN updating method) and inside the BADI we are calling
    HR_INFOTYPE_OPERATION' to update the eMPLOYEE(0001 INFOTYPE).
    Problem: Now the problem is , when we open PO13 in change mode to assign a subtype to Position ,sap creates a lock entry and when svae we are call
    HR_INFOTYPE_OPERATION' to update the eMPLOYEE(0001 INFOTYPE).but HR_INFOTYPE_OPERATION' also internally tries to lock the position but raising a
    message "You have already locked object/infotype S50000024".
    Pleae find below function and follwoing parameter I am suing for updating the person(0001 infotype) .
    I dont understand why HR_INFOTYPE_OPERATION is trying to lock position when I pass Pernr and 0001 as a parametr.
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
    EXPORTING
    infty = c_infty
    number = wa_pernr-pernr
    SUBTYPE =
    OBJECTID =
    lockindicator = 'X'
    validityend = wa_pernr-endda
    validitybegin = wa_pernr-begda
    RECORDNUMBER =
    record = it_0001
    operation = 'MOD'
    tclas = 'A'
    dialog_mode = '0'
    NOCOMMIT =
    VIEW_IDENTIFIER =
    SECONDARY_RECORD =
    IMPORTING
    Please help me .
    Thanks In advance
    Best Regards
    Trupthi

    Hi,
    Onemore thing I couldn't find the code for IF_EX_HRBAS00INFTY-in_update.
    For every BADI there will be an example interface. Here for this BADI example is IF_EX_HRBAS00INFTY. If u want to see the model code, go to SE24 and give the name :IF_EX_HRBAS00INFTY and click on display. Then you can find the methods and respective exapmle code.
    One more thing
    Some  BADIs will not allow calling commit work. In your BADI also already one LUW is opened, so it will not allow  to open another LUW and the respective  commit work.
    Thanks and Regards,
    Chandra

  • BADI HRPAD00INFTY - please help

    Hello all
    Can you please tell me what i do wrong i inplementing badi for an infotype. I want to change some fields on the screen with a PAI module.
    My code look's like this
          CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
            EXPORTING
              prelp = new_innnn
            IMPORTING
              pnnnn = k2002.
    some modifications
    CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp
              EXPORTING
                pnnnn = k2002
              IMPORTING
                prelp = new_innnn.
    I have no errors but datain fields still the same.
    regards
    Andrzej
    sorry for my english

    I am doing the exact same thing, and I have the same problem. What is the solution to this? So inside the Badi i do the changes, but as soon as the method has been called, the data is lost to the calling instance...(ie, the old data returns to the structures).

  • Not able to change date in BADI-HRPAD00INFTY

    hi,
    I have to change the start date in PA30 for IT0210 to current date.
    i m passing the sy-datum to
    new_innnn-begda = sy-datum
    after making an implementation of the BADi in AFTER_INPUT method.
    The value of new_innnn-begda is changed inside the Method.
    But as soon as it is coming out of the METHOD, its getting its previous values.
    Not able to figure out where i am wrong.
    ags.

    Hi,
    you are right. The kind of parameter NEW_INNNN of method AFTER_INPUT is IMPORTING not CHANGING.
    So there is no way.
    Regards
    Walter Habich

  • HR_INFOTYPE_OPERATION not working in badi HRBAS00INFTY

    Hi All,
    I need to create a record in IT0019 when IT0024 is updated.
    For that purpose I have created an implementation of badi HRBAS00INFTY and added my code in method IN_UPDATE.
    I try to create the record in IT0019 using FM HR_INFOTYPE_OPERATION.
    The problem is that the record is not created but the FM doesn't return any error( return param is empty ).
    I added 'commit WORK.' after the FM but this doesn't work neither.
    Do you have any idea why ths FM is not working in the badi.
    kr
    Karim

    Hi,
    Try with the BADI HRPAD00INFTY, If it not working try creating dynamic action for INFTY 0024.
    Dynamic actions : SPRO -> SAP Reference IMG -> Personnel Management -> Personnel Administration - >Customizing procedures -> Dynamic Actions.
    ~~~ Ganesh Kumar K.

Maybe you are looking for

  • UTF/Japanese character set and my application

    Blankfellaws... a simple query about the internationalization of an enterprise application.. I have a considerably large application running as 4 layers.. namely.. 1) presentation layer - I have a servlet here 2) business layer - I have an EJB contai

  • Weblogic Server 2008 Service Startup Error

    Hello When setting up weblogic on server 2008 R2, I can start weblogic using the startWeblogic.cmd file manually, but when configuring to run as a service, I am getting the below error and the service does not start. Do you know what could be causing

  • Does anyone have an example of an InDesign screenshot on retina Mac?

    I would like to know what InDesign looks like on a retina Mac. Unfortunately I do not live anywhere near a retailer who sells Macs.

  • Broadcasting jobs taking very long timel

    Hi Gurus, We are using broadcasting funcitonality in our project , we use to have daily boradcasting jobs which will distribute the workbooks on daily basis. Recently we observed that few jobs are taking very long time i.e 1.Say Job X have 10 receipe

  • PSE 8 Brush is showing up as colored dots?

    Whenver I go to use the brush tool (and these are just standard brushes, I've yet to install any) and set it to any color that isn't black or white, I get instead, a bunch of colored dots. And this is only for the brush tool, not the pencil. I've tri