PO validating while creating...

Hi All,
I need to validate some item level data with the header data, So i wrote the code in User Exit. Its validating well, but if i press save button its simple asking a dialog and the PO is getting saved when i have errro also.
i have tried  EXIT_SAPMM06E_007, EXIT_SAPMM06E_006 and EXIT_SAPMM06E_012 also. In call cases, its validating properly with throwing a message. But i am able to save...
can you please let me know your views on this.
Thnks,
Raghu Posani.

Hello Raghu
When you look through the signatures of the exit-fm's you have mentioned then you see that there is no parameter available to send back an "error flag" to the main application.
I am not very familiar with this user-exit function group but if you have BAdI ME_PROCESS_PO_CUST available on your system you can easily implement your logic in interface method IF_EX_ME_PROCESS_PO_CUST~CHECK, e.g.:
METHOD if_ex_me_process_po_cust~check.
* define local data
  DATA:
    lt_items      TYPE purchase_order_items,
*    ls_item       LIKE LINE OF lt_items,  " alternatively
    ls_item       TYPE purchase_order_item,
    ld_netwr_sum  TYPE netwr,
    ls_header     TYPE mepoheader,
    ls_detail     TYPE mepoitem,
    lt_details    TYPE tab_mepoitem.
"  check ( im_hold = 'X' ).  " hold purchase order
* Get the order items
  lt_items = im_header->get_items( ).
  REFRESH: lt_details.
  LOOP AT lt_items INTO ls_item.
    ls_detail = ls_item-item->get_data( ).
    ADD ls_detail-netwr TO ld_netwr_sum.  " Total of net price
  ENDLOOP.
* Check condition
  IF ( ld_netwr_sum > 1000 ).
    MESSAGE 'Net price > 1000 => create purchase requisition' TYPE 'E'.
    ch_failed = 'X'.  "
  ENDIF.
ENDMETHOD.
The "error flag" for the main program is CH_FAILED. If this CHANGING parameter is set CH_FAILED = 'X' the PO cannot be saved.
Regards
  Uwe

Similar Messages

  • I want validation while creating material master with profit center

    Dear Experts,
                           I want validation while creating material master with profit center.
    If 0001 plant having 100100 profit center
       0002 plant having  200200 profit center
    Material A cant be created for 0001 plant for with wrong profit center 200200.
    Kindly help & provide me solution clearly

    Hi,
    Profit centers are assigned to controlling areas. And controlling areas can have many plants under them. So as long as both the plants and profit centers are in the same controlling area users will be able to extend the materials.
    You should put in your validation control in the material master user exit. One of the exits you can use is
    MGA00001  Material Master (Industry): Checks and Enhancements
    Thanks & regards
    Hameed Parvez

  • No G/L validation, while creating SCand as well as changing the SC.

    Hi SRM gurus,
    There is no G/L account validation with Combination of AAC,
    While crating SCand as well as Changing the SC.
    After completion of approval process, the  Cart will be in Application Monitor.
    with Error "Backend transmission " ME045 G/L Account can't be used"
    Can any body tell. is ther any BADI or OSS note to validate the G/L Account
    Greately Appreciated
    CK

    Thank you both for attempt to reply.
    Actually everything working fine.
    My requirement  is system should display an error message "G/L account Can't be used",
    at the time of creation as well as changing the SC."
    Even though we maitained the Invalid combination of Cost assignment and G/L account in Config.
    Define G/L Account for the Product Category.
    Now System is allowing to create SC with invalid combination of AAC and G/Leg.
    "N"    G/L :22222 actually this is a invalid combination in the backend.
    System is only giving error after completion of approval I.e
    While creating Back end document PR.
    This is wasting time for process.
    So  we have to  restrict the shopper at the time creation as well as change the Cart.
    Same as in the Backend PR creation scenario.
    I request you all
    Is there any FM,BADI or OSS note relevent to validate G/L account at Runtime.
    Thanks a lot.
    CK

  • Cost center validation while creating PO

    Hi,
    How can we put a cost center validation in PO.
    we are experiencing issues with PO's created for a different company code at the time of posting invoices.
    how can we put a check while creating a PO to validate the cost center.
    Can we put a check on User authorization to input only come cost centers at the time of PO creation?
    Highly appreciate your thoughts as it is very important.
    Thanks
    Madhu

    Hey Madhu,
    I believe certain error messages have been deactivated in you system, as the cost center master data wouldd have a company code in it and it is supposed to validate it.
    go to OBA5 and enter application are KI and activate message 113 to an error
    KI113 would not allow you to purchase across company codes

  • Validation while create data type

    HI All ,
    I have a pop-up in my report that user can create data type in  didc,
    There is a simple way to support validation for data types ,
    I have pop-up where the user need  to provide name of attribute
    he need to create and the data type for it (char ,string ,int etc )
    and he also need to provide the leng of the attribute he want to create
    (e.g. char10 ) and also decimal places .
    the issue here that i need to do some validation in the pop-up
    for e.g. if user choose
    case 1
    name     - attribute1
    datatype  - string
    leng   - in this case he dont need to provide leng (string )
    dec - dont need to provide (string )
    case 2
    name     - attribute1
    datatype  - char 
    leng   - 10
    dec - dont need to provide (char )
    Any idea how to do this validation in a simple way  (maybe to use standard functionlity)
    Regards
    Alex

    HI Keshav.
    What i did is created a popup with FM in the popup i have 4 field
    the field with the data type which i want to trigger event to it is domain and not ref to FM
    The ppoup have 4 field
    attr name
    datatype
    length
    decimal
    so from what you are say there is not option to trigger event when the user press F4
    and choose a entry from it ,
    since what i want to do is that if user for instance chose string i want that the next to fields (length and dec ) will be
    remove from the popup since he dont need them .
    and for he choose char the the decimal field will remove from the popup
    Any idea how to solve this issue ?
    Regards
    Alex
    Edited by: Alex Dean on Oct 12, 2010 3:02 PM

  • Foreign key validation while creating master/detail record in document mode

    I am creating master/detail records in the document mode. And I am generating the master primary key in the create() method of the master Entity Object. Now I valdate the foreign key in the detail Entity Object's validateEntity() method by doing a query to the master table through some View Object.
    But since the master record has not yet been posted (since it hasn't been committed) to the database, this query does not return any record and the validation fails in detail object.
    And thus the create fails.
    Please let me know if this is the right approach for doing this. If so where I am going wrong? Else please let me know if there are any better approach to do this.
    Kunal

    Kunal:
    Use a code snippet like the following:
    --- Assuming you're in the detail EO's create method ---
    oracle.jbo.server.EntityDefImpl eDef = oracle.jbo.server.EntityDefImpl.findDefObject(<package-qualified-name-of-the-master-Entity-Object>);
    oracle.jbo.Row masterRow = eDef.findByPrimaryKey(this.getDBTransaction(), <foreign-key>);
    If the row does not exist, masterRow will be null.
    findByPrimaryKey first checks the entity cache (which will include your new master row(s)) and then go out to database (if it's not in cache).
    Thanks.
    Sung

  • Validation while creating sales order

    Hi friends,
    Please tell how to do the
    BADI for validating the fields for creating sales order (BADI_SD_SALES_ITEM and BADI_SD_SALES_BASIC)

    Hi Narendra,
    Thanks for reply..
    Please give the process for the BADI instead of User Exit.
    Could you please give an example on <b>validation by taking  any two fields of it with any constraint or Business rule associated with it.</b>

  • Re:Skip validation while creating New Record

    Hi all,
    I am using Jdeveloper 11.1.1.7.0
    I have one adf table and one createInsert button in .jspx page
    If first time when i click on createInsert Button it is working fine but again i click on createInsert button without entering any mandatory field it is giving an error message like enter a value.
    So how to skip that one,Can anyone help me to resolve it
    Thanks,
    Syam

    The CREATE FM should not only create the entry, it should also EXPORT the key that it uses to create the entry. Is it doing that?
    i.e. the CREATE signature is usually something like:
    CREATE_BLAH
      IMPORTING header TYPE header_row
      EXPORTING key type header_row-key_field.
    So the 'key' here should be filled by the FM and returned to DOE.

  • Error msg . while creating a GR w.r.t. PO --"ENTER A VALID TRADING PARTNER"

    Hi ,
    While  creating a GR w.r.t. Purchase Order (MB01)  getting a following msg:
    "ENTER A VALID TRADING PARTNER "
    In Vendor Master : Partner function  has the vendor details
    OA     Ordering Address     
    VN     Vendor     
    PI     Invoice presented by     
    Any thread would be helpful .
    regards,
    chait

    Hi ,
    THere is no entry in field :Trading partner LFA1 -
    VBUND  
    ALso the vendor has acccount group : RMIT  :  Remit to Address
    PArtner functions are maintained in vendor master viz. OA ,VN , PI .
    regards,
    chait

  • Validity period error while creating Service Entry Sheet.

    Hi SAP experts,
    Users are facing below two error messages while creating serivce entry sheet with respect to Standard PO (NB).The PO has RFQ refrence where Validity start and end date is blank. Also PO has Item category 'D' (Services)
    1) "Runtime of entry must fall within Run time of the PO (05.12.2008-05.01.2009)
    2) Entry must be wihin validity period of purchase order (05.12.2008-05.01.2009)
    In the EKKO table system is showing validity start and end date for PO but it is not present in the PO (NB) by ME 22 / 23N.
    Basically standard PO (NB) should not have validity start date and end date but still it is showing in the table EKKO. 
    Kindly provide me related resolution ASAP.
    Thanks
    BR,
    Rahul

    Hi Alex,
    Thanks for the quick reply.
    There is no Validity period maintained in the PO header under "Additional data".
    but still I am getting Validity data in the table EKKO for standard PO (NB).
    BR,
    Rahul

  • End of Valid Logistic Calender error while creating Sales Order

    Hi,
    While creating Sales order in VA01 the following error message comes for particular material code for a particular site only:
    24.01.2202 date comes after end of valid logistics calendar. (Please
    correct)
         Message no. 61062
    Can anyone suggest on the same.
    Regards
    Nilofer

    Hi,
    The input value given in Sales order is " Req Delivery date: 31.03.2012", but the error comes with the below date such as
    "24.01.2202 date comes after end of valid logistics calendar.(Please correct)"
    We also face one more error such as
    " Incorrect index structure for table XMVERF_POS/0000224110/000040 ".
    From where system is taking 24.01.2202 date?

  • While creating a device category i'm getting an error "enter a valid division via eg01,how can the error be overcom?

    While creating a device category i'm getting an error "enter a valid division via eg01,how can the error be overcome?

    Neha,
    you can do in two ways.
    1. Enter a valid Division which you configured in the system.
    2. Remove the Division as required field. However I suggest it should have a valid division. Why can not you check with your Functional owner?
    Linganna Katigiri

  • Validation chack while create the plant

    Hi All,
    can we do the validation check while create the new plant. in the custom
    ex: if i suppose to create the plant with name ABCD
    i want to maintain meaning for the each word before create the plant.
    the system should validate the each letter of the plant name while creating.
    Edited by: raj on Sep 9, 2008 2:03 PM

    HI Keshav.
    What i did is created a popup with FM in the popup i have 4 field
    the field with the data type which i want to trigger event to it is domain and not ref to FM
    The ppoup have 4 field
    attr name
    datatype
    length
    decimal
    so from what you are say there is not option to trigger event when the user press F4
    and choose a entry from it ,
    since what i want to do is that if user for instance chose string i want that the next to fields (length and dec ) will be
    remove from the popup since he dont need them .
    and for he choose char the the decimal field will remove from the popup
    Any idea how to solve this issue ?
    Regards
    Alex
    Edited by: Alex Dean on Oct 12, 2010 3:02 PM

  • Error while creating a new entity row for LoginPageEO.jbo.RowCreateExceptio

    hi all, i am new to OAF i have created a login page and trying to validate to a custom table which had two columns username and password, i am calling function from controller class which is in AM and from AM in turn i am calling function in VOimpl.java file where i am executing my query with whereClause, i am passing two parametere username and password to this function.
    if ((uname != null) && (!("".equals(uname.trim()))))
    whereClause.append(" UNAME = :");
    whereClause.append(bindCount++);
    parameters.addElement(uname);
    clauseCount++;
    if ((pass!= null) && (!("".equals(pass.trim()))))
    if (clauseCount > 0)
    whereClause.append(" AND ");
    whereClause.append(" PASSWORD = :");
    whereClause.append(bindCount++);
    parameters.addElement(pass);
    clauseCount++;
    setWhereClause(whereClause.toString());
    if (bindCount > 0)
    Object[] params = new Object[bindCount];
    // the copyInto() is 1.1.8 compliant which is required by ARU
    parameters.copyInto(params);
    setWhereClauseParams(params);
    //System.out.println(getQuery());
    executeQuery();
    //System.out.println(getRowCount())
    when i call this from login page i am getting
    Error - oracle.jbo.RowCreateException: JBO-25017: Error while creating a new entity row for LoginPageEO.
    Can any one help me out.

    If your requirement is not to update any DB Table then don't use an EO. I would suggest the following for your requirement of validating the username and password.
    - Create a VO that has the following query. Do not select any EO during the VO creation.
              SELECT 'x'
              FROM  <CUSTOM TABLE>
              WHERE <USERNAME COL> = :1
                  AND  <PASSWORD COL> = :2
            - Have the initQuery(..) Method in your VOImpl, that takes the username and password. Binds them to the VO and executes the query.
    - Have a method in your AM to take the username and password as parameters. Make a call to the above VO::initQuery(..)
    - In your controller's processFormRequest(..) call this AM Method upon the submit button action.
    This should work smoothly.
    The following is just for triaging the error that you have. The above steps, should help you achieve your requirement by itself, the below steps would not be required.
    Coming back to your issue. Any custom table should have the standard WHO Columns.
    - Modify the custom table to have these who columns.
    - In the EO Wizard, synchronize the EO to reflect the DB Structure.
    - Make sure the EO Attributes are marked updatable.
    Cause of your issue: Through you are not creating EO rows programatically, whenever a VO is based on an EO, upon execution of the VO query, EO's are automatically created, based on the number of rows returned by the VO Query. So internally its failing to created the EO Rows. On of the common reason would be that it creates the EO row, but cannot set the attributes from the VO, because the EO Attribute is readonly.
    Hope this clarifies.

  • Error while creating PO in operation subcontracting

    I am getting an Error while creating PO in operation subcontracting.When I'm trying to convert the purchase requisition for the operation in the routing into a Purchase order it gives me the error "Not possible to determine any components".Please guide me why I am getting this error. I have already assigned the component to the operation in the routing. I also have this component in stock. But no Idea why I'm getting this error

    Hi  Sam,
    please check ,
    Assign a recursive BOM for the material for which you want to  create the purchase order .ie. create a BOM  of mat say X having a component  X and marking the indicator  recursive ticked.
    Please create the BOM  which is valid much before the date of creating a purchase requisition .
    And proceed for the creation of subcontract purchase requisition.
    Please Revert back, if the problem is solved.
    OMKAR

Maybe you are looking for

  • Info about 65792 Error only

    Only post useful infomation you have got about the error "65792" Error - From what i have been told from legit people that it could take upto 3-7 day so about 1 week and have been told to re-contact them if its not resolved. - From what i have read o

  • Thread in Different Consoles

    Hello! I am currently programming an applet with 3 buttons, start, stop and exit. The start button would open a thread that would create a socket connection to the server. The exit button simply closes the applet. The stop button should end the threa

  • GoPro clip and Final Cut

    When I move a clip to the timeline, the first time is ok, but with the second clip and next it tells me "Internal error", and the Canvas window become red. Any idea about why happens this? Thank you

  • Computer short name counted twice in System Profiler

    My Macbook Pro's Short Name is somehow being counted twice when I look in System Profiler. It shows (2) next to the name of my computer. Any idea how to fix this?

  • Chinese has vanished as Input Language

    Around 24 hours ago, my macbook froze while typing something in simplified Chinese, using the desktop WeChat application. On rebooting, simplified Chinese has now vanished from the toggle menu, but more alarmingly, Chinese (in all its forms) has vani