Doubt in selection  of data...urgent..

hi abaperes...
                 i have trouble in selection of vendor no  in lfa1 tables
by vendor no and date range in selection screen.
based on vendor ranges and date ranges in selection screen i want to fetch vendor no
in my itab .there is no posting date in lfa1 table.... very urgent..
it is possible..pls reply ...advance thanks...
regards
veera

Hi
You have the ERDAT (creation date):
TABLES LFA1.
SELECT-OPTIONS: SO_LIFNR FOR LFA1-LIFNR,
                SO_ERDAT FOR LFA1-ERDAT.
SELECT * FROM LFA1 WHERE LIFNR IN SO_LIFNR
                     AND ERDAT IN SO_ERDAT.
mAX

Similar Messages

  • Doubt in 'SELECT-CASE'

    I have a doubt in 'SELECT-CASE'. There is this example of which i have :-
    SELECT /*+ rule */ SUM(CASE WHEN age <= 15 THEN cnt ELSE 0 END) "upto 15 Years" ,
    SUM(CASE WHEN age >= 16 AND age <= 20 THEN cnt ELSE 0 END) "16-20 Years" ,
    SUM(CASE WHEN age >= 21 AND age <= 25 THEN cnt ELSE 0 END) "21-25 Years" ,
    SUM(CASE WHEN age >= 26 AND age <= 30 THEN cnt ELSE 0 END) "26-30 Years" ,
    SUM(CASE WHEN age >= 31 AND age <= 35 THEN cnt ELSE 0 END) "31-35 Years" ,
    SUM(CASE WHEN age >= 36 AND age <= 40 THEN cnt ELSE 0 END) "36-40 Years" ,
    SUM(CASE WHEN age >= 41 AND age <= 45 THEN cnt ELSE 0 END) "41-45 Years" ,
    SUM(CASE WHEN age >= 46 AND age <= 50 THEN cnt ELSE 0 END) "46-50 Years" ,
    SUM(CASE WHEN age >= 51 AND age <= 55 THEN cnt ELSE 0 END) "51-55 Years" ,
    SUM(CASE WHEN age >= 56 AND age <= 60 THEN cnt ELSE 0 END) "56-60 Years" ,
    SUM(CASE WHEN age >= 61 AND age <= 65 THEN cnt ELSE 0 END) "61-65 Years" ,
    SUM(CASE WHEN age >= 66 AND age <= 70 THEN cnt ELSE 0 END) "66-70 Years" ,
    SUM(CASE WHEN age > 70 THEN cnt ELSE 0 END) ">70 Years"
    FROM
    (SELECT /*+ rule */ROUND(MONTHS_BETWEEN(SYSDATE,ca.birthdate)/12) age,COUNT(1) cnt
    FROM contract_all co , customer_all ca ,curr_co_status curr
    WHERE ca.customer_id = co.customer_id
    AND co.co_id = curr.co_id
    AND curr.ch_status = 'a'
    AND ca.birthdate IS NOT NULL
    --AND    co.co_activated BETWEEN '01-jan-2004' AND  '31-dec-2004'
    AND EXISTS ( SELECT 'x' FROM hss_cust_segment hcs
    WHERE hcs.prgcode = ca.prgcode
    AND hcs.description = 'POST')
    GROUP BY ROUND(MONTHS_BETWEEN(SYSDATE,ca.birthdate)/12))
    In this the statements on top like this-
    SUM(CASE WHEN age >= 16 AND age <= 20 THEN cnt ELSE 0 END) "16-20 Years" ,
    how does the increment happen in 'THEN cnt' because we are not doing the increment as such using '+1' kind of thing.
    I hope, my question is clear. Please help in solving the doubt.
    Regards.

    Sample data, wrong output and desired output please...
    I tried with this and it seems right...
    WITH ca as (
      select to_date('26-9-1990') birthdate from dual union all
      select to_date('26-9-1989') birthdate from dual union all
      select to_date('26-9-1974') birthdate from dual
    SELECT /*+ rule */ SUM(CASE WHEN age <= 15 THEN cnt ELSE 0 END) "upto 15 Years" ,
      SUM(CASE WHEN age >= 16 AND age <= 20 THEN cnt ELSE 0 END) "16-20 Years" ,
      SUM(CASE WHEN age >= 21 AND age <= 25 THEN cnt ELSE 0 END) "21-25 Years" ,
      SUM(CASE WHEN age >= 26 AND age <= 30 THEN cnt ELSE 0 END) "26-30 Years" ,
      SUM(CASE WHEN age >= 31 AND age <= 35 THEN cnt ELSE 0 END) "31-35 Years" ,
      SUM(CASE WHEN age >= 36 AND age <= 40 THEN cnt ELSE 0 END) "36-40 Years" ,
      SUM(CASE WHEN age >= 41 AND age <= 45 THEN cnt ELSE 0 END) "41-45 Years" ,
      SUM(CASE WHEN age >= 46 AND age <= 50 THEN cnt ELSE 0 END) "46-50 Years" ,
      SUM(CASE WHEN age >= 51 AND age <= 55 THEN cnt ELSE 0 END) "51-55 Years" ,
      SUM(CASE WHEN age >= 56 AND age <= 60 THEN cnt ELSE 0 END) "56-60 Years" ,
      SUM(CASE WHEN age >= 61 AND age <= 65 THEN cnt ELSE 0 END) "61-65 Years" ,
      SUM(CASE WHEN age >= 66 AND age <= 70 THEN cnt ELSE 0 END) "66-70 Years" ,
      SUM(CASE WHEN age > 70 THEN cnt ELSE 0 END) ">70 Years"
    FROM ( SELECT /*+ rule */ ROUND(MONTHS_BETWEEN(SYSDATE,ca.birthdate)/12) age, COUNT(1) cnt
           FROM ca
           GROUP BY ROUND(MONTHS_BETWEEN(SYSDATE,ca.birthdate)/12) )
    upto 15 Years          16-20 Years            21-25 Years            26-30 Years            31-35 Years            36-40 Years            41-45 Years            46-50 Years            51-55 Years            56-60 Years            61-65 Years            66-70 Years            >70 Years             
    0                      2                      0                      0                      1                      0                      0                      0                      0                      0                      0                      0                      0                     
    1 rows selectedNH.

  • How to get selected row data of an ADF table in HashMap?

    Hi,
    Can anyone please tell me how to selected row data of an ADF table in HashMap like :
    Object obj = pageTable.getSelectedRowData();
    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)obj;
    Now in above code I want the convert rowData in HashMap.
    Can anyone please tell me how to do that? Its urgent.
    Thanks,
    Vik

    Vik,
    No need to ask the same question 3 times...
    In [url http://forums.oracle.com/forums/message.jspa?messageID=4590586]this post, Nick showed you how to get the Row.
    If it were so urgent, you could have done a little reading of the javadocs to come up with code like this (not tested, up to you to do that)
    HashMap m = new HashMap();
    Row r = get it like Nick showed you to;
    Object values[]=r.getAttributeValues();
    String names[]=r.getAttributeNames();
    for (int i=0; i<r.getAttributeCount(); i++)
    m.put(names, values[i]);

  • Select RTF Data and display in PDF Document

    Hi all,
    I have a simple table:
    CONTENT_ID - NUMBER
    CONTENT - VARCHAR2(4000)
    On top of this table I have a form that allows the user to enter / update data. The 'CONTENT' field is a Rich Text Editor (ApEx 4.0 - CKEditor 3). This allows the user to enter and format their text as they require.
    I need to be able to select this data and display it in a PDF Document (via BI Publisher).
    I therefore have a simple query
    select content from content_table where content_id = 1;and a simple template that processes the resulting xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <ROWSET>
       <ROW>
          <CONTENT>& lt;h2& gt;
         This is a heading& lt;/h2& gt;
    & lt;p& gt;
         This is the text& lt;/p& gt;
    </CONTENT>
       </ROW>
    </ROWSET>(There is not really a space between the & and 'lt' etc but I had to add this to get it to display correctly here).
    Where I run this past my template I get a PDF with:
    <h2>
    This is a heading</h2>
    <p>
    This is the text</p>I get the same if I generate HTML.
    but what I want to see is the text formatted as the user has entered in the RTF editor.
    Can this be done?
    Many thanks,
    Martin

    I think your mixing 2 technologies.
    At 1 side you have xml in combination with xsl (style sheets used in BI Publisher and FOP) to generate your pdf. And at the other side you have HTML...
    XML and HTML are 2 entirely different technologies which you can not mix this simple. I investigated the same problem as you had, and in the end I ended up using jasperreports instead of FOP.
    Maybe BI Publisher has some html regions which you could insert into your word document but I doubt it cause more people have asked the same question on this board...
    So my advice: use jasperreports (also it is free for commercial usage)
    Success
    Br,
    Nico

  • Doubt in selection screen

    Hi i have a doubt in selection screen I had given statement as below now i can see the output screen and i'm getting the output also now i want to know the value of only one vendor. If i had given a vendor number it must select the particular data of that vendor only can u give me any suggestions please
    SELECTION-SCREEN BEGIN OF BLOCK P WITH FRAME TITLE TEXT-000.
          PARAMETERS: VENDORNO like EKKo-LIFNR,
                      PURORG like EKKO-EKORG,
                      PLANT like EKPO-WERKS,
                      PURDOC like EKKO-BEDAT.
    SELECTION-SCREEN END OF BLOCK P.

    Hi Pavan,
    <b>I think this is what u required when u select vendor number automatically for that particular vendor u require values in the remaining 3 parameter fields.
    </b>
    REPORT zex31 .
    PARAMETERS: vendorno LIKE ekko-lifnr,
                      purorg LIKE ekko-ekorg,
                      plant LIKE ekpo-werks,
                      purdoc LIKE ekko-bedat.
    DATA: dynfields TYPE TABLE OF dynpread WITH HEADER LINE.
    DATA: return TYPE TABLE OF ddshretval WITH HEADER LINE.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR vendorno.
      CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
           EXPORTING
                tabname           = 'EKKO'
                fieldname         = 'LIFNR'
                dynpprog          = sy-cprog
                dynpnr            = sy-dynnr
                dynprofield       = 'VENDORNO'
           TABLES
                return_tab        = return
           EXCEPTIONS
                field_not_found   = 1
                no_help_for_field = 2
                inconsistent_help = 3
                no_values_found   = 4
                OTHERS            = 5.
      BREAK-POINT.
      REFRESH dynfields.
      READ TABLE return WITH KEY fieldname = 'VENDORNO'.
    Add it back to the dynpro.
      dynfields-fieldname = return-retfield.
      dynfields-fieldvalue = return-fieldval.
      APPEND dynfields.
    Get the company code from db and add to dynpro
      DATA: xekko TYPE ekko,
            xekpo TYPE ekpo.
      CLEAR xekko.
      CLEAR xekpo.
      SELECT SINGLE * INTO xekko
      FROM ekko
      WHERE lifnr = return-fieldval.
      dynfields-fieldname = 'PURORG'.
      dynfields-fieldvalue = xekko-ekorg.
      APPEND dynfields.
      dynfields-fieldname = 'PURDOC'.
      dynfields-fieldvalue = xekko-bedat.
      APPEND dynfields.
      SELECT SINGLE * INTO xekpo
       FROM ekpo
       WHERE ebeln = xekko-ebeln.
      dynfields-fieldname = 'PLANT'.
      dynfields-fieldvalue = xekpo-werks.
      APPEND dynfields.
    Update the dynpro values.
      CALL FUNCTION 'DYNP_VALUES_UPDATE'
           EXPORTING
                dyname     = sy-cprog
                dynumb     = sy-dynnr
           TABLES
                dynpfields = dynfields
           EXCEPTIONS
                OTHERS     = 8.
    START-OF-SELECTION.

  • Getting Exception in the select clause - Very Urgent

    Hi,
        I have given the below statement but it is showing the exception.
      SELECT *
             FROM (lv_tab_name)
             INTO CORRESPONDING FIELDS OF TABLE <fs_1>.
    If I execute the above select statement it is showing the below exception.
    Exception CX_SY_NO_HANDLER triggered.
    An exception with the type CX_SY_OPEN_SQL_DB occurred.
    It is working very well if I mention the few field names.
    Please let me know the possible reasons.
    Thanks,
    Suvin

    Thanks much for your quick response.
    I have tried with what you mentioned but it is not working.
    Please find my code below.
    *Declarations
    DATA: ddfields TYPE STANDARD TABLE OF ddfield.
      DATA: ls_ddfields TYPE ddfield.
      DATA: lt TYPE lvc_t_fcat.
      DATA: ls TYPE lvc_s_fcat.
      DATA: lv_tab_name TYPE dd02l-tabname.
    Data References
      DATA: lt_data TYPE REF TO data.
      DATA: new_line TYPE REF TO data.
    Field Symbols
      FIELD-SYMBOLS: <fs_1> TYPE ANY TABLE.
      FIELD-SYMBOLS: <fs_data> TYPE REF TO data.
      FIELD-SYMBOLS: <fs_2> TYPE ANY,
                     <l_field> TYPE ANY.
    Get the fields of the database table, here i am passing the table name
      CALL FUNCTION 'DD_NAMETAB_TO_DDFIELDS'
        EXPORTING
      KEYFIELDS       = 'X'
      NULLABLE        = 'X'
            tabname        = lv_tab_name
        TABLES
            ddfields        = ddfields.
      LOOP AT ddfields INTO ls_ddfields.
        ls-fieldname = ls_ddfields-fieldname.
        APPEND ls TO lt.
      ENDLOOP.
    *Assigning Field-Symbol to our dynamic internal table
      ASSIGN lt_data TO <fs_data>.
    Calling the method CREATE_DYNAMIC_TABLE
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog           = lt
        IMPORTING
          ep_table                  = <fs_data>
        EXCEPTIONS
          generate_subpool_dir_full = 1
          OTHERS                    = 2.
      IF sy-subrc EQ 0.
        ASSIGN <fs_data>->* TO <fs_1>.
    Create a work area for the dynamic table.
        CREATE DATA new_line LIKE LINE OF <fs_1>.
    A field-symbol to access that work area
        ASSIGN new_line->*  TO <fs_2>.
      ENDIF.
    Selecting the Data from the respective table.
      SELECT *
             FROM (lv_tab_name)
             INTO CORRESPONDING FIELDS OF TABLE <fs_1>.
    Please advise..it is very urgent.
    Thanks,
    Suvin

  • How to select the data from a Maintainance View into an internal table

    Hi All,
    Can anybody tell me how to select the data from a Maintainance View into an internal table.
    Thanks,
    srinivas.

    HI,
    You can not retrieve data from A mentenance view.
    For detail check this link,
    http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ed2d446011d189700000e8322d00/content.htm
    Regards,
    Anirban

  • Selecting all data from employee where foreign key = null and show it in view

    Hi guys i have view like following :
    SELECT dbo.Nationality.NationalityName, dbo.Employee.DriverName, dbo.Employee.DriverID, dbo.Employee.NationalityID, dbo.Employee.ResidentNo,
    dbo.Country.CountryName, dbo.Employee.CountryID, dbo.Branch.BranchName, dbo.Employee.BranchID, dbo.Employee.JoinDate,
    dbo.Employee.ResignDate, dbo.Employee.HealthCarNo, dbo.Employee.JobID, dbo.Jobs.JobName, dbo.Department.DepartmentName,
    dbo.Jobs.DepartmentID, dbo.Employee.PlaceIssue, dbo.Employee.Deduction, dbo.Employee.ExpireDateMedical, dbo.Employee.PolicyNumber,
    dbo.Employee.Owner, dbo.Employee.Version, dbo.Employee.ExpireDateResident, dbo.Employee.Salary, dbo.Employee.SexID, dbo.Sex.SexType,
    dbo.Sex.FlagSex, dbo.Employee.MiritialID, dbo.Miritial.MiritualStatus, dbo.Status.StatusType, dbo.Employee.StatusID, dbo.Employee.UnactiveReason,
    dbo.Employee.BirthDate, dbo.Employee.DateToday, dbo.Employee.UserID, dbo.Employee.PassportNo, dbo.Employee.Period,
    dbo.Employee.AccountNo, dbo.Employee.Bonus, dbo.Employee.AccountType, dbo.Employee.PlaceOfBirth, dbo.Employee.EmplyeeName,
    dbo.Employee.ExpireDateresidentHijri, dbo.Employee.PassportDateStart, dbo.Employee.PassportDateExpire, dbo.Religon.ReligonName,
    dbo.Employee.ReligonID
    FROM dbo.Nationality INNER JOIN
    dbo.Employee ON dbo.Nationality.NationalityID = dbo.Employee.NationalityID INNER JOIN
    dbo.Country ON dbo.Employee.CountryID = dbo.Country.CountryID INNER JOIN
    dbo.Branch ON dbo.Employee.BranchID = dbo.Branch.BranchID INNER JOIN
    dbo.Jobs ON dbo.Employee.JobID = dbo.Jobs.JobID INNER JOIN
    dbo.Department ON dbo.Jobs.DepartmentID = dbo.Department.DepartmentID INNER JOIN
    dbo.Sex ON dbo.Employee.SexID = dbo.Sex.SexID INNER JOIN
    dbo.Miritial ON dbo.Employee.MiritialID = dbo.Miritial.MiritialID INNER JOIN
    dbo.Status ON dbo.Employee.StatusID = dbo.Status.StatusID INNER JOIN
    dbo.Religon ON dbo.Employee.ReligonID = dbo.Religon.ReligonID
    suppose i need to show all data from Employee table (NationalityName,BranchName,JobName) where
    NationalityID =NULL OR BranchID=NULL OR JobID=NULL
    WHAT I DO
    Notes : I mean in topic(selecting all data from view not table
    meaning i need to show all data in employee table by view
    in case of forign key(any forign key)equal null

    I think you need to change 
    FROM dbo.Nationality INNER JOIN
    dbo.Employee ON dbo.Nationality.NationalityID = dbo.Employee.NationalityID
    to
    FROM dbo.Nationality
    LEFT JOIN
    dbo.Employee ON dbo.Nationality.NationalityID = dbo.Employee.NationalityID
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Cannot select a Date in the 2nd week of any month from "Month View"

    Looking for some help with a strange problem that has started within the last day or 2. In Calendar, under the Month view, it will not allow me to select a date in the current week (or the second Week dates in ANY Month for that matter i.e. 6-8-08 thru 6-14-08, 8-3-08 thru 8-9-08, 4-6-08 thru 4-12-08). It skips from the 1st week of June (6-1-08 thru 6-7-08), to the 3rd and 4th weeks of June (6-15-08 thru the end of the month). It is like it is not recognizing where my finger is pointing. I can access the current week through the list view and day view, and it will allow me to post an event by choosing the current week in the add option, but will not let me pick that date to view it once it has been scheduled. The dot shows up, and it shows on list view, but cannot get to the date by selecting it in month view. That section of my phone screen will let me access other applications and recognize where I am touching, so I don't believe it is a sensor issue. I have tried rebooting, but it has not helped. Any ideas out there? Please let me know. Thank You! for any guidance.

    Clearwater Randy,
    If the screen is only not responding in that particular application, you may want to first do a reset. To reset, press and hold the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears.
    If that does not resolve your issue, try restoring in iTunes. To restore, connect your iPhone into iTunes and click Restore on the Summary page. Note: All of your information will be erased from the iPhone, so make sure to have a backup of important information on your computer before restoring.
    Hope this helps,
    Jennifer B.

  • How to select maximum date in report

    i have tried to select maximum date in my report by this way:
    select max(date) from a
    but the result came out same as "select date from a"
    there is no different whether i put a max or not. is anyone there can help me on this please....
    Thank you....

    Hi Sharon,
    Since you cannot execute this query from SQL, I assume that the DB does not support the function MAX(expr). Am not sure which DB versions support this function, probably the Database forum will be a better place to ask that.
    As a workaround, what you could try is to use this statement
    select hire_date from employees order by hire_date desc
    and in the report data model, you make a summary column and choose Function > First, Source > Hire_Date, and Reset At > Report.
    Hope that helps.
    Navneet.

  • SELECT OPTIONS DATE.

    Hello , I need your help ,  to access to  every date in an interval of the select option , in order to execute a function module that use date in one of its parameters .
    select-options : dat for sy-datum .
       CALL FUNCTION 'ZPRUEBA''
         EXPORTING
           offic                =
           chdsk                =
           inicio_periodo       =
         FIM_PERIODO          =  dat  "but i need here every date of the interval
         NO_UPDATE            =
       IMPORTING
         NR_COBRANCAS         =
       ENDSELECT.
    How can I do that ? , tnhx.

    hi
    put the function module in the loop.
    data : date like sy-datum.
    select-options : s_date for date.
    while ( s_date-low LE s_date-high ).
    CALL FUNCTION 'ZPRUEBA''
    EXPORTING
    offic =
    chdsk =
    inicio_periodo =
    FIM_PERIODO = s_date-low
    NO_UPDATE =
    IMPORTING
    NR_COBRANCAS =
    add 1 to s_date-low.
    endwhile.
    reward if helpful
    prasanth

  • How to display null values in the graphs, when i select a date range?

    Hi,
    Can you please help me in achieving the below requirement:
    We have a date promt, i have selected the date range from 12-Oct-2009 to 15-Oct-2009 and clicked on the go button.
    In the above date range, data is only availabe on 14-Oct-2009. here the requirement is to display as all the records (12th, 13th , 14th & 15th) in the bar graph.
    Currently the graph view is displaying the data only for 14-Oct-2009 in the bar graph.
    If data is not available it should display in the bar graph as empty for that particular dates.
    Help is highly apprieciated.
    Thanks in Advance.

    Check out [this post|http://obiee101.blogspot.com/2009/04/obiee-showing-zero-in-bargraph.html].

  • How can I select a date to view in Calendar while I am in month view?

    I am looking at month view in Calendar on my iPad. I touch a date. Intuitively, I expect that date to open up in Day or Week view, but it doesn't! On my iphone, it works just fine. Am I missing something?
    How can I select a date to view while in Month view and have it go to Day or Week view?
    Thanks for any help.

    I would try this:
    In Lr import one photo into a different folder that you can see in the list.
    Then in your OS (mac Finder / Win Explorer) move the photo to the folder that you cannot see.
    In Lr the photo will now appear with a question mark on its frame. Click directly on the question mark and select <Locate photo>. Navigate to the folder, open it, and click on the photo.
    Maybe this will help Lr to recognize the folder.
    If this doesn't help try renaming the folder in your OS.

  • To Select the data from two table one is transp table and onther is cluster

    Hi All,
    I want to select the data from two tables
    Here i am giving with an example.
    Fileds: kunnr belnr from bseg.  table bseg
    fields: adrnr from kna1     table: kna1.
    Know i want to put these into one internal table based on kunnr and belnr.
    Thanks in advance.
    Ramesh

    Hi,
       U cant use joins on cluster table and BSEG is a cluster table so use FOR  ALL ENTRIES for taht
    refer this code
    *&      Form  sub_read_bsak
          text
    -->  p1        text
    <--  p2        text
    FORM sub_read_bsak.
    *--Select data from BSAK Table
      SELECT lifnr
             augdt
             augbl
             gjahr
             belnr
             xblnr
             blart
             dmbtr
             mwskz
             mwsts
             sgtxt
             FROM bsak
             INTO CORRESPONDING FIELDS OF TABLE it_bsak
             WHERE belnr IN s_belnr
             AND   augdt IN s_augdt.
      IF sy-subrc EQ 0.
    *--Sort table by accounting document and vendor number
        SORT it_bsak BY belnr lifnr.
      ENDIF.
    ENDFORM.                    " sub_read_bsak
    *&      Form  sub_read_bseg
          text
    -->  p1        text
    <--  p2        text
    FORM sub_read_bseg.
      IF NOT it_bsak[] IS INITIAL.
    *--Select data from BSEG table
        SELECT belnr
               gjahr
               shkzg
               kostl
               hkont
               ebeln
               ebelp
               FROM bseg
               INTO CORRESPONDING FIELDS OF TABLE it_bseg
               FOR ALL ENTRIES IN it_bsak
               WHERE belnr EQ it_bsak-belnr
               AND   gjahr EQ it_bsak-gjahr
               AND   shkzg EQ 'S'.
        IF sy-subrc EQ 0.
    *--Sort table by accounting document
          SORT it_bseg BY belnr.
        ENDIF.
      ENDIF.
    ENDFORM.                    " sub_read_bseg

  • How do I select a date column and display the millesecond along with it.

    I am trying to select a date column from database and want to
    display millesecond with it. How do I do this. I am aware of
    the "alter session set NLS_DATE_FORMAT = 'MM/DD/YY HH:MI:SS'"
    command. However, I do not know how to display this with the
    millesecond.
    Thanks for all the help.

    Example:
    SQL> CREATE OR REPLACE JAVA SOURCE
      2  NAMED "MyTimestamp"
      3  AS
      4  import java.lang.String;
      5  import java.sql.Timestamp;
      6 
      7  public class MyTimestamp
      8  {
      9  public static String getTimestamp()
    10   {
    11   return (new
    12   Timestamp(System.currentTimeMillis())).toString();
    13   }
    14   };
    15  /
    Java created.
    SQL> CREATE OR REPLACE FUNCTION my_timestamp
      2    RETURN VARCHAR2
      3  AS LANGUAGE JAVA
      4  NAME 'MyTimestamp.getTimestamp() return java.lang.String';
      5  /
    Function created.
    SQL> CREATE TABLE test_time
      2    (date_col VARCHAR2 (23))
      3  /
    Table created.
    SQL> INSERT INTO test_time (date_col)
      2  SELECT my_timestamp
      3  FROM   dual
      4  /
    1 row created.
    SQL> SELECT date_col
      2  FROM   test_time
      3  /
    DATE_COL
    2001-11-02 14:58:51.766

Maybe you are looking for