Should customised row validation rules put in EntityImpl.java or EntityDefImpl.java?

Qestion:
1) Should customised row validation rules put in EntityImpl.java or EntityDefImpl.java?
2) Where am I recommended to define customized Exceptions?
Thanks for any replies!

Qestion:
1) Should customised row validation rules put in EntityImpl.java or EntityDefImpl.java?If you want to write validation logic in java, EntityImpl subclass is the place to do it. You may choose to write validation per attribute in the relevant setXXX methods (where XXX is attribute name)
or in the validateEntity() method (before/after calling super.validateEntity() as your case may be).
2) Where am I recommended to define customized Exceptions?You should define new exceptions in a package separate from your server classes, (so that you can download them to client-side incase you are in a thin-client environment).
Exceptions should be a sub-class of JboException if you want these exceptions to be tier-independent and work without conversions in Bc4J.
If the exceptions are part of validation logic you may choose to subclass ValidationException or one of the subclasses thereof.
Thanks for any replies!

Similar Messages

  • FI Validation Rules on Travel

    Hi experts.
    I am working in a project where Travel and Fi are in different systems. I am using IDocs ACC_EMPLOYEE_PAY02, ACC_EMPLOYEE_EXP02 and ACC_EMPLOYEE_REC02 to send Posting to FI.
    The distribution model has the BAPIs needed for checking and posting and the IDocs are transported to FI. The BAPIs are the following:
    1. BAPI Method AcctngEmplyeeExpnses.Check;
    2. BAPI Method AcctngEmplyeeExpnses.Post;
    3. BAPI Method AcctngEmplyeeRcvbles.Check;
    4. BAPI Method AcctngEmplyeeRcvbles.Post;
    5. BAPI Method AcctngEmplyeePaybles.Check;
    6. BAPI Method AcctngEmplyeePaybles.Post.
    The problem is that FI has validation rules (made in OB28) and the BADIs are not checking before posting. The IDoc goes to the FI system and gives an error there.
    Do you know how to solve this problem? Should I call the BAPI from the user-exits in TRIP_POST_FI?
    Thank you for your help.
    I will reward helpfull answers.
    Best regards.
    Marco Duarte

    Pre-requisites:-
    SYST-TCODE = 'FB60' OR SYST-TCODE = 'FB50' OR
    SYST-TCODE = 'FB70' OR SYST-TCODE = 'MIRO'
    Check:-
    ( BSEG-KOSTL NE ' ' OR BSEG-KOSTL NE '0' )
    AND
    ( BSEG-AUFNR NE ' ' OR BSEG-AUFNR NE '0' )
    Message:-
    As you need
    While copy paste the above into system, please put not equal to sign instead of NE. Not able to enter in this post as some problem in typing in this post.
    Regards,
    Gaurav

  • Validation Rule not fitting for calculated figure

    Hi,
    I want to add a validation rule in my data form. My requirement is in the data form I want row value 2 should be greater than (row value 1 * 0.2).
    Now when I'm trying to solve this through validation rule I did not found any such condition that fit with this case. Is there any way out for this scenario in validation rule?
    Thanks in advance.

    Hi. So you have two segments at least in your dataform (row1, row2)
    As we can't do math operators with cell's values in validation rules, it looks like you have to create formulae row3 (with hide option)
    It is very simple as follows: [1]*0.2
    And then you can create your validataion rule:
    IF Row value 2 <= Row value 3
    Then Process cell ...
    Also you may include additional conditions for Missing values in rows 1, 2 if any

  • PO Validation rules in PO

    HI All
    I want to put validation rule in PO. If user choose cost center in account assignment object while creating a PO..then I want system to validate(Example:t If user  choose a cost center starting with 99*** then GL account should start with 99***, Other wise system should pop up an error message). Is there any way to write validation rules of that kind?
    Thanks in advance

    Code this in an user exit. You can see which user exit fits your requirement best.
    One option is to use EXIT_SAPLEBND_002 (this will work even if release strategy is inactive).
    Hope this resolves.
    Lakshman

  • How to programmaticaly invoke validation rule

    Hi,
    I need to invoke programmaiticaly all validation rules when Entity Object is initialized from db.
    1) What method in EntityImpl class should I override ?
    2) How to force validation role programmatically ?
    Kuba

    Hi Timo,
    Obviously you have right. Our customer has a special requirement e.g. "soft validation". Data should be commited to database but marked as incorrect. To obtain this, I have a set of validation attribute rules that always return true but attribute with special message is added to special Map as incorrect. Attributes from this map are used as hints and displaied on the page as warning icon. It works fine but only when user change data. I need to fire these roles when data is read from db and particulary entity is initialized.
    Kuba

  • How do you create custom validation rule in WS 9.2?!?!?!

    Hello,
    I am using Workshop 9.2. I created a page flow, and want to do some form validations.
    I saw the simple 9.2 example, but it is only good for very basic validation, what if you have to validate the form field against a database, must you write a custom validation rule? HOW would you do this in 9.2 so that will still stay with the workshop/netui paradigm?
    http://beehive.apache.org/docs/1.0.1/netui/validation.html
    Keith

    Hi Keith,
    Staying within the declarative validation framework the answer is probably that you do need to write a custom validation rule and refer to it using the @Jpf.ValidateCustomRule annotation.
    The NetUI Annotation Reference shows how the Struts validations are supported via the framework.
    http://beehive.apache.org/docs/1.0.1/netui/annotations/pageflow_annotations.html
    Specifically, if you look through the @Jpf.Validate* annotations, while most of these are "canned" common validations, there are a few that are more open-ended, such as @Jpf.ValidateMask and @Jpf.ValidateValidWhen.
    Those two let you write the validation logic in the annotation while @Jpf.ValidateCustomeRule only refers to a custom rule in the struts validator file.
    In any case, there is a validation rule editor which should help in authoring and managing the annotations. In the Page Flow Explorer or Page Flow Editor just right click on the action or form bean bean of interest and choose Validation Rules and the appropriate scope.
    I hope that's of some use,
    Troy

  • Validation rule for Payment tax code

    Hi
    I have a requirement in which we have assigned both the invoice and payment with holding tax codes. However, at the time of booking vendor invoice through MIRO/F-43/FB60 , the user has to remove the payment with holding tax code manually. We have written a validation rule in which the prerequisite is that if the t code is F-43/MIRO/FB60 system should check if there is a invoice tax code. If the prerequisite is met and check failed system should give error message. However, our issue is that even after the payment tax code is removed, system is not allowing to save the invoice. The second issue is that the system is also giving an error if there is no tds tax types assigned to the vendor
    Regards
    Sanil Bhandari

    Hi
    I have set a validation rule with a warning message. System checks for with holding tax code and gives a warning message to the user to remove the payment tax code
    regards
    Sanil Bhandari

  • Validation Rule for Accounting Document type

    Hello Experts
       I have an requirement  to block certain accounting doc type to get vendor line item post in that. For that I tried to block direct through OBA7 but not be able to also can't delete number range as it is shared by another doc type. My last option is Validation rule but i never work on this ,so any suggest how to create validation rule " To Block Accounting Doc type SO THAT THERE WILL NOT BE ANY line item posting occur in that doc type.
    Regards.

    ok sure.  OB28 callpoint 1.  Create a step under this callpoint.
    1)  Prerequisite is as follows:  note XXXX is your company code and ZZ is your doc type.
    BKPF-BUKRS = 'XXXX' AND
    BKPF-BLART = 'ZZ'
    2)  Then you need to enter the check.  Here you can just put FALSE.
    3)  The last part is to create your message.  Message type E so they get an error and then create a message number in the class that you choose and give it a description:
    Document Type 'ZZ' is not allowed
    Save it and wah lah! 
    Let me know how it goes.
    Thanks,
    Jes

  • Restricting TDS based on validation rules for vendor invoice posting

    I have two Tax Types assigned in the vendor master. If at the time of invoicing user do not delete the unwanted tax types, system posts both the amounts related to both the tax types.
    User has to necessarily delete one tax type which is not required and then proceed with simulating the vendor invoice.
    Can this be controlled thru validation rules ? Even if the user forgets to delete the unwanted tax type while passing vendor invoice, validation rule must throw an error asking to delete the unwanted tax types before simulating the vendor invoice.
    Please help how to build such validation rule with detailed procedure.
    Thanks
    Ravi

    Hi Ravi,
    I hope you have selected both withholding tax type and code at the vendor master level itself.
    It is generally advisable to select withholding tax type at vendor master level and leave the field withholding tax code to be in display mode. Hence during vendor master creation, they can only select withholding tax type and not the withholding tax code. Ensure liable to tax should be ticked against all withholding tax types.
    During invoice entry creation either in FB60 or in MIRO, they can select the withholding tax code next to the withholding tax type and simulate and post.
    In your case, you cannot delete the withholding tax types at invoice entry level. Ensure to delete the unwanted withholding tax type from your vendor master itself, I mean delete only the withholding tax codes pertaining to that unwanted withholding tax type.
    Hope this helps. Assign points if useful
    Regards,
    Dwarak.

  • How can I use database constraints in entity attribute validation rules

    I am interested in using database constraints to validate attributes in entity objects.
    I would like to implement a JboValidatorInterface in a way that I can use an operator like "GreaterOrEqualTo" to compare with values retrieved from the database for a column associated with an entity object attribute.
    I have used this pattern with success in other environments, where the user community decides the minimum value for a thing should change from x to y, and simply changing a database object also changes the validation methods of all applications which access it.
    I am not certain that column constraints are the appropriate vehicle, but so far that seems to be the case.
    I see that you can create a validation rule which makes comparisons against a view object attribute. I am wondering if there is a generic way to use standardized names for column constraints along with ADF hooks into properties of database columns, to avoid writing individual queries for each attribute.
    Thanks in advance!!!

    Jeffrey,
    If you already have constraints on the underlying tables, why do you need to validate them in ADF BC? You can certainly use some framework extension classes to give the user nicely formatted error messages - see ER: ADF BC - allow custom error msgs for common exceptions (e.g. DML) for more details.
    I am using this method so that anything that is enforced in the database (check constraints, foreign keys, unique constraints, etc) are not enforced in the ADF BC layer as well - after all, there's more than one way to get data into a table, and DB constraints ensure that even if data gets in through another mechanism (apart from the ADF application), it is valid. My 2 cents, of course.
    Hope this helps,
    John

  • Validation Rule on Payment block

    Hi All,
    Need your expert advice on below scenario
    Specific users are allow to remove payment block of Document posted of specific vendors, can you please provide what logic I use in GGB0 Validation rule.
    Logic used by me is  under prerequisit:
    Company Code = '1100' AND Vendor = 'vendor Number' AND User Name <> 'User ID'
    under Check:
    Pmnt Block <> 'B'
    it is restricted user from editing payment block of posted document.

    Hi Revan,
    Your logic will work. It will have side effects - but if you take another approach, there will be others (perhaps more serious ones). So, I would suggest going ahead with it and see where it needs to be adjsuted.
    Let's list some of the drawbacks, so that you can address them if needed:
    * For example, no other user will be able to post or change anything on such a vendor item (not even Text, Assignment etc.) if the payment block is not set. I believe you have to live with it.
    * No other user will be able to reverse (trans. FB08 etc.) or unclear (trans. FBRA) such items if they are not blocked against payment. Blocking FBRA is perhaps OK, but I would strongly recommend excluding trans. FB08 from the prerequisites - it is usually a good practice to allow "everything" on reversal, so that any error can be corrected this way.
    * If the item is blocked with another indicator (e.g., "R" from logistics invoice verification) then the other users will not be able to do anything with it, either. Do you want the block type to be so specific? If not, then you may consider a blank block in the "check". But this is rather a detail.
    Lakshmi also had a good idea to include all such users (and perhaps vendors) in sets (with trans. GS01 / GS02) to make it more flexible to change them as employees move or new vendors become critical. This could however open a "back door" if the access to this set (these sets) is not properly controlled.
    I was also thinking about a different approach - to do it through authorization roles and profiles, but it would have much more drawbacks (e.g. with object Accounting Document: Account Authorization for Vendors (F_BKPF_BEK) - only the priviledged group would be able to perform specific actions on such vendor items, whether or not they would be blocked - which would be harsher than you design). So, you are trying the right approach, but it may just be needed to finetune it a little (put some more prerequisites, such as "exclude FB08"). You do it the right way, I believe.
    Good luck!

  • CO validation rule for cost center

    we want system to show error message when user post to cost center other than 1111 for GL account between 540000 to 541000, how to define the validation rule?

    You can put FI validation (Ob28) , give restriction to co code BSEG-BUKRS ( for your co code ) and BSEH-HKONT  ( for GL account for you want to restrict) and have check on BSEG-KOSTL and then assign the error message.
    Regards
    Ranjan

  • Validation rule for/against intercompany reporting

    Hi,
    I need a validation rule which checks that a cons unit does not report intercompany against itself.
    Validation should be on individual data records.
    Have checked various options, no success so far.
    Have you got any hints? thx, Clemens

    The only standard validation I can imagine for this is to include each cons unit as a check to ensure the same value is not used for trading partner. This will be an expensive validation is there are many cons units.
    Another idea is to use a custom task with code to check this.
    Another idea is to include a check for this in the update rules as part of the initial data extraction (if using load from data stream).

  • Validation rule using list

    i had x eo
    i make enity validator rule type : list
    rule definition from : city from
    operator: in
    List type query result :
    query:
    Select * From Bus_Trip_Benefits
          Where Btb_City_From = :pbtr_City_From And
          :pbtr_Rqst_Date Between Btb_Eff_From And Btb_Eff_To And Btb_Bu=:pbu3
    :pbtr_City_From
    :pbtr_Rqst_Dateboth are run time values. how do i check entered data should present in query result.
    can anyone come with an example/

    Hi,
    if you validate against a query, why don't you use a LOV for users to choose from this list ?
    Here's a doc that explains how to filter LOVs https://blogs.oracle.com/jdevotnharvest/entry/how_to_dynamically_filter_model If you hide the LOV query panel (which you can do declaratively) then users wont be able to override your query filter.
    Frank

  • GGB0 Validation Rule for Transaction CO88

    Scenario: In transaction CO88 if user do not specify the posting date SAP default it to last date of period. We want posting date to be system date. Since posting date entry come under the menu Extra and is not mandatory user sometimes executes the transaction without specifying posting date which then result in posting date as last day of period.
    To avoid this I was trying to create validation rule in GGB0 under 'Cost Accounting'->'Document header' and 'Financial Accounting'->'Document Header', but it seems non of above is working.
    Validation are
    Prerequisite : SYST-TCODE = 'CO88'
    Check : BKPF-BUDAT <> SYST-DATUM
    Message : Error message
    After creating the validation I am executing CO88 in test mode, but no error message.
    Am I creating validation under right node in GGB0 or missing anything.

    Message executes when Prerequisite is met and Check fails.
    Check should be BKPF-BUDAT = SYST-DATUM

Maybe you are looking for

  • Itunes wont open windows 7 tried everything online

    hi my itunes wont open at all on windows 7 it worked at first but now not at all. i have tried every fix i can find online and nothing. -checked if it was user -checked quicktime -tried opening in safe mode -uninstalled several times -checked roaming

  • Win 8.1 update with MSI GX70 issues

    Hello people. I recently updated my MSI GX70-3BE from win 8 to win 8.1 pro (update from store, not clean install), along with numbers of new driver supplied by MSI (VGA, SCM, killer network, etc.) and BIOS (w8_E176KAMS.50D) + EC (w8_176KEMS1.505) Now

  • 6i help needed!!!

    n reports 6i is there any difference in architecture between using run_product and srw.run_report(which according to 6i doc calls rwrun60.exe)? The reason is I that have the same report submitted by the above two processes produce font difference in

  • Premiere pro project suddenly degraded

    My 50-minute Premiere Pro project suddenly degraded between work sessions. It contains mixed footage - mov files the smallest and the sequence settings match that - and dv footage. It looked perfect, but when it was opened to resume work on another d

  • Why does "NI LabVIEW Run-Time Engine 6.1" window appear when I start LabVIEW?

    it also prompts "insert the 'NI LabVIEW Run-Time Engine 6.1' disk. Attachments: windows.jpg ‏26 KB