HRPAD00INFTY

Hi all,
I wrote a BADI when infotype 171 is created or saved and will update a date field (Z5 date field)  in infotype 41.
This works fine.
I wrote another BADI for infotype 41, whenever 41 is created or saved this BADI will create a Z6 date field in the infotype 41.
This works fine.
But when both BADI's are activated i am getting an short dump saying rolling back commit,
Can anybody suggest what is the problem?
thanks
Edited by: Chandra S on Sep 14, 2008 2:27 AM
Edited by: Chandra S on Sep 14, 2008 7:06 AM

Hi
Pass the NEW_IMAGE Work area to prelp. Below is the sample code.
  DATA: lxt_prelp               TYPE prelp,
        r_linetype              TYPE REF TO cl_abap_structdescr,
        gr_nnnn                 TYPE REF TO data.
  r_linetype ?= cl_abap_typedescr=>describe_by_name( 'P0105' ).
  CREATE DATA gr_nnnn TYPE HANDLE r_linetype.
  ASSIGN gr_nnnn->* TO <f_nnnn>.
  LOOP AT i_new_image INTO lxt_prelp
                     WHERE infty EQ i_infty.
    CLEAR <f_nnnn>.
    CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
      EXPORTING
        prelp = lxt_prelp
      IMPORTING
        pnnnn = <f_nnnn>.
    MOVE <f_nnnn> TO e_pnnnn.
  ENDLOOP.

Similar Messages

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

  • 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

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

  • 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

  • Assign field symbols in infotype 0021 BADI implementation (HRPAD00INFTY )

    Hi there,
    In PA30 infotype 0021, i have to change the value of T_VIEW_REPID by implementing BADI HRPAD00INFTY [Program MP002100->screen 2000->MODULE BEFORE_OUTPUT->PERFORM badi_before_output(sapfp50m)]. I'm trying to use field symbols (as below) to change the value of T_VIEW_REPID and getting SY-SUBRC = 4 after the Assign (LV_WA) To <FS_REPID>. Can somebody please help.
    method IF_EX_HRPAD00INFTY~BEFORE_OUTPUT.
      Data: LV_WA(20) Type C Value '(MPPDAT02)VIEW_REPID'.
      Types: T_VIEW_REPID Type T582V-REPID.
      Field-Symbols: <FS_REPID> Type T_VIEW_REPID.
      Assign (LV_WA) To <FS_REPID>.
    endmethod.
    Thanks.

    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.

  • HRPAD00INFTY and HR_INFOTYPE_OPERATION

    Hi All,
    I am using the BADI HRPAD00INFTY and HR_INFOTYPE_OPERATION to change the date field in infotype 41.
    But it is going into short dump saying source field is too small.
    Can anyone tell what is the problem and suggest what must be done?
    Thanks
    Siddartha

    Hi,
    Check the length of the fields that are passed to the FM it would be less than the length of the FM parameters as per the dump
    Hope this helps
    Regards
    Pavan

  • 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

  • IN_UPDATE  HRPAD00INFTY

    Hello All,
    I just implement the methode IN_UPDATE using the BADi HRPAD00INFTY,
    problem that I have, i need to trigger messages or exceptions when Errors comes, i dont have unfortunately any exports Parameters for triggering errors messages or exceptions in the Methode IN_UPDATE !!
    can any tell to solve this? to trigger messages in IN_UPDATE methode?
    thank you very much,
    regards

    example
    IF DAYS1 = 0 OR DAYS2 = 0.
            CONCATENATE 'Data error!' ' ' INTO MES_T SEPARATED BY SPACE.
            MESSAGE MES_T  TYPE 'S' RAISING ERROR_WITH_MESSAGE.
          ENDIF.
          IF LV_DATE1 > LV_DATE2.
            CONCATENATE 'Error number 2'  ' '  INTO MES_T SEPARATED BY SPACE.
            MESSAGE MES_T  TYPE 'S' RAISING ERROR_WITH_MESSAGE.
          ENDIF.

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

  • 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

  • HRPAD00INFTY IN_UPDATE currency field

    Hi abapers,
    We have a custom infotype (structure P9003) that has an include structure PS9003 consists of 2 components (component types PAD_AMT7S and
    WAERS). We want to make some controls when saving this datas from pa30. We have implemented BADI 'HRPAD00INFTY' and used method 'IN_UPDATE'. But when debugging this method, NEW_IMAGE-DATA1 field contains ##P#USD, although in screen we input 500,00 and USD . How can i solve this problem.
    Thanks.
    Message was edited by:
            Kaan Sezer

    hi kanupriya,
                          i am not a fully technical guy so plz help me ...
    My all the required data in the It0000 screen .Now i created the ZHRPAD00INFTY badi from se 19 in
    HRPAD00INFTY~IN_UPDATE method i have to take all the screen values and save in the PA0002 table  such as in standard badi is doing.
    now how i will check it data regarding the IT0000 or IT0002 .
    kindly guide me ......
    i have my all screen data in this endmethod (parameters)
    now how i have assign to pa0000.
    method IF_EX_HRPAD00INFTY~IN_UPDATE.
               NEW_PREF_IMAGE = NEW_PREF_IMAGE.
               OLD_PREF_IMAGE = OLD_PREF_IMAGE.
               NEW_IMAGE = endmethod..
               OLD_IMAGE = OLD_IMAGE.
               IPSPAR = IPSPAR.
    endmethod.
    thanks
    sandeep

  • 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

  • HRPAD00INFTY~IN_UPDATE

    Dear Friends,
    I have to insert the data in IT0000 ,IT0001 and IT0002 with the help of the HRPAD00INFTY badi.Am not aware about how i pass the value in this method IF_EX_HRPAD00INFTY~IN_UPDATE am not aware about i can do kindly help me out to guide me .
    Kindly give me example so i can dooo at my level....
    thanks
    sandeep

    hi kanupriya,
                          i am not a fully technical guy so plz help me ...
    My all the required data in the It0000 screen .Now i created the ZHRPAD00INFTY badi from se 19 in
    HRPAD00INFTY~IN_UPDATE method i have to take all the screen values and save in the PA0002 table  such as in standard badi is doing.
    now how i will check it data regarding the IT0000 or IT0002 .
    kindly guide me ......
    i have my all screen data in this endmethod (parameters)
    now how i have assign to pa0000.
    method IF_EX_HRPAD00INFTY~IN_UPDATE.
               NEW_PREF_IMAGE = NEW_PREF_IMAGE.
               OLD_PREF_IMAGE = OLD_PREF_IMAGE.
               NEW_IMAGE = endmethod..
               OLD_IMAGE = OLD_IMAGE.
               IPSPAR = IPSPAR.
    endmethod.
    thanks
    sandeep

Maybe you are looking for