BADI for validating asset value in ME21N

Hi,
I have a requirement where i need to validate the value entered in anln1 (asset) field in ME21N transaction and throw an error message if it matches on e particular value.
Thanks,
Abhinay

Hi,
I have a requirement where i need to validate the value entered in anln1 (asset) field in ME21N transaction and throw an error message if it matches on e particular value.
Thanks,
Abhinay

Similar Messages

  • Regarding Error message in ME_PROCESS_PO_CUST badi for validation.

    hi Friends,
    I am Using ME_PROCESS_PO_CUST badi for validation in Purchase order (ME21N),
    For that I implemented PROCESS_ITEM method which fires during each row now i  add another validation in same implementation for plant  should be same through out the all line item. Now following code is woking fine but when for second line item user changese plant then it shows error message as per logic which is fine but even after changing plant to correct one the error message is still coming why is it so?
    following is my current validation code
    method IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM.
      DATA:ls_poitem TYPE mepoitem,
           ls_poitem_set TYPE mepoitem.
      DATA:ls_poheader TYPE MEPOHEADER.
      DATA:lm_poheader TYPE ref to IF_PURCHASE_ORDER_MM.
      DATA:w_mara TYPE mara.
      DATA:IT_ZMMTBL039 TYPE STANDARD TABLE OF ZMMTBL039 ,
           WA_ZMMTBL039 TYPE ZMMTBL039 .
      DATA:ls_poitem1 TYPE mepoitem.
      DATA:V_KUNNR1 TYPE KNA1-KUNNR.
      DATA:V_KUNNR2 TYPE KNA1-KUNNR.
      DATA:W_WERKS(4),
           w_werks_tmp(4),
           w_flag(1).
      ls_poitem = im_item->get_data( ).
      lm_poheader = im_item->GET_HEADER( ).
      ls_poheader = lm_poheader->GET_DATA( ).
      IF ls_poitem-werks IS NOT INITIAL.
        w_werks = ls_poitem-werks.
        import w_flag to w_flag from MEMORY ID 'FLAG'.
        if w_flag is initial.
          w_flag = 'X'.
          EXPORT w_werks_tmp FROM w_werks TO MEMORY ID 'MEMO1'.
          export w_flag from w_flag to MEMORY ID 'FLAG'.
          clear: w_flag.
        endif.
      ENDIF.
      IMPORT w_werks_tmp TO w_werks FROM MEMORY ID 'MEMO1'.
    break swaroopb.
      IF ls_poitem-werks NE w_werks.
          MESSAGE E010(zparts) with 'Different plants are not allowed in single PO.'.
      ENDIF.
      CLEAR: WA_ZMMTBL039,w_mara.
      REFRESH:IT_ZMMTBL039[] .
      SELECT *
        INTO TABLE IT_ZMMTBL039
        FROM ZMMTBL039
       WHERE bsart EQ ls_poheader-bsart.
      IF sy-subrc EQ 0.
        CLEAR: WA_ZMMTBL039,w_mara.
        SELECT SINGLE *
          INTO w_mara
          FROM mara
         WHERE matnr EQ ls_poitem-MATNR.
        IF SY-SUBRC EQ 0.
          READ TABLE IT_ZMMTBL039 INTO WA_ZMMTBL039 WITH KEY  bsart = ls_poheader-bsart
                                                              mtart = w_mara-mtart
                                                              spart = w_mara-spart.
          IF SY-SUBRC NE 0.
            MESSAGE E009(zparts) WITH ls_poitem-MATNR w_mara-spart ls_poheader-bsart .
          ENDIF.
        ENDIF.
      ENDIF.
    end method

    Hello Swarup
    Since you want to compare all items together (having the same plant) I would suggest to implement this logic either in method CHECK or POST of the interface.
    However, if you want to make your checks within the PROCESS_ITEM method then you should change your logic.
    It does not make sense to work with the ABAP memory within a BAdI implementing class because the class itself is your "memory".
    I would use the following logic to implement your validation:
      lo_poheader = im_item->get_header( ).  " retrieve header instance
      lt_items = lo_poheader->get_items( ).   " retrieve all items
      ls_detail_x = im_item->get_detail( ).  " details of currently processed item
      LOOP AT lt_items INTO ls_item.
        ls_detail = ls_item-item->get_detail( ).
        IF ( ls_detail-werks NE ls_detail_x-werks ).  " validation failed
        " do something...
       ENDIF.
      ENDLOOP.
    However, I would prefer to do this kind of validation in CHECK or POST method.
    Regards,
      Uwe

  • BAdI for Personal Default values

    Hi,
    Does anyone know the BAdI for Default Values/Checks for Personnel Administration and Recritment?
    Thanks in advance.
    Anand.

    Hi anandaraja,
    1. I don't think there is a badi,
    2. but there is a customer exit
      PBAS0001 - in smode tcode.
    3. The fm name inside it is
       EXIT_SAPFP50M_001 for defaulting values
       EXIT_SAPFP50M_002 for validations at time of saving.
    regards,
    amit m.

  • Badi for setting default values in the transaction in APO.

    BADI NAME: SMOD_APOCF005 which is used for setting default values in the transaction.
    I have implemented the BADI using the below code but that BADI is not triggering. Please can you provide any solution for resolving this.
    As per my requirement I am trying to set default values for these three fields RRP_TYPE, WHATBOM, CONVH.
    DATA: LS_MATLOC LIKE LINE OF IT_MATLOC.
    LOOP AT IT_MATLOC INTO LS_MATLOC.
    LS_MATLOC-RRP_TYPE = '4'.
    LS_MATLOC-WHATBOM = '5'.
    LS_MATLOC-CONVH = '999'.
    MODIFY TABLE IT_MATLOC FROM LS_MATLOC TRANSPORTING RRP_TYPE WHATBOM CONVH.
    ENDLOOP.
    DATA: LS_MATLOCX LIKE LINE OF IT_MATLOCX.
    LOOP AT IT_MATLOCX INTO LS_MATLOCX.
    LS_MATLOCX-RRP_TYPE = 'X'.
    LS_MATLOCX-WHATBOM = 'X'.
    LS_MATLOCX-CONVH = 'X'.
    MODIFY TABLE IT_MATLOCX FROM LS_MATLOCX TRANSPORTING RRP_TYPE WHATBOM CONVH.
    ENDLOOP.

    The  BADI name: SMOD_APOCF005 .
    T.code at APO : /sapapo/mat1
    Once we enter in that T.Code with some Product and Location data.
    There under PP/DS tab.
    Under Planning Procedure there is a field PP Plng Procedure which I want to set as 4
    And under Order Creation there is Plan Explosion which needs to be set as 5
    And Under Horizons there is PP/DS Horizon which needs to be set as 999.
    BADi is implemented and active.
    And once the data is CIF from ECC to APO
    These default values are not set in the T code in APO and the BADi is not triggering.

  • Badi For Account Assignment Category in me21n

    Hi All,
    I am trying to implemnt badi for me21n for assigning default account assignment category as  E.
    i got the badi for  ME_PROCESS_PO_CUST .
    But the the problem is i dont find account assignment category field(KNTTP) in trhe metyhods tab.
    No othe badi is getting triggered.
    Please help me out in  this regard.
    Thanks and regards
    Ibrahim

    hi,
    i hope this will help you.
    DATA:
             ls_acc TYPE REF TO if_purchase_order_account_mm,
             ls_item     TYPE REF TO if_purchase_order_item_mm   ,
             ls_hdata    TYPE mepoheader                            ,
             ls_header   TYPE REF TO if_purchase_order_mm           ,
             ls_idata    TYPE mepoaccounting,
             ls_data     TYPE mepoitem_data    .
      DATA : lv_werks TYPE wrf1-locnr .
      DATA : vlfkz  TYPE wrf1-vlfkz.
      DATA : matkl  TYPE mara-matkl.
      DATA : ls_ana   TYPE zmm_ana_hesap.
      DATA : lv_okset TYPE c.
      ls_acc = im_account .
    *get item from account
      CALL METHOD ls_acc->get_item
        RECEIVING
          re_item = ls_item.
    *get item header
      CALL METHOD ls_item->get_header
        RECEIVING
          re_header = ls_header.
    *- Get item header data
      CALL METHOD ls_header->get_data
        RECEIVING
          re_data = ls_hdata.
    *- Get item data
      CALL METHOD ls_item->get_data
        RECEIVING
          re_data = ls_data.
    *- Get account data
      CALL METHOD ls_acc->get_data
        RECEIVING
          re_data = ls_idata.
      lv_werks = ls_data-werks.
    ***Conversion Exitler
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = lv_werks
        IMPORTING
          output = lv_werks.
      SELECT SINGLE vlfkz FROM wrf1 INTO
         vlfkz
        WHERE locnr EQ lv_werks.
      SELECT SINGLE matkl FROM mara INTO
         matkl
        WHERE matnr = ls_data-matnr.
      SELECT SINGLE sakto INTO ls_ana-sakto FROM zmm_ana_hesap
        WHERE matkl = matkl
        AND vlfkz = vlfkz
        AND bsart = ls_hdata-bsart
    AND knttp = ls_data-knttp
      IF sy-subrc EQ 0 .
        ls_idata-sakto = ls_ana-sakto.
        lv_okset = 'X' .
      ENDIF .
    * buraya lv_check ya da sakto bou015F ise için kosul gelecek
    IF lv_okset IS NOT INITIAL .
    *- Set item
        MOVE-CORRESPONDING ls_data TO ls_idata .
        CALL METHOD ls_item->set_data
          EXPORTING
            im_data = ls_idata.
      ENDIF.
    ENDMETHOD.

  • FI-AA: table(-s) for the asset value

    Dear forum members,
    I need to find the table where I can get the asset value from!?
    The background is that I`m writing a report where I have to get the value of an asset. If it is higher then 0,00 then it has to do this and if it lower than 0,00 it has to do that and so on.
    It would be great if someone could help me with this matter, or at least give me an idea how to find that out.
    Thank`s in advance

    Hi,
    definitely table ANLC. You have to calculate the asset value as ANLC contains acquisition cost, accumulated depreciation, depr. of the actual year,...
    best regards, Christian

  • Exit or BAdi for Validating GR posting date Greater than PO creation date.

    Hi all ,
    Is there any Exit or BAdi for restricting users to post GR date greater than PO creation date.
    Regards
    Gibi Philip

    Gibi,
    check this:
    MB_CIN_LMBMBU04                         posting of gr
    Amit.

  • Exit/BADI for condition type value

    Hi friends,
        I have a BADI BADI_SD_BILLING_ITEM. I want to enhance method 'ITEM_PRICING_COM' present in this BADI.
        My purpose of using this BADI is that I want to get the values of condition type before saving a billing document.For that purpose I want to enhance this BADI.
    But I don't know how to proceed.
       Please help me out.
    Regards,
    Rajesh

    Enhancement                                                                               
    V61A0001                                Customer enhancement: Pricing                            
    V60P0001                                Data provision for additional fields for display in lists                             
    SDVFX011                                Userexit for the komkcv- and kompcv-structures     "This may be usefull

  • BADI for Disabling NetPrice field in ME21N & ME22N based of Material Type.

    Hi.
    I had a requirement to disable "net price" field while creating or changing a PO (ME21N & ME22N) based on the type of material entered.
    Please asssit me in finding the BADI or exit name which can meet my requirement. Thanks.

    Hi Ranga nadh,
       The BAdi what you have mentioned is correct.
    ME_PROCESS_PO_CUST - In this BAdi, we are having a method PROCESS_ITEM. These method is used to process all the Item data. As the field Netprice is at the level. You can use this method.
    Here inside this method we are having a parameter IM_ITEM
    So, You create a implementation and inside this method you can code here to appear the field in disable mode.
    Cheers,
    Swamy Kunche

  • User Exit/BADI for AS01 ( Asset Creation )

    Hi Xperts,
    My requirement is during asset creation in AS01, after asset generated i want to send asset no, subno, asset creation date, int. order no to ztable.
    Can anyone suggest user exit/BADI which suit this requirement.
    I have gone through forum search, but not found suitable object.
    Ram.

    Hi Ram,
    Check out below Badi and Enhancement
    BADI
    IHSA_LIST_EDITING
    ENHANCEMRNT
    EXIT_SAPLAAPM_002
    EXIT_SAPLAIST_001
    EXIT_SAPLAIST_002
    EXIT_SAPLAIST_003
    THANKS & REGARDS
    G.Vendhan
    Edited by: vendhan g on Jul 24, 2009 12:33 PM

  • Badi for update dates values in complaints

    Hi all
    I need to update the date of the status of the complaint, does any body know if there are a BADI or any other way to update this value ?
    I try with a DYNP_VALUES_READ function but can't found the dynpro where the vales are.
    any sugestion is grateful

    The  BADI name: SMOD_APOCF005 .
    T.code at APO : /sapapo/mat1
    Once we enter in that T.Code with some Product and Location data.
    There under PP/DS tab.
    Under Planning Procedure there is a field PP Plng Procedure which I want to set as 4
    And under Order Creation there is Plan Explosion which needs to be set as 5
    And Under Horizons there is PP/DS Horizon which needs to be set as 999.
    BADi is implemented and active.
    And once the data is CIF from ECC to APO
    These default values are not set in the T code in APO and the BADi is not triggering.

  • User Exit or BADI for COR1/COR2

    Dear Experts,
    Can you please tell me if we have any user-exit or BADI for chaning the value of the technical completion date field
    i.e. AUFK-IDAT2 while saving the Process Order in COR1 or COR2?
    Thanks,
    Praveen

    Hi Praveen,
    Implement the customer exit EXIT_SAPLCOKO_006 in enhancement
    PPCO0020  Process order: Display/change order header data
    This is only importing one field I_AUFNR.
    but try the logic below.
    data: lv_fnam type char16 value '(SAPLCOKO)caufvd'.
    field-symbols : <fs_caufvd> type caufvd.
    your checks for changing the field IDAT2 (Technical completion date).
    Try to change <fs_caufvd>-IDAT2 field value.
    Regards,
    Dwarakanath.S

  • How to stop Depreciation for some assets & start again.

    Dear Friends,
    We have a requirement where we have to stop Depreciation for some assets as they are not in use and again post depreciation when they put in use.
    For ex: Asset Value is 10,000 and monthly Depreciation is 100. Asset has been depreciated for first 6 periods in year with 100 each in every month & we want to stop depreciation for coming 3 months and post depreciation when they put in use. Asset should not be depreciated when they are not in use and calculate regular 100 if we run depreciation again if we put in use. So total Depreciation of the asset for the year should be 900 (First 6 Months & last 3 months).
    Please explain step by step process to do this and your kind cooperation to solve this issue is highly appreciated.
    Points will be rewarded for sure if my problem solves.
    Thanks & Regards,
    Naveen Kumar.

    Go to AS03 Asset Master/Dep tab and observe the dep key
    Goto AFAMA and select that dep key and click on assignment of calculation methods
    You can see last row for shutdown field and select YES
    Go to asset master at AS02/Time dependent data and select shutdown check box and enter period
    If shutdown check box is not available goto as03 and goto menu environment-screen layout and master data and identify the screen layout number
    Go to SPRO-Financial Accounting (New)-Asset Accounting-Master Data-Screen Layout-Define Screen Layout for Asset Master Data-Define Screen Layout for Asset Master Data-
    Select your screen layout and click on logical field groups and select 3 (Time dependent data) and click on field group rules and make shutdown field as optional.
    This will allow you to change the shutdownfield asset master data.
    Srinivas

  • Accumulated depreciation transaction data upload for an asset

    hi gurus,
    i am uploading transaction data in the system. for the asset value i am using tcode  f-90 but i am not getting the idea of how to upload an accumulated depreciation in for an asset 
    regards
    sayeed

    hi  paul,
    billions of thnx........   ABSO really works......
    regards
    sayeed
    Edited by: sayeed bakhressa on Jan 28, 2009 12:28 PM

  • Asset value

    Dear all,
    we have setteled a AUC to fixed asset in a project (PS) and when i go to that Asset and check for the asset values acquired, out of 5 books  we have maintained, i am able to see the value transfer and planned DEp for 4 books and one book has no values what could be the issue.
       Am i missing something.
    Your valuable inputs are highly appreciated.
    Regards
    V

    Check the Value adoption rule for the Depreciation area.

Maybe you are looking for