Oracle - SQL - update sequential number based on order by clause

I have a procedure that inserts records in to a temporary table. After procedure execution, I want to update a field in the temp table (recno) with sequential number ordered by a field audit date which is a time stamp field
For example, after updating the recno field, if I give a query like below,
Select recno,audit_timestamp,<other fields> from audit_details
order by audit_timestamp
the output should display recno in the sequential order. Can any one guide me on how to achieve this using a SQL query?

The audittime field is a timestamp field.
If I give the below query, rownum is not in the sequential order, see below few records..
SELECT rownum,to_char(audit_time_stamp,'dd-mon-yyyy HH24:MI:SS.FF') from audit_details ORDER BY audit_time_stamp
ROWNUM     to_char(audit_time_stamp,'dd-mon-yyyy HH24:MI:SS.FF')
16     18-apr-2007 14:30:52.551010
17     18-apr-2007 16:33:21.900305
18     18-apr-2007 17:49:44.061420
19     18-apr-2007 17:49:44.134804
20     19-apr-2007 16:40:15.775235
21     22-apr-2007 23:31:01.818784
ROWNUM     To_char(audit_time_stamp,'dd-mon-yyyy HH24:MI:SS.FF')
1     01-may-2007 19:17:46.880342
2     01-may-2007 19:24:04.952571
3     01-may-2007 19:24:32.182110
4     01-may-2007 19:25:49.464260
5     01-may-2007 19:25:52.127018
6     01-may-2007 19:27:34.099095
7     01-may-2007 19:30:34.763481
8     01-may-2007 19:31:06.226955
9     01-may-2007 19:32:36.727196
10     01-may-2007 19:40:44.061941

Similar Messages

  • How to update Serial Number from Work Order to Sales order in MTO flow

    Helo Experts,
    I have a requirement to update automatically the Serial number in Make to Order flow, from the Work order to the sales order and then to delivery.
    In fact the flow is the following, when raising the sales order we don't know the SN, it will create a Work order with stock type E, when work order is released a Serial Number is assigned to the material created. After Goods receipt of WO, We need to have the SN updated in the sales order and then in the delivery.
    I tried with the parameters of Serial number profile, i was not able to update from WO to Sales Order.
    DO you have any idea how this requirement could be fullfiled? is it possible in standard?
    Thanks

    I don't think that it is possible in standard.

  • PGI Exit to update serial number from Transfer order

    HI Experts,
    I would need to update serial number in the outbound delivery while PGI from transfer order created for same delivery.
    I found lot many BADI and form exit. But did not find any internal table in the exit where I can update serial number.
    Please give your suggestions to solve this problem.
    Thanks in advance for quick response.
    Regards
    Anutosh

    I don't think that it is possible in standard.

  • Oracle sql to outer join based on reg exp

    Hi,
    I am expecting output like (3). I want to join two tables with regex. join condition
    . For example, in table1.string(abcYYMMDD.txt) I want to match date part (YYMMDD) wit any possible number in Table2.string (abc150420.txt)
    Please suggest.
    (1) table1:
    abcYYMMDD.txt
    ddefYYMMDD.txt
    ghiYYMMDD.txt
    (2) table2:
    abc150420.txt
    abc150421.txt
    abc150422.txt
    abc150320.txt
    ddef150101.txt
    ddef150404.txt
    (3) Table1 left join Table2 (join example - abc(replace YYMMDD by regex).txt=abc150420.txt)
    abcYYMMDD.txt,abc150420.txt
    abcYYMMDD.txt,abc150421.txt
    abcYYMMDD.txt,abc150422.txt
    abcYYMMDD.txt,abc150320.txt
    ddefYYMMDD.txt,ddef150101.txt
    ddefYYMMDD.txt,ddef150404.txt
    ghiYYMMDD.txt,

    The audittime field is a timestamp field.
    If I give the below query, rownum is not in the sequential order, see below few records..
    SELECT rownum,to_char(audit_time_stamp,'dd-mon-yyyy HH24:MI:SS.FF') from audit_details ORDER BY audit_time_stamp
    ROWNUM     to_char(audit_time_stamp,'dd-mon-yyyy HH24:MI:SS.FF')
    16     18-apr-2007 14:30:52.551010
    17     18-apr-2007 16:33:21.900305
    18     18-apr-2007 17:49:44.061420
    19     18-apr-2007 17:49:44.134804
    20     19-apr-2007 16:40:15.775235
    21     22-apr-2007 23:31:01.818784
    ROWNUM     To_char(audit_time_stamp,'dd-mon-yyyy HH24:MI:SS.FF')
    1     01-may-2007 19:17:46.880342
    2     01-may-2007 19:24:04.952571
    3     01-may-2007 19:24:32.182110
    4     01-may-2007 19:25:49.464260
    5     01-may-2007 19:25:52.127018
    6     01-may-2007 19:27:34.099095
    7     01-may-2007 19:30:34.763481
    8     01-may-2007 19:31:06.226955
    9     01-may-2007 19:32:36.727196
    10     01-may-2007 19:40:44.061941

  • Function module or table to get the RO(Replenishment order) number based on Order id?-SNC system

    Hi All,
    Please help me in finding the FM or table to find out the Order number when you have the Replenishment Order id
    Or order id when you have the order number at SNC area?
    I want the input parameters as Order id/ order number and Version.
    System SNC 5/7.0
    Best regards,
    Anil.

    Hello Anilkumar.
    Which module does your requirement related to?

  • Update a list item based sort order of created by column value

    HI
    using powershell script how to sort a list column before update a list  item.
    here i created a document library and uploaded some documents and update ProcessNo column based sort order of created column
    value.
    Add-PSSnapin Microsoft.SharePoint.PowerShell -EA SilentlyContinue
    $webURL = "http://tspmcwfe:91" $listName = "Courts"
    Get the SPWeb object and save it to a variable
    $web = Get-SPWeb $webURL
    $list = $web.Lists[$listName] 
    $items = $list.items
    Go through all items
    foreach($item in $items)
    $item["ProcessNo"] = 1
    $item.Update()
    $web.Dispose()

    Hi,
    According to your description, my understanding is that you want to sort the list items order before updating items using PowerShell.
    I suggest you can use the Sort-Object command to sort the list items.
    Here are some detailed articles for your reference:
    Better SharePoint Lists and List Items in PowerShell
    Sort-Object
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to update one table based on another table ??

    Hello Friends:
    I am trying to run the following query in oracle but it won't run.
    UPDATE BOYS
    SET
    BOYS.AGE = GIRLS.AGE
    FROM GIRLS
    WHERE
    BOYS.FIRSTNAME = GIRLS.FIRSTNAME AND
    BOYS.LASTNAME = GIRLS.LASTNAME;
    This query runs fine in sql server but in oracle its saying can't find "SET". PLease tell me what is the correct syntax in oracle to update one table based on another table.
    thanks

    See if this helps.
    If you wrote an SQL statement:
    update boys set age = 10;
    Every row in the boys table will get updated with an age of 10. But if you wrote:
    update boys set age = 10
    where firstname = 'Joe';
    Then only the rows where the firstname is Joe would be updated with an age of 10.
    Now replace the 10 in the above statements with (select g.age from girls g where g.firstname = b.firstname and g.lastname = b.lastname) and replace where firstname = 'Joe' in the second statement with where exists (select null from girls g where g.firstname = b.firstname and g.lastname = b.lastname). The same concepts apply whether 10 is an actual value or a query and whether you have a where clause with the update statement to limit rows being updated.
    About the select null question regarding the outer where clause:
    Since the query is checking to see if the row in the girls table exists in the boys table what the column is in this select statement doesn't matter, this column isn't being used anywhere. In this case Todd chose to use null. He could have also used a column name from the table or a lot of times you'll see the literal value 1 used here.

  • TestStand Open SQL Statement does not support SQL's ORDER BY clause???

    TestStand 1.0.3
    Windows 2000 SP1
    SQL Server 2000 Personal
    You've got to be kidding me...
    It appears that the built-in TestStand Open SQL Step does NOT support the
    "ORDER BY" clause in the SELECT statement, even though the documentation
    says it does. Is this true?
    I have an Open SQL Statement query:
    "SELECT * FROM [MyTable] WHERE ([Batch ID]=1234)"
    it works fine, returning a correct record count 120 records. If I change
    the Open SQL Statement query simply by adding an ORDER BY clause, such as:
    "SELECT * FROM [MyTable] WHERE ([Batch ID]=1234) ORDER BY [MyField] ASC"
    it returns a record count of zero. I know that "MyField" exists in the
    MyTable table and contains valid data. The
    second query works fine in SQL
    Server Enterprise Manager.
    Am I missing something? Is it true that the TestStand Open SQL Step does
    NOT support the "ORDER BY" clause? If not, what &#$!ing good is it and why
    does the manual state it is supported? Is there any other way using just
    the TestStand steps to order a database recordset on one or more fields?
    Any help would be appreciated.
    Grrrrr....
    Bob Rafuse
    Etec Inc.

    > Bob -
    > The database step types do not do anything special to the SQL command
    > that you give it. The step just passes the command to the ADO
    > provider. I tried a simple query using the step types with the
    > following command,
    >
    > "SELECT UUT_RESULT.* FROM UUT_RESULT WHERE ([UUT_SERIAL_NUMBER] =
    > 12345) ORDER BY [EXECUTION_TIME] ASC"
    >
    > and this return the expected results and the record count parameter
    > was as expected. I tried this on TS 1.0.2 and TS 2.0 with MS Access
    > 2000 and MS SQL Server 7.0. I do not have MS SQL Server 2000 at this
    > time.
    >
    > It would be surprised if the step types are messing something up.
    I've been doing some experimenting over the past couple of days. Simple,
    one-table queries seem to handle the ORDER BY clause fine. Th
    ings seem to
    get messed up when I try multi-table queries with ORDER BY clause with the
    TestStand database steps. I get no errors but the returned record counts
    are always 0 with the ORDER BY and positive without the ORDER BY. The exact
    same queries work fine in Visual Basic/ADO and the SQL Server Query
    Analyzer.
    > Questions:
    > 1. Have you verified whether the data is actually returned even though
    > the record count is zero?
    Hmmm... yes data IS getting returned (at least on the two instances I just
    checked), but the record count is always zero. I was not proceeding with
    processing if the record count was 0.
    Still... I don't know how to loop through the recordset without knowing how
    many records there are an not eventually generate an error by passing EOF.
    Is there another way using the TestStand database steps to determine a) the
    number of records in the recordset or b) when I'm at EOF?
    > 2. Are you using any advanced options on the Opend SQL Statement step
    > type, specifically
    the cursor type set to forward only? Forward only
    > cursors do not allow for record counts.
    Everything on the Advanced tab of the Open SQL Statement step is set to "Use
    Default".
    Bob.

  • Update sequence number in PLAF table.

    Hi
    There is a requirement where I have to update sequence number for Planned Order in ECC.
    Sequence Data is stored in PLAF-SEQNR field [Seq. number order].
    BAPI_PLANNEDORDER_CHANGE did not work for me. There are only 27 field which i think we can edit (ie field in import parameters BAPIPLAF_I2).
    So can someone help me to find a way to update PLAF-SEQNR.
    Thanks
    Bhavesh

    Use an Enhancement Spot

  • ORDER BY clause in runtime

    Hi All,
    I want to order my SELECT using "dynamic ORDER BY". I have a CURSOR (in my PL/SQL procedure) contains a select with ORDER BY clause. I have implemented two combobox in my form (the first contains the column name, the second contains ASC and DESC).I tried with the next:
    1) Dynamic ORDER BY in CURSOR with combobox results. IT DOESN'T WORK.
    2) Using a block property named "ORDER BY CLAUSE". Here I put, for example, :myBlock.comboColumnOrder. IT DOESN'T WORK.
    3) Using a function: set_block_property(myBlock,order_by,:myBlock.comboColumnOrder) or set_block_property(myBlock,default_where,:myBlock.comboColumnOrder). IT DOESN'T WORK.
    4) Using dynamic CURSOR: ORACLE FORMS give me an error that said: "...it can't to the CLIENT-SIDE".
    I have thought my last solution, but it maybe cumbersome. I do a TEMPORARY TABLE, and my CURSOR insert in this TABLE, and then I'll fetch to my BLOCK.
    Thanks a lot.
    PS: My ORACLE Version is 10g.

    PROCEDURE CHEQUEAR_V0 IS
         V_ORDEN VARCHAR2(50) := '' || :BLOCK_CHECK.ORDER_BY_NAME || ' ' || :BLOCK_CHECK.ORDER_BY_ASC_DES ;
    CURSOR FILA_RESULTADO_TABLA IS
         SELECT Last_name,First_name,App_user, App_role, UserDB
         FROM adm_users
         WHERE
         ((Last_name IS NULL OR Last_name LIKE '%'||:BLOCK_CHECK.Last_name||'%') AND
         (First_name IS NULL OR First_name LIKE '%'||:BLOCK_CHECK.First_name||'%') AND
         (App_user IS NULL OR App_user LIKE '%'||:BLOCK_CHECK.App_user||'%') AND
         (App_role IS NULL OR App_role LIKE '%'||:BLOCK_CHECK.App_role||'%') AND
         (UserDB IS NULL OR UserDB LIKE '%'||:BLOCK_CHECK.User_DB||'%'))
    ORDER BY V_ORDEN;
         V_Last_name VARCHAR2(50);
         V_First_name VARCHAR2(50);
         V_App_user VARCHAR2(50);
         V_App_role VARCHAR2(50) ;
         V_User_DB VARCHAR2(50);
         CONT NUMBER ;
    BEGIN
         CONT := 1 ;
              GO_BLOCK('BLOCK_APPS_GRANTS');     
              CLEAR_BLOCK;
         SYNCHRONIZE;     
              OPEN FILA_RESULTADO_TABLA;
              LOOP
                   FETCH FILA_RESULTADO_TABLA INTO V_Last_name,V_First_name,V_App_user,V_App_role,V_User_DB ;
              EXIT WHEN FILA_RESULTADO_TABLA%NOTFOUND;
                        :BLOCK_APPS_GRANTS.Last_name := V_Last_name ;           
                        :BLOCK_APPS_GRANTS.First_name := V_First_name ;                               
                        :BLOCK_APPS_GRANTS.App_user := V_App_user ;
                        :BLOCK_APPS_GRANTS.App_role := V_App_role ;
                        :BLOCK_APPS_GRANTS.User_DB := V_User_DB ;                                         
                   NEXT_RECORD;
                   CONT := CONT+1;          
              END LOOP;
              IF FILA_RESULTADO_TABLA%ISOPEN THEN
                   CLOSE FILA_RESULTADO_TABLA;
              END IF;
              SET_BLOCK_PROPERTY('BLOCK_APPS_GRANTS', ORDER_BY, :BLOCK_CHECK.ORDER_BY_NAME || ' ' || :BLOCK_CHECK.ORDER_BY_ASC_DES);
              GO_BLOCK('BLOCK_APPS_GRANTS');
              EXECUTE_QUERY;
    synchronize;
              exception when others then
                   raise;
    END;
    Thanks a lot.
    Edited by: user11285646 on 22-jul-2009 2:30

  • Break Order overriding my ORDER BY clause

    Hi Experts,
    I have created a report in Oracle 6i where I am getting the ORDER BY clause at runtime. And in the datamodel query, I am using a lexical parameter to say, order by the column selected in the parameter.
    The problem am facing is, at runtime, the ORDER BY clause is being ignored by the report and it takes the column mentioned with break order property as 'Ascending' and sorts by that column.
    I am not able to set the break order property to None to all of the columns as the reports builder is erroring out asking me to have atleast one column set to Asc or Desc!
    Have anyone faced this problem before ? Is there anyway to get rid of this and make the report use by columns mentioned in the ORDER BY clause.
    Please note: I tried an explicit ORDER BY <columnname> in the data model query but still the report uses the break order value mentioned and sorts by that columns.
    Appreciate your help on the same.
    Thanks!

    Hi,
    there's a simple rule how this works. For every query you have one or more (hierarchic) groups in the data model. For the lowest group the ORDER BY is choosen for sorting and for the groups, not beeing the lowest group, the BREAK ORDER is choosen (and vice versa ignored).
    Regards
    Rainer

  • Oracle SQL Developer and Errors (Line Number Incorrect)

    First, I wanted to state that Oracle SQL Developer 2 is a standout job.
    I wanted to report, though, that when Oracle SQL Developer 2 can't compile a block of code or a simple SQL statement has invalid syntax, it does not have an option to accurately go to the line of code in question. GOING TO the erroneous line of code doesn't need to be a feature, but often times the line no. REPORTED by Oracle SQL Developer is incorrect by 50+ lines.
    Is this something I could fix on my end? I have five other developers griping about this.
    Thank you!

    I don't know if this is the situation you are talking about, but line numbers for errors in SQL in a SQL Worksheet are not line numbers within the statement but rather line numbers in the worksheet. For example, with the following SQL in the worksheet:
    select * from dual;
    select * from dual;
    select * from dual;
    select from dual;Running the "select from dual;" statement (as either statement based on cursor position, selected statement or as script), the error is reported on Line 4, Column 7. As I show line numbers (Tools | Preferences | Code Editor | Line Gutter | Show Line Numbers), this makes sense. Without line numbers showing or having the option to go to the error and with more realistic examples with SQL statements scrolling off the page, I can see that the line number in the errors wouldn't be helpful.
    I think -K- is talking about the PL/SQL code editors not reporting the correct line number based on the error line not counting the "create or replace" line at the start of a package (and more for triggers).
    theFurryOne

  • Error after update Oracle SQL Developer Migration Tools

    Hi,
    I'm receiving a error after the update of Oracle SQL Developer (v.1.1.3.27.66) to work with mySQL migration tool.
    This error appear when it´s restarting:
    Exception Stack Trace:
    java.lang.IllegalAccessError: tried to access class oracle.ide.net.IdeURLStreamHandler from class oracle.ide.net.URLFileSystem$1
         at oracle.ide.net.URLFileSystem$1.createURLStreamHandler(URLFileSystem.java:87)
         at oracle.ide.boot.URLStreamHandlerFactoryQueue.createURLStreamHandler(URLStreamHandlerFactoryQueue.java:119)
         at java.net.URL.getURLStreamHandler(URL.java:1106)
         at java.net.URL.<init>(URL.java:393)
         at java.net.URL.<init>(URL.java:283)
         at oracle.ide.net.URLFactory.newURL(URLFactory.java:636)
         at oracle.ide.layout.URL2String.toURL(URL2String.java:104)
         at oracle.ideimpl.editor.EditorUtil.getURL(EditorUtil.java:150)
         at oracle.ideimpl.editor.EditorUtil.getNode(EditorUtil.java:122)
         at oracle.ideimpl.editor.EditorUtil.loadContext(EditorUtil.java:91)
         at oracle.ideimpl.editor.TabGroupState.loadStateInfo(TabGroupState.java:950)
         at oracle.ideimpl.editor.TabGroup.loadLayout(TabGroup.java:1751)
         at oracle.ideimpl.editor.TabGroupXMLLayoutPersistence.loadComponent(TabGroupXMLLayoutPersistence.java:31)
         at oracle.ideimpl.controls.dockLayout.DockLayoutInfoLeaf.loadLayout(DockLayoutInfoLeaf.java:123)
         at oracle.ideimpl.controls.dockLayout.AbstractDockLayoutInfoNode.loadLayout(AbstractDockLayoutInfoNode.java:631)
         at oracle.ideimpl.controls.dockLayout.AbstractDockLayoutInfoNode.loadLayout(AbstractDockLayoutInfoNode.java:628)
         at oracle.ideimpl.controls.dockLayout.AbstractDockLayoutInfoNode.loadLayout(AbstractDockLayoutInfoNode.java:614)
         at oracle.ideimpl.controls.dockLayout.DockLayout.loadLayout(DockLayout.java:302)
         at oracle.ideimpl.controls.dockLayout.DockLayoutPanel.loadLayout(DockLayoutPanel.java:128)
         at oracle.ideimpl.editor.Desktop.loadLayout(Desktop.java:356)
         at oracle.ideimpl.editor.EditorManagerImpl.init(EditorManagerImpl.java:1879)
         at oracle.ide.layout.Layouts.activate(Layouts.java:784)
         at oracle.ide.layout.Layouts.activateLayout(Layouts.java:186)
         at oracle.ideimpl.MainWindowImpl$6.runImpl(MainWindowImpl.java:734)
         at oracle.javatools.util.SwingClosure$1Closure.run(SwingClosure.java:50)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    Anyone knows why that is happining?
    Thanks in advance,
    Felipe.
    Message was edited by:
    felipe.b

    Hello,
    I get the same error after updating through Help->Check for Updates. I am at version 1.1.2.25 and the update does not change the version number of Oracle SQL Developer (Help->About), it remains at 1.1.2.25 (although if I look in extensions tab, it says: oracle.sqldeveloper 1.1.3.27.66 Loaded, possible bug in displaying version number?). These are the updates applied:
    Upgraded Extensions
    Oracle Microsoft Access Browser version 1.1.3.27.66
    Oracle SQL Developer - Snippet version 10.1.3.27.66
    Oracle SQL Developer version 1.1.3.27.66
    Oracle SQL Developer - Reports version 10.1.3.27.66
    Oracle SQL Server Browser version 1.1.3.27.66
    Oracle MySQL Browser version 1.1.3.27.66
    Oracle SQL Developer - Worksheet version 10.1.3.27.66
    Oracle SQL Developer - Extras version 1.1.3.27.66
    Oracle SQL Developer - SearchBar version 10.1.3.27.66
    Oracle SQL Developer - Object Viewer version 10.1.3.27.66
    I ran the update several times and was able to reproduce the error under a specific condition. If I am connected to a database at the time of the update I get the error. If I am not conneceted at the time of the update I do not get the error.
    As stated, by Donal, sql developer seems to get over the problem after restarting itself twice.
    Mark

  • Oracle SQL Developer  error - "The file-based source procedure Name is not present in the database."

    I recently started working on the Oracle SQL developer. I have 'select' privileges on the QA schema and when tried to execute proc in QA. It is giving the error as 'The file-based source <procedure Name>  is not present in the database.  Was it compiled?'
    instead 'you do not have sufficient privileges to execute this procedure'. Did research on internet but with no luck.What configuration changes needed to be done to make it work.Guide me.

    Sounds like you do not have the correct privileges.  What should have been granted to you by the QA user, or some other user with appropriate privileges, is...
    grant EXECUTE on "QA"."<PROCEDURE_OF_INTEREST>" to "<YOUR_USERID>" ;
    Note that a grant of execute on a procedure has nothing to do with grants of select on some or all of QA's tables and views.
    So, as Vadim suggests, from your connection node in SQL Developer's Connections view, if you expand the Other Users node, then expand QA and look in the Procedures node, do you see the procedure of interest?  If not, you cannot expect to be able to execute it from your userid's connection. And even if you do see it, you may have some other privilege that permits viewing but not executing, like...
    The role SELECT_CATALOG_ROLE
    The system privilege SELECT ANY DICTIONARY
    And even if you do not see it there, then having certain other privileges granted to you could permit executing it in general, like...
    The role EXECUTE_CATALOG_ROLE
    The system privilege EXECUTE ANY PROCEDURE
    Also, note that the 3.0 release is a bit dated nowadays. Upgrading to 4.0.3 production or even the 4.1 EA2 (early adopter) release will, in general, give you a better experience.
    Best wishes,
    Gary

  • How to fetch data from CDHDR Table based on Order Number

    Hi,
    I need to fetch the data from CDHDR just based on the Order number .I found there is a field called 'OBJECTID' in table 'CDHDR'. But the  last part of OBJECTID contains order number.suppose my order number is 90506210 the objectid field contains '51030000090506210'.510 is login client,don't know what 30 is and last part is order number i.e 000090506210.i have to concatenate all and fetch data .i can do it for one order number but here order number is declared as select-options.how do i ?
    HERE IS THE CODE FOR ONE ORDER NUMBER.HOW CAN DO FOR RANGE OF ORDER NUMBERS.
    PARAMETER : S_OBJECT FOR  /BEV1/RBVBAK-AUFNR  OBLIGATORY.
    DATA : IT_CDHDR TYPE STANDARD TABLE OF CDHDR WITH HEADER LINE,
                 WA_CDHDR LIKE LINE OF IT_CDHDR,
                 S_OBJECT1 LIKE CDHDR-OBJECTID.
    CONCATENATE  sy-mandt  '30'  S_OBJECT INTO S_OBJECT1.
    SELECT * FROM CDHDR INTO TABLE IT_CDHDR WHERE OBJECTID = S_OBJECT1.

    P838355 wrote:>
    > Hi,
    >  I need to fetch the data from CDHDR just based on the Order number .I found there is a field called 'OBJECTID' in table 'CDHDR'. But the  last part of OBJECTID contains order number.suppose my order number is 90506210 the objectid field contains '51030000090506210'.510 is login client,don't know what 30 is and last part is order number i.e 000090506210.i have to concatenate all and fetch data .i can do it for one order number but here order number is declared as select-options.how do i ?
    >
    > HERE IS THE CODE FOR ONE ORDER NUMBER.HOW CAN DO FOR RANGE OF ORDER NUMBERS.
    >
    >
    > PARAMETER : S_OBJECT FOR  /BEV1/RBVBAK-AUFNR  OBLIGATORY.
    >
    > DATA : IT_CDHDR TYPE STANDARD TABLE OF CDHDR WITH HEADER LINE,
    >              WA_CDHDR LIKE LINE OF IT_CDHDR,
    >              S_OBJECT1 LIKE CDHDR-OBJECTID.
    >
    > CONCATENATE  sy-mandt  '30'  S_OBJECT INTO S_OBJECT1.
    >
    > SELECT * FROM CDHDR INTO TABLE IT_CDHDR WHERE OBJECTID = S_OBJECT1.
    You need to loop through the select option and concatenate with required data then select using 'in' instead of equal or select one by one.
    or
    select sales order numbers from VBAK for the selection into internal table then loop through the internal table and concatenate then select from CDHDR.
    for better performance use objectclass in where clause. the value for sales order for objectclass is VERKBELEG.
    in my system the object id is just an order number there is no other additions to it but in CDPOS the tabkey contains the order number with client and other information also.
    the 30 may be your item number... check it
    go ahead and change sales order and see what you can find in CDHDR
    Good luck
    Edited by: Sampath Kumar on Oct 21, 2009 9:02 AM

Maybe you are looking for

  • Error message for radiobuttongroup using report_attribute_error_message

    Hi, We are displaying error message on the submit button of a form in web dynpro abap application. We have different UI elements in the form which are mandatory to enter by the user.So we are using 'CALL METHOD lo_message_manager->report_attribute_er

  • Error message when opening photo from Camera Roll

    I just updated to iOS 4.3 Now, when I open a photo from camera roll it says "El formato de esta pelicula es incompatible", which means something like "The format of this movie is not compatible" (it doesn't matter if I try to open a photo or a movie)

  • Width of the Description field is too wide

    Hi all i m working on apex 4.0 in my report page the width of the Description field is too wide when the field exceeds 150 characters how can i control it? plz help. thanks, annu.

  • Charged for free movie

    Verizon sent me an email saying I could view a movie free.  I couldn't access the movie and called Verizon tech support.  The agent told me to pick "buy the movie" and then I could view it and I shouldn't be charged for it because it was a free offer

  • Unable to install Management Tools

    I am unable to install the Exchange Management Tools on my workstation. When I attempt to install, I get D:\exchangeserver.msi failed. This action is only valid for products that are currently installed. Error code is 1605. None of the exchange compo