Can I prevent multiple line inserts?

Hi everybody
I wrote a form-personalization to prevent duplicate receipt numbers (just receipt numbers, forget about amount, currency and customer) in AR.
It works perfectly... only if user save each receipt after typing.
It seems that users can enter many receipts before clicking Save button, then all records are saved in one step... if a user enters same receipt number BEFORE saving, validation doesn't work because offending receipt is not inserted in table yet.
Is there a way to force saving each receipt or disable this 'feature'?.
Thanks in advance
Oscar

I am sure you can achieve this. Use following:
I had a similar kind of requirement, where I was validating some sequence values.
1) extend the CO of your page where you want to achieve this.
2) Capture the Save button event in that CO.
3) In that button capturing, call a method in AM.
4) That method you will have to add in AM, by extending AM.
Here is the sample code for that AM.
public void ValidateSequence() {
OAViewObject vo = (OAViewObject)findViewObject("XXBCR12ToolkitVO1");
int rowcount = vo.getRowCount();
String sequence[] = new String[rowcount];
RowSetIterator SeqIterator;
XXBCR12ToolkitVORowImpl row = null;
SeqIterator = vo.createRowSetIterator("SeqIterator");
SeqIterator.setRangeStart(0);
SeqIterator.setRangeSize(rowcount);
for (int i = 0; i < rowcount; i++) {
row = (XXBCR12ToolkitVORowImpl)SeqIterator.getRowAtRangeIndex(i);
if (row.getAttribute("LegacyColumnSeqNum") != null)
sequence[i] =
row.getAttribute("LegacyColumnSeqNum").toString();
for (int i = 0; i < rowcount; i++) {
for (int j = i + 1; j < rowcount; j++) {
//System.out.println("Main "+sequence[i]+sequence[j]);
if (sequence[i] != null) {
if (sequence.equals(sequence[j])) {
throw new OAException("Sequence value duplicated. Please enter unique sequence number for " +
sequence[i], (byte)0);
} else {

Similar Messages

  • How can I use multiple row insert or update into DB in JSP?

    Hi all,
    pls help for my question.
    "How can I use multiple rows insert or update into DB in JSP?"
    I mean I will insert or update the multiple records like grid component. All the data I enter will go into the DB.
    With thanks,

    That isn't true. Different SQL databases have
    different capabilities and use different syntax, That's true - every database has its own quirks and extensions. No disagreement there. But they all follow ANSI SQL for CRUD operations. Since the OP said they wanted to do INSERTs and UPDATEs in batches, I assumed that ANSI SQL was sufficient.
    I'd argue that it's best to use ANSI SQL as much as possible, especially if you want your JDBC code to be portable between databases.
    and there are also a lot of different ways of talking to
    SQL databases that are possible in JSP, from using
    plain old java.sql.* in scriptlets to using the
    jstlsql taglib. I've done maintenance on both, and
    they are as different as night and day.Right, because you don't maintain JSP and Java classes the same way. No news there. Both java.sql and JSTL sql taglib are both based on SQL and JDBC. Same difference, except that one uses tags and the other doesn't. Both are Java JDBC code in the end.
    Well, sure. As long as you only want to update rows
    with the same value in column 2. I had the impression
    he wanted to update a whole table. If he only meant
    update all rows with the same value in a given column
    with the same value, that's trivial. All updates do
    that. But as far as I know there's know way to update
    more than one row where the values are different.I used this as an example to demonstrate that it's possible to UPDATE more than one row at a time. If I have 1,000 rows, and each one is a separate UPDATE statement that's unique from all the others, I guess I'd have to write 1,000 UPDATE statements. It's possible to have them all either succeed or fail as a single unit of work. I'm pointing out transaction, because they weren't coming up in the discussion.
    Unless you're using MySQL, for instance. I only have
    experience with MySQL and M$ SQL Server, so I don't
    know what PostgreSQL, Oracle, Sybase, DB2 and all the
    rest are capable of, but I know for sure that MySQL
    can insert multiple rows while SQL Server can't (or at
    least I've never seen the syntax for doing it if it
    does).Right, but this syntax seems to be specific to MySQL The moment you use it, you're locked into MySQL. There are other ways to accomplish the same thing with ANSI SQL.
    Don't assume that all SQL databases are the same.
    They're not, and it can really screw you up badly if
    you assume you can deploy a project you've developed
    with one database in an environment where you have to
    use a different one. Even different versions of the
    same database can have huge differences. I recommend
    you get a copy of the O'Reilly book, SQL in a
    Nutshell. It covers the most common DBMSes and does a
    good job of pointing out the differences.Yes, I understand that.
    It's funny that you're telling me not to assume that all SQL databases are the same. You're the one who's proposing that the OP use a MySQL-specific extension.
    I haven't looked at the MySQL docs to find out how the syntax you're suggesting works. What if one value set INSERT succeeds and the next one fails? Does MySQL roll back the successful INSERT? Is the unit of work under the JDBC driver's control with autoCommit?
    The OP is free to follow your suggestion. I'm pointing out that there are transactions for units of work and ANSI SQL ways to accomplish the same thing.

  • An you tell me how to add an advanced action to the TEB so you can check for multiple lines of input

    an you tell me how to add an advanced action to the TEB so you can check for multiple lines of input? How do you add the advanced action?

    Can you elaborate your requirement?
    If you want to have a text wrapped around and enable a scroller for the same, you can achieve it by TEB properties and check the scroll bar option,
    Is this what you are looking to achieve?
    Thanks,
    Anjaneai

  • How can I print multiple lines in my All Day Events (month view)?

    Does anyone know if there is anyway to print multiple lines for all day events? When I print my iCal from a monthly view, my all day events (positioned as a header) only print the words that can fit into the daily box, instead of going into multiple lines and displaying the whole text.
    For example:
    Los Angeles County Fair, Don't forget to pick up John and Jen
    will print as:
    Los Angeles County Fa......Jen
    Anyone have any idea how to solve this?
    P.S. I have already tried meddling with fonts and page sizes to no avail.

    Welcome to Apple Discussions!
    So far as I know, an allday event only ever shows a single line of text regardless of view.
    Consequently, how much you can see is governed by the width of the day (or days) in that view.

  • Can we draw multiple lines on a single CAShapeLayer?

    I want to draw multiple lines on a single layer of CAShapeLayer by UITouch. Is it possible?

    if they use the same appleID then you can do it at www.icloud.com

  • Same material can exist on multiple line items for the same order.

    Hi
    Is there any specific customising setting or web shop setting through which we can restrict user to add same material on multiple line items for the same order ?
    Regards

    No.
    But if this is a must requirement, you can do an elaborate check during order save in ORDER_SAVE BAdI and return error. So, it will be only during order save.
    Eawar Ram
    http://www.parxlns.com

  • Anybody know where I can find Draw Multiple Lines.vi?

    I don't mean the actual function itself. I know you just right-click and scroll through the menus for that. But I want to find a VI that showcases how the Draw Multiple Lines.vi is used. As of yet I can't find one anywhere. I've read the Detailed Help that Labview provides when I look at the function under Context Help, and it mostly makes sense. The only thing that's not working is how to implement the array that provides the line points into the function. I tried connecting a 1D array to the function and it was no dice. I get the quentessential error:
    You have connected two terminals of a different type. The source is 1D array of double. The sink is 1D array of cluster of 2 elements.
    So I know there is a special array called a Cluster Array, I think. Does it want me to attach that instead?

    ShogunOrta wrote:
    I just want to programmatically draw a line on the Front Panel from point A to point B. That's all.
    You can only do it with the restriction that it has to be bounded to a picture indicator. To draw anywhere on the front panel, we would need this idea implemented.
    A plain 1D array does not define points because each point has an x and a y.  Hierarchical data structure are actually quite easy once you play a little bit with them.

  • How can I have multiple lines in a table cell???

    hi
    how can I separate lines in a table cell in LV5.1.1??
    EndOfLine doesn't work, neither does CR or LF..
    has anybody an idea???
    thanks

    thanks.. but there is nothing like "multi line input" in my LV (5.1.1).. I think it might be impossible to
    do it in 5.1.1, it's really time to upgrade ;-)
    cheers

  • CS6 - Can't draw multiple lines with the same starting point consecutively without an extended pause between strokes. Ruins hatching and writing certain letters ("i" "E" etc.). Is this a normal limitation of flash?

    Question is in the title. I animate in a traditional style (frame-by-frame) and draw a lot. When I animated in photoshop, the only annoyance was that the interface was terrible in terms of animation flexibility, but performed so much better in terms of actually drawing the frames. I invested in flash because I've heard that it really speeds up the animation workflow, but I'm getting quite irritated by this bug. I never read about it in reviews, and it's not something that I've gotten results for by googling, so I'd really like to know. Is this a normal issue in flash? Or is this something that I can fix?  I've been trying to deal with it for a few weeks now but it's reaching a point where I just can't tolerate it anymore. I know I'm posting this in the CC community but I'd really really appreciate it if someone had a fix for this that I wasn't aware of, because otherwise I've wasted a lot of money.

    Question is in the title. I animate in a traditional style (frame-by-frame) and draw a lot. When I animated in photoshop, the only annoyance was that the interface was terrible in terms of animation flexibility, but performed so much better in terms of actually drawing the frames. I invested in flash because I've heard that it really speeds up the animation workflow, but I'm getting quite irritated by this bug. I never read about it in reviews, and it's not something that I've gotten results for by googling, so I'd really like to know. Is this a normal issue in flash? Or is this something that I can fix?  I've been trying to deal with it for a few weeks now but it's reaching a point where I just can't tolerate it anymore. I know I'm posting this in the CC community but I'd really really appreciate it if someone had a fix for this that I wasn't aware of, because otherwise I've wasted a lot of money.

  • Multiple lines in Ad Hoc query

    I am working on a query for the Benefits team. In my output with other details I also want the SSN no. of Dependents. The SSN no is stored in IT0106 and the dependent information in iT0021 and IT0167. I created an Infoset and added IT0106, when I select SSN as output I get 4 lines for each dependent. E.g. one employee has 2 child, so the output has total 5 rows including the employee. How can i prevent multiple rows to be displayed.
    Points will be rewarded for helpful answer.
    Sanghamitra

    Try mapping/joining the begin date & end date from IT0021 & IT0106.
    Regards
    Ravikumar

  • How to draw multiple lines on same panel??

    hiya
    i would like to know how can I draw multiple lines on the same panel ?? I have already use repaint(); but it just come out the lastest line (say line 3) i draw .......those previous lines(say line 1 and 2) are disappear ........
    Thanks for your help mate

    http://www.java2s.com/ExampleCode/2D-Graphics/Line.htm

  • One line item in po from multiple line items of Purchase Requisition

    Can we merge multiple line items for same item from different different purchase requisition into a single line item in Purchase Order ?
    For example, say department A and B made two different purchase requisition for 1 number of computer system. Now the purchaser viewed these requisitions and he want to make a purchase order to party X for 2 no of computer system. Now how he can do this in Oracle Purchasing.
    Regards
    Edited by: Saroj.Dash on May 31, 2010 6:02 AM

    Hi !
    thanx to all for your responses.
    But, let me explain better.
    Say Dept A raises an Requisition (Req No: 1 ) for 5 Chairs. In the same time Dept. B raises requisition (req no: 2 ) for 10 chairs.
    Now Purchase Dept. wants to make an PO to procure chair with respective to these 2 requisitions i.e. req no 1 from dept A and req no 2 from Dept B.
    Now my query is that, can the purchase dept. prepare a PO with 1 line item only i.e. for chair (5+10) of 15 numbers from these requisitions of dept A and B ?
    If yes then how ?
    Regards

  • Using ME57 to create an RFQ from multiple lines on multiple PRs

    When using ME57 to create RFQs how can I select multiple line items from multiple purchase requisitions to turn into a single RFQ. If I select multiple lines and then use 'RFQ with Vendor', it only selects one line item.  After further research it appears that you can only create only line at a time (very time consuming). 
    If you use ME41 and create with reference to PR then you can not sort or filter columns to allow for easy consolidation.
    Another forum recommended the following when using ME57 which works but it again adds extra steps to the process.
         The whole process is as follows -
         1) When you are in the 'Assign and Process Purchase Requisition' screen, select related PR and then click on 'Without Vendor' icon to flag all PRs for RFQ processing.
         2) Select these PRs again and click further on 'Assignment Overview' icon (Shift and F5). The next screen will appear - Assign and Process requisitions - Overview of Assignments screen.
         3) Select the 'PReq' column and then click further on 'Process Assignment' icon (F2). The next screen will appear where you have to maintain the 'quotation deadline' information.
         4) Then click on 'Continue' icon (enter).
    [http://www.sapfans.com/forums/viewtopic.php?f=6&t=198768]
    So is there any way to either 1) enable sorting of data in ME41 or 2) use ME57 to create one RFQ from multiple line items of multiple purchase requisitions when selecting 'RFQ with Vendor'.

    What is the JPEG specs? What are the specs of the project you're working in?

  • SAP Query with Multiple lines

    HI Team,
    Can we create multiple lines in an SAP Query? If yes, how (pls explain the steps)?
    Like can we have a line for the employee, next for spouse & then the next for child, so on...and then the next employee details.
    Also, there might be fields which will repeat in most of these lines for each employee.
    Thanks
    RL

    Hi RL:
    HR module have PA0021 table (HR Master Record: Infotype 0021 (Family), with this table into TCODE: SQ02  is naturally obtain the result that you ask, or Do you are customizing "Z" program with ALV?
    Regards
    José Luis

  • Multiple Lines in Header of ALV

    Hi Friends,
    In Program SALV_DEMO_HIERSEQ_FORM_EVENTS. We have Header as TOP_OF_LIST. Can we have multiple lines as the header?
    We are using cl_salv_hierseq_table.
    Thanks in advance for all the suggestions.
    Regards,
    Lijo Joseph
    Message was edited by:
            Lijo Vazhappilly

    Hi,
    No its not possible to have multiple headers in ALV. This has been discussed many times in the forum. You can do a search and find out the details. But its basically not possible to have multiple headers.
    Cheers
    VJ

Maybe you are looking for

  • IPhone wont connect to iTunes, please help!

    Hi guys every time I connect my iPhone to the computer, iTunes doesn't seem to see it. I was getting an error about corefoundation.dll couldn't be found or something and found that another forum user said if i were to uninstall mobilemecontrolpanel t

  • Is anyone having problems with the iPhone 5 motion sensors?

    I having a problem with my phone when it comes to reading movement, the compass doesn't work when it asks to tilt phone to calibrate and in some games it doesn't read when I tilt the phone. I read that apple had a lot of customer complaints about bad

  • Gnome-settings completely vanished in gnome 3.2 [SOLVED]

    Hi everyone, I am currently experiencing the following problem: It seems that my gnome-settings icon has been lost and I can't play around with my settings anymore. I also tried launching the settings daemon from the console using the command below b

  • I can't reject call from this number : 00 000000000

    Hi, Can someone help me with this ? I've got an iPhone 4S with a french mobile phone operator. Twice a day, I receive a call from this number : 00 000000000 (only zeros). I can't reject the call, and there is never a message left on my voicemail. My

  • Drop down list in alv tree

    Hi, I am developing an ALV TREE. I need help Its really urgent. In the output screen there will be 2 level nodes. in the item line 1 field should be input enabled using which the database table is to be modified.when user left clicks on this field a