Converting simple statements to prepared statements...

hi all,
how can i convert this update statement to a prepared statement...?
// this will append 'newData'
// to the current value of colName
UPDATE table
SET colName = colName + 'newData'
WHERE colID = 1
// i tried using this, as the tutorial says that
// just replace your values with a '?' but it
// doesn't work... how do i make it work???
PreparedStatement updateStmt = con.prepareStatement( "UPDATE table
SET colName = colName + ?
WHERE colID = ?" );
updateStmt.setString( 1, "newData" );
updateStmt.setInt( 2, 1 );
updateStmt.executeUpdate();
thanks in advance!

You should try the following:
PreparedStatement updateStmt = con.prepareStatement( "UPDATE table SET colName = ? WHERE colID = ?" );
updateStmt.setString( 1, colName +"newData" );
updateStmt.setInt( 2, 1 );
updateStmt.executeUpdate();
con.commit();
Your row with colID=1 should be updated, assuming you have the appropriate tablename and column names in the sql.

Similar Messages

  • Convert SQL statements to JAVA Code ?

    Using SQL queries Can I convert SQL statements to JAVA Code ?
    Edited by: user11238895 on Jun 7, 2009 10:54 PM
    Edited by: user11238895 on Jun 7, 2009 11:12 PM

    Me very new to Oracle.
    can we convert SQL Queries to JAVA Code using simple built in SQL queries ?
    Which SWISS SQL Tool does [Converting SQL Queries to JAVA Code]

  • How to convert switch statement into iif than else statement in SSRS

    Hi All;
    How do i convert switch statement into iif statement in ssrs
    =
    Switch(
    Fields!createdonValue.Value = Now(), "Today",
    Fields!createdonValue.Value = DateAdd("d",-1,Today()),"Yesterday",
    Fields!createdonValue.Value >= FORMATDATETIME(DateAdd(DateInterval.Day, -6,DateAdd(DateInterval.Day, 1-Weekday(today),Today)),DATEFORMAT.ShortDate) and
    Fields!createdonValue.Value <= FORMATDATETIME(DateAdd(DateInterval.Day, -0,DateAdd(DateInterval.Day, 1-Weekday(today),Today)),DATEFORMAT.ShortDate),"Last Week",
    Fields!createdonValue.Value >= FORMATDATETIME(DateAdd(DateInterval.Day, -13,DateAdd(DateInterval.Day, 1-Weekday(today),Today)),DATEFORMAT.ShortDate) and
    Fields!createdonValue.Value <= FORMATDATETIME(DateAdd(DateInterval.Day, -0,DateAdd(DateInterval.Day, 1-Weekday(today),Today)),DATEFORMAT.ShortDate),"Last Fortnight",
    Fields!createdonValue.Value >= DateValue(DateAdd("M",-1,DateAdd("D",-(Day(Now)-1),Now))) and
    Fields!createdonValue.Value <= DateValue(DateAdd("D",-1,DateAdd("D",-(Day(Now)-1),Now))),"Last Month",
    Fields!createdonValue.Value >= DateSerial(Year(Now()), 1, 1) and
    Fields!createdonValue.Value <= DateSerial(Year(Now()), 12, 31),"Year to Date"
    Any help much appreciated
    Thanks
    Pradnya07

    Not sure why you want to se IIF as Switch is more compact
    Anyways it will look like this
    =IIf(
    Fields!createdonValue.Value = Now(), "Today",IIf(
    Fields!createdonValue.Value = DateAdd("d",-1,Today()),"Yesterday",Iif(
    Fields!createdonValue.Value >= FORMATDATETIME(DateAdd(DateInterval.Day, -6,DateAdd(DateInterval.Day, 1-Weekday(today),Today)),DATEFORMAT.ShortDate) and
    Fields!createdonValue.Value <= FORMATDATETIME(DateAdd(DateInterval.Day, -0,DateAdd(DateInterval.Day, 1-Weekday(today),Today)),DATEFORMAT.ShortDate),"Last Week",IIf(
    Fields!createdonValue.Value >= FORMATDATETIME(DateAdd(DateInterval.Day, -13,DateAdd(DateInterval.Day, 1-Weekday(today),Today)),DATEFORMAT.ShortDate) and
    Fields!createdonValue.Value <= FORMATDATETIME(DateAdd(DateInterval.Day, -0,DateAdd(DateInterval.Day, 1-Weekday(today),Today)),DATEFORMAT.ShortDate),"Last Fortnight",IIf(
    Fields!createdonValue.Value >= DateValue(DateAdd("M",-1,DateAdd("D",-(Day(Now)-1),Now))) and
    Fields!createdonValue.Value <= DateValue(DateAdd("D",-1,DateAdd("D",-(Day(Now)-1),Now))),"Last Month",IIf(
    Fields!createdonValue.Value >= DateSerial(Year(Now()), 1, 1) and
    Fields!createdonValue.Value <= DateSerial(Year(Now()), 12, 31),"Year to Date")))))
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Simple State Machine Vs Queued State Machine

    Using LV2009 + WIN7+Pentium 4 @ 2.5Ghz with 3 GB RAM.
    I have a machine control code inside a 10mS main loop that has 7 ( yes seven ) Queued State Machines (  QSM) and I find the  Finished Late boolen keeeps poppping often. Not a very good sign if you ask me.
    And the code itself does not have too much of computation or FP activity. But it has four Graphs with one plot on each of them. These are updated once every 10ms. Can slowing this update ( say once every 250ms ? ) help ? 
    A simple query : In terms of performance overhead, does a QSM  demand more than a  Simple State Machine ( SSM ) ? Can I avoid the Finished Late warning by switching over to SSM at least in three of the cases out of the seven ?
    Thanks 
    Raghunathan
    LV2012 to Automate Hydraulic Test rigs.

    I think your question demonstrates my point.  Unfortunately, I don't have a good example to point you to and don't have the time to write one.  I will try to explain better.  Let's take a simple example - a landscape watering controller (sprinkler controller).  This controller will have several states (e.g. initializing, waiting, watering, closing). Each of these states will accept several commands, but not all commands are accepted in all states.  For example, if the system is watering, a command to start watering could be ignored.
    In most programs, at least some states should be interruptible.  For example, if it starts to rain, the watering system should stop watering immediately instead of watering for a set length of time.  However, if the system is in the initialization state, this will probably not be interruptible (but also short).
    As you said, the classic LabVIEW way to implement such a thing is to have a case statement to represent the state, and a case statement (usually queue driven) in each state frame to handle the commands.  You thus have a loop with a double case structure.  This can get somewhat unwieldy for large programs.  Note that which case structure represents what will be determined by the relative number of each item. For example, if you have fifty commands and three states, the state should go into the command case.
    So how do LabVIEW classes help?  They can eliminate one or both levels of these case structures through the use of dynamic dispatch.  This is done as follows.  A parent class is created that is a generic command.  It has commands for each state.  For each actual command, a class is derived from the parent class.  There are VIs in the specific command class for each state.  A command is generated by creating the correct object for the current state, then calling the parent class command.  Dynamic dispatch will execute the code for the correct command.  The command execution loop is then reduced to a single command VI which dynamically dispatches based on the actual command and the current state.
    In practice, things as usually not quite this simple, and you may want different cases for either different commands or different states so that you can change the connector pane of the dynamically dispatched VI as needed.  Look up the LabVIEW examples on dynamic dispatch to see this in action.
    I am afraid I have still not made myself clear.  Keep asking questions and I will try to keep answering.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • How to convert simple SQL Select statements into Stored Procedures?

    Hi,
    How can I convert following SELECT statement into a Stored Procedure?
    SELECT a.empno, b.deptno
    FROM emp a, dept b
    WHERE a.deptno=b.deptno;
    Thanking in advance.
    Wajid

    stored procedure is nothing but a named PL/SQL block
    so you can do it like this see below example
    SQL> create or replace procedure emp_details is
      2  cursor c1 is SELECT a.empno, b.deptno
      3  FROM scott.emp a, scott.dept b
      4  WHERE a.deptno=b.deptno;
      5  begin for c2 in c1
      6  LOOP
      7  dbms_output.put_line('name is '||c2.empno);
      8  dbms_output.put_line('deptno is ' ||c2.deptno);
      9  END LOOP;
    10  END;
    11  /
    Procedure created.and to call it use like below
    SQL> begin
      2  emp_details;
      3  end;
      4  /
    PL/SQL procedure successfully completed.
    SQL> set serveroutput on;
    SQL> /
    empno is 7839
    deptno is 10
    empno is 7698
    deptno is 30
    empno is 7782
    deptno is 10
    empno is 7566
    deptno is 20
    empno is 7654
    deptno is 30
    empno is 7499
    deptno is 30
    empno is 7844
    deptno is 30
    empno is 7900
    deptno is 30
    empno is 7521
    deptno is 30
    empno is 7902
    deptno is 20
    empno is 7369
    deptno is 20
    empno is 7788
    deptno is 20
    empno is 7876
    deptno is 20
    empno is 7934
    deptno is 10Edited by: Qwerty on Sep 17, 2009 8:37 PM

  • Converted Crystal Statement Report not showing line level data properly

    Hi all,
    We have an issue with a Cystral-converted PLD Customer Statement layout behaving strangely when printing for a customer with multiple pages.
    When the statements are printed for a customer that has line level data which fills about an A4 page, this print absolutely fine; customer header data, line data etc. However, when we print for a customer that has more lines that can fit onto the one page, Crystal does the following:
    Page 1 - Customer Header info and column headers (OK); Line level info until bottom of page (OK)
    Page 2 - Customer Header info and column headers (MISSING); Line level info (ONLY ONE LINE APPEARS INDIVIDUALLY ON THIS PAGE BUT IS THE NEXT LINE CONTINUING FROM FROM THE PREVIOUS PAGE)
    Page 3 - Customer Header info and column headers (OK); Line level info until bottom of page (OK - CONTINUING FROM THE INDIVIDUAL LINE FROM THE PREVIOUS PAGE)
    Page 4 - Customer Header info and column headers (MISSING); Line level info (ONLY ONE LINE APPEARS INDIVIDUALLY ON THIS PAGE BUT IS THE NEXT LINE CONTINUING FROM FROM THE PREVIOUS PAGE)
    etc...
    So what basically seems to be happening is that every other page, Crystal just sticks in an individual line on it's own without any headers or anything OR other lines.
    Help please! Quite likely a 'Section Expert' issue but we don't know what setting could be causing this.

    Sounds like the report is trying to print multiple pages with blank pages in between, is the normal report ie details fit onto an A4 page printing with a blank back page?
    It will be page number resets and suppression of details on pagenumber = 2
    YOu need to go to section expert and go through each section noting what conditions have been suppressed and if any formula boxes are red then open and see what they do.
    Try turn conditions on and off and commenting out any formula conditiona and see what happens. By a process of elimination you should be able to work it out. However, you may have to stop the introduction of a blank page some how.
    Ian

  • Converting SQL statements from MS server 2000 to Oracle 10g

    We are moving over from MS server 2000 to Oracle 10g as our database for Peoplesoft system.
    There are several embedded SQL statements that I need to investigate to see what needs converting.
    So far I can see a need to convert the following:
    Dates.     GetDate() to ?
    Outer joins. *= to LEFT OUTER JOIN
    Has anyone else done a similar exercise and what other functions do I need to convert?
    Thanks.

    Hello
    A quick google search (http://www.google.co.uk/search?hl=en&q=ms+sql+server+oracle+differences&spell=1)
    came up with this:
    http://dba-oracle.com/oracle_news/2005_12_16_sql_syntax_differences.htm
    There's a quite a few more sites listed.
    HTH
    David

  • Convert TDAmeritrade statements to Excel

    Can Adobe ExportPDF convert TDAmeritrade monthly account statements into Excel?

    It should be able to, though many brokerage houses offer Excel or CSV versions of statements already.

  • Simple state machine Where to begin?

    Hello
    Got a question that is simple for the experienced people here I guess. But don't know where to start..... Here is what I want to try to do:
    I have got a lot of inputs, to keep the question simple I have only drawn a few of them but eventually there will be tens of inputs. For now I will only use the front panel and no real IO box (hardware), just to see if I can make a State machine that can handle this "problem" in a organized / proper way.
    What I want is to do is read a sensor, for example sensor B1 and multiply it with the multiplication factor (column Process input) and show the result on the front panel.
    There will be different types of sensors, some need multiplication, others sensors need just a constant be added to the input before the result is shown in the Result column etc.Of every sensor there will be a lot, so just wiring them all in one place will create chaos, and I don't like chaos (only dr chaos in South park is fun but I would not have him in my labview code either).
    Can anyone tell me how to approach this "problem" ?
    Thank you for the advice!!

    Hello altenbach,
    thank you for your reply,
    I think the question might not have been completely clear. I can devide the question in different parts I think. I will give it a try lets see
    (1)There Will be a lot of sensors and a lot of different type of sensors. There will be sensors that behave:
    (A)as a switch Called them Type A in the picture
    (B)as a voltage source For example mV per degree celcius
    and then there are more
    (C)sensors that behave as a current source
    (D)and a other type of sensor
    ow noooo there are more
    and even more
    (K)sensors that have got a voltage output but measure something else as B for example a distance.
    Of every type of sensor there will be more than 1 sensors. So there could be 10 sensors of type A 8 of type B 15 of type C etc. It would also be nice to ad or remove a sensor after a while.
    The sensors need to have a usefull name. Like "Temperature in chamber A". I want to be able to use this name everywhere in the code. So I if I need to process the "Temperature in chamber A" I want to have a human readable name. (type def?).
    I think I need to have a other name to indentiefie what kind of sensor it is: temperature, distance etc. This would make it easier to make a subfunction or SM deciding how to handle this information.
    So I think the question should be how can I make a big highway of data comming out of the front pannel in one wire, If I have wire's A till K the code will become unreadable. I was thinking of some kind a arry of strucs?
    I tried to keep the qestion as simple as possible at first but maybe it made it too unclear I think the question might sugest it will stay a simple program but it will not, it is just a first step.
    The first step I want to try is to just multiply a voltage with a number (just to test the functioning of the supper-highway of data).
    If I know that that works I will try this superhighway of data in a State machine then the value will to be prosseced in different ways.
    After that I hope to have the Hardware IO It is a NON FPGA frame with a few cards in it from NI, cabable of measuring digital IO analog IO etc analog output etc. So at that point the frontpannel will be party replaced for the HArdware IO. As I want to test the software in different stages of development I first wanted to start simple so I could test the written software in different stages of development.
    So can anyone tell me how to get this supperhighway of data out of the fron pannel?
    I hope the question is a clear, if not just ask.
    Thank you for the help so far!!

  • Converting MERGE Statements into Mappings

    Hello All,
    I am an Oracle DBA. New to Oracle Warehouse Builder.
    Now working in Oracle Warehouse Builder 10G R2.
    We have merge statements which needs to be converted into Oracle Warehouse Builder Mappings.
    I created mappings and process flows and deployed the same.
    When i start the process flow it inserted say 150 records to the target table. But when i start the process flow again the number of records becames double.
    How can i use the functionality of merge statement in this case.
    Thanks,
    Salih KM

    Hi,
    When you click on the target table, on the left side panel you will have the option to choose whether to use one of the available constraints on the target table to match on while merging.
    If you do not hav any constraint defined, then choose "No Constraints". Then you have to click on each of the attribute you need to match on, and then from the left panel, select Yes for "Match while updating".
    That should do it.
    HTH
    Mahesh

  • Simple Statement w/ subreport prints multiple pages

    Hello all,
    I have a CR 2008 migrated from older version (CRW 32 6,0,1,135  with VB6 driving the report) that is printing multiple pages when it should be only printing 1 page.
    This report is a Statement that shows customer info and account balances. It has a subreport that typically prints 1 line of report data on each Statement. However, some customers can have 2 or 3 records printed in the subreport. And in the past this all worked fine - it printed 1 page for the Statement even if there were more than 1 record in the subreport.
    After converting to CR 2008 (I did successfully implement SP1 then SP2 after a lot of confusion, then joined this forum - thanks much!) the Statement now prints multiple (identical) pages based on how many records are in the subreport data. I've played with it by testing with customers who had 3 records in the subreport and it generates 3 pages. I've tried modifying the Section control values like "Keep together" and others with no success. We are using VB.Net 2008 now to drive the report.
    If anyone has any ideas or suggestions, I really would appreciate your input. I'm not an expert with CR by any means but I have developed about 40 or so reports over the years and have a decent working knowledge.
    Thanks for anything you may be able to offer.
    Chris

    That's a big jump from CR 6 to 2008.
    It may be easier to just rebuild your report from the beginning rather than trying to fix this one.
    Typically most update a few versions at a time and the import portion of the code can handle the updating relatively the same version. Cr 2008 is now UNICODE and completely different file format.
    Thank you
    Don

  • Converting SELECT Statement into UPDATE

    Hi All,
    Running SQL Server 2008 R2.  I have the following SELECT query, which is returning the desired results.
    SELECT DISTINCT
    [x].[AccountNo],
    [x].[AvgAccountLen],
    CASE
    WHEN LEN([AccountNo]) > 6 THEN LEFT([AccountNo], 6)
    ELSE [AccountNo] + REPLICATE('0', [AvgAccountLen] - LEN([AccountNo]))
    END AS [NewAccountNo]
    FROM
    SELECT DISTINCT
    [AccountNo],
    SELECT TOP 1
    LEN([AccountNo])
    FROM
    [dbo].[Table]
    WHERE
    [AccountNo] > 0
    GROUP BY
    [AccountNo]
    ORDER BY
    COUNT(*) DESC
    ) AS [AvgAccountLen]
    FROM
    [dbo].[Table]
    ) AS [x]
    WHERE
    LEN([AccountNo]) <> [AvgAccountLen]
    Below are results, which again are what I'm looking for.
    AccountNo AvgAccountLen NewAccountNo
    4200 6 420000
    4250 6 425000
    42000 6 420000
    4030 6 403000
    4460 6 446000
    4250000 6 425000
    4520000 6 452000
    Long story short is that I've been left to clean up a partially-completed task.  I need to conduct an update on Table that pads (or trims) the account numbers accordingly.  Further, this process affects multiple entities which is why I can't simply
    use a static pad/trim value of 6 (this particular entity returns 6, there could be other entities with 4, 8, etc.).  AvgAccountLen may not be the most appropriate column name either - it's a representation of the most frequently-occurring value length
    (I have already confirmed that the result returned for this value is correct in each entity).  How would I go about writing a UPDATE statement to accomplish this?
    Any help is greatly appreciated!
    Best Regards
    Brad

    Can you provide your example data as a table to compliment your expected result?
    I'm thinking something like this may help:
    DECLARE @accounts TABLE (accountNo INT, avgAccountLen INT, newAccountNumber INT)
    INSERT INTO @accounts (accountNo, avgAccountLen) VALUES
    (4200 , 6),
    (4250 , 6),
    (42000 , 6),
    (4030 , 6),
    (4460 , 6),
    (4250000, 6),
    (4520000, 6)
    UPDATE @accounts
    SET newAccountNumber = LEFT(CAST(accountNo AS VARCHAR)+REPLICATE('0',avgAccountLen),avgAccountLen)
    FROM @accounts
    SELECT *
    FROM @accounts
    Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question.

  • Just need some simple stats :)

    I've been using Microsoft's "Excel Lite" program for a few years. I don't even know what it's called, but its performance is more limited than Excel, which I've never used.
    I've never used a mathematical formula in a spreadsheet. All I do is insert data, which I organize an save as a CSV file, which I then import into a database table. For example, I have a spreadsheet with information on the animal kingdom, arranged by class, order, family, genus and species, all coded by cell background color/pattern and various font styles.
    To get to the point, there are two features I've grown to love that I have not found in any other spreadsheet, and I'd like to ask how Numbers compares...
    1) Sortable columns - In "Excel Lite," you can sort as many as three columns at a time. If you highlight cells spanning twelve rows, you can sort by one, two or three columns, even if you've only highlighted a single column. You can also sort an entire column (or two or three columns) by simply highlighting an entire column. I discovered that you cannot do this in OpenOffice.org's spreadsheet. I forget the details, but it was clumsy to work with.
    So how efficient is Numbers' sort feature? Can it sort three columns or just one? If I want to sort every row in a column(s), can I do so by simply highlighting the column, or do I have to specifically highlight every cell in each row and column I want to sort?
    This is the single most important feature I'm looking for.
    2) Cell/Font Attributes - OpenOffice.org's spreadsheet has a respectable number of cell background colors to choose from, but I like Excel's approach better. M$ allows you to choose various shades of each color, combine colors to create new colors and also choose background patterns, such as horizontal, vertical or diagonal lines. What scheme does Numbers use?
    Here are a few more questions...
    How many rows of data can you have in a Numbers spreadsheet? (I think my spreadsheet programs allows about 16,000, while I believe Excel allows 65,000.)
    How much text can you insert in a cell? Unfortunately, I can't use my spreadsheet program for storing articles, because each cell will only accept the equivalent of one or two medium paragraphs. I don't expect any other spreadsheet to do better...I'm just wondering if Numbers does allow you to paste entire articles into cells.
    I'm fascinated to hear that you can paste images into a Numbers document. Right now I'm organizing images I use on my websites into a spreadsheet, with separate columns for each image's ID, caption, text for the ALT tag, etc. It woul be nice if I could actually see a thumbnail of each image next to its ID and description, sort of like connecting a name with a face. Can you really do that? I would think the file size would be enormous if you were working with hundreds of images.
    I assume you can save a Numbers document as a CSV file...right? Is there also a feature that allows you to publish a spreadsheets' content directly into a MySQL database table? (I understand OpenOffice.org has such a feature, though I've never tried it.)
    Sorry for the long post. Any feedback on any particular question would be welcome. I HATE everything Microsoft, and I'm not even using Parallels on my MacBook Pro. The only M$ software program I covet is Excel, so I was elated to discover that there may be a worthy competitor out there.
    Thanks.

    Sorry, I didn't realize there was a free trial version. I just downloaded it, and my first impressions are WOW!
    The sort feature is better than the sort feature on "Excel Lite." Just click "Sort and Filter" to bring up the little Sort dialog box. At first, it looks like you can only sort a single column. But clicking the little plus sign on the right opens additional columns. I don't know what the limit is, but it's certainly far more than three.
    I also verified that you can paste very large amounts of text in a cell.
    Unlike M$'s spreadsheet, there are no cell background patterns, but there are plenty of colors to choose from. Also, it appears that there are far more options for styling text.
    I've only worked with it for a few minutes, but, for my purposes, Numbers rocks!

  • How to Convert Simple Report into ALV...

    Hi All,
    i have developed Simple now  i want to convert this report in ALV grid Report.
    how can i do it please Help..
    my code is..
    REPORT  ZGSTT_YVENDORDTL_REPORT.
    Tables :ZMSEG,LFA1.
    DATA: BEGIN OF struct occurs 100,
    MBLNR Type ZMSEG-MBLNR,
    BLDAT Type ZMSEG-BLDAT,
    LIFNR Type ZMSEG-LIFNR,
    BOENR Type ZMSEG-BOENR,
    name1 type lfa1-name1,
    END OF struct.
    types: comm2(16) type c.
    data: itab like  LFA1 occurs 1 with header line.
    data: ind type i.
    selection-screen: begin of block b1 with frame title comm2.
       parameters: matno like ZMSEG-MBLNR.
    select-options: ORDERDAT for ZMSEG-BLDAT.
    selection-screen: end of block b1.
    INITIALIZATION.
    comm2 = 'Selection Screen'.
    start-of-selection.
    if matno is not initial and orderdat is not initial.
    select * from ZMSEG into corresponding fields of table struct where MBLNR = matno and bldat in orderdat.
    elseif matno is initial and orderdat is not initial.
    select * from ZMSEG into corresponding fields of table struct where  bldat in orderdat.
    elseif matno is not initial and orderdat is initial.
    select * from ZMSEG into corresponding fields of table struct where MBLNR = matno.
    else.
    select * from ZMSEG into corresponding fields of table struct.
    endif.
    select * from lfa1 into table itab.
    loop at struct.
      ind = sy-tabix.
      read table itab with key lifnr = struct-lifnr.
    if sy-subrc = 0.
       move itab-name1 to struct-name1.
      endif.
      modify struct index ind transporting  name1.
    endloop.
    SKIP TO LINE 5.
    WRITE:SY-VLINE,(5) 'NO',SY-VLINE,(12) 'Bill of Date',SY-VLINE,(30) 'Vendor Name',SY-VLINE,(20) 'Material Document No.',SY-VLINE,(10) 'Bill of No.',SY-VLINE.
    FORMAT COLOR OFF.
    loop at struct.
      write: / SY-VLINE,(5) count UNDER 'NO',SY-VLINE,(12) struct-BLDAT UNDER 'Bill of Date',SY-VLINE,(30) struct-name1 UNDER 'Vendor Name',SY-VLINE,(20) struct-MBLNR UNDER 'Material Document No.',SY-VLINE,(10) struct-BOENR UNDER 'Bill of No.',SY-VLINE.
    endloop.
    Thanks In Advance...
    Yunus

    Hi,
    You can write your ALV programs in 2 methods by making use of classes or by making use of reuse function modules.
    You can go through the following standard programs.
    BCALV_FULLSCREEN_DEMO
    BCALV_FULLSCREEN_DEMO_CLASSIC
    regards,
    Sangram

  • Convert simple animation code from as2 to as3

    Hi everyone,
    I have a simple animation that is controlled by the y movement of the mouse. The code for the animation is put in frame 1 and is as follows:
    var animationDirection:Boolean = false;
    var prevMousePosition:Boolean = false;
    var mouseListener = new Object();
    mouseListener.onMouseMove = function () {
    var curMousePosition = _ymouse;
    if(curMousePosition > prevMousePosition) {
    animationDirection = false;
    }else if(curMousePosition < prevMousePosition) {
    animationDirection = true;
    prevMousePosition = curMousePosition;
    Mouse.addListener(mouseListener);
    function onEnterFrame() {
    if(animationDirection && _currentframe < _totalframes) {
    nextFrame();
    }else if(!animationDirection && _currentframe > 1) {
    prevFrame();
    Is it possible to use this code in as3 or do I need to convert it? I am grateful for any help. Best wishes

    Yes, you need to convert the code. Here is what looks like a similar logic in AS3:
    import flash.events.Event;
    import flash.events.MouseEvent;
    var animationDirection:Boolean = false;
    var prevMousePosition:Boolean = false;
    addEventListener(Event.ENTER_FRAME, onEnterFrame);
    addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
    function onMouseMove(e:MouseEvent):void {
        var curMousePosition = mouseX;
        if (curMousePosition > prevMousePosition)
            animationDirection = false;
        else if (curMousePosition < prevMousePosition)
            animationDirection = true;
        prevMousePosition = curMousePosition;
    function onEnterFrame(e:Event):void
        if (animationDirection && _currentframe < _totalframes)
            nextFrame();
        else if (!animationDirection && _currentframe > 1)
            prevFrame();

Maybe you are looking for