Data Access from Table

Hello
We would like to access data from multiple tables (A , B) using select statement, join and where clause.
Please help and provide the example that how to write a code in SAP .Net to fetch these data without using any function module.
Please help
Regards
Basis

Note the description of the SCN Space from the Overview:
based on the above, are you sure you posted your query to the correct Space?
List of SCN Spaces:
SCN Site Index
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow me on Twitter

Similar Messages

  • Data access from weblogic

    Hi,trying to figure out the most optimum of data access from weblogic. We initially used to do a preparestatement and then execute inside the dopost method of the servlets, but this causes the statement to be parsed everytime. To avoid this we decided to prepare the statements once in the init method of the servlets and do only an execute inside the dopost, but this causes the data in the resutl set objects to be mixed up if two or more users simultaneously accessed the same servlet(resutlsets are not thread safe??). To resolve this problem we did the executes inside a synchronized block but this is not very good for performance.So what is the best way?RgdsHarish

    Make sure you declare your resultset locally.
    Michael Girdley
    BEA Systems
    Learning WebLogic? http://learnweblogic.com
    "Harish" <[email protected]> wrote in message
    news:3acccc04$[email protected]..
    Hi,trying to figure out the most optimum of data access from weblogic. Weinitially used to do a preparestatement and then execute inside the dopost
    method of the servlets, but this causes the statement to be parsed
    everytime. To avoid this we decided to prepare the statements once in the
    init method of the servlets and do only an execute inside the dopost, but
    this causes the data in the resutl set objects to be mixed up if two or more
    users simultaneously accessed the same servlet(resutlsets are not thread
    safe??). To resolve this problem we did the executes inside a synchronized
    block but this is not very good for performance.So what is the best
    way?RgdsHarish

  • Data fetch from table without Refresh and without using tab key.

    hi Friends,
    I have a problem i want to extract data from table without Refresh into text field without using Tab key. when i'll enter any value in a text field then corressponding value should come in to corressponding textfield without using Tab Key.
    eg. when i enter emp_id 101 in a text field then the first_name and last_name ,adress should come in to corressponding text fields without refresh and without using Tab key.
    How Can I do this.
    Thanks
    Manoj

    Hi Manoj,
    I assume that this is similar to: Data fetch without Refresh rather than Re: Value of one textfield should come into another textfield Without Using TAB ?
    If so, the only change you need to make on the first one is to use "onkeyup" instead of "onchange" in the item's "HTML Form Element Attributes" setting.
    Note, however, that the user must move away from the item at some point (for example, to click a button), so the onchange will be triggered anyway.
    Andy

  • Data fetch from table

    i have to select data from a database table into internal table but i want that it shud be selected as it is means i have a char 30 field which may have CAPS and small values in table but in the internal table it comes as all CAPS but it shud come as it is e.g "Data" shud come as "Data" in internal table but it comes as "DATA".

    Just check the Domain of the concerned field. There will be a characteristic check box called "lower case" in the Definition tab of your domain. See if that is Flagged. If that is flagged, then the stored record will be case sensitive. In best practice, you should not have that flagged, So that the records will not be case sensitive and you will not have to face a similar situation.
    Hope this helps.

  • Data relocation from table SOFFCONT1

    Hi experts,
    I have to relocate data from table SOFFCONT1 to an external repository with help of report RSIRPIRL...I went through all related Sap notes and it seems pretty straightforward.
    When I run the report RSIRPIRL I see all the fields I have to fill up (I have already created an content repository as well as a catalogue) but my question is how to select some data manually for testing purpose? Is it any way how to see from table SOFFCONT1 just 1 file for example?? I couldn't see that field in the report RSIRPIRL.
    Regards,
    Blaiso

    Applied OSS note 1536325 which will add an extra field to select by date and narrow the number of documents to test

  • Data retrivel from table ausp table

    Helllo Experts,
    I want to retrive data from table ausp based on the data retrived from the VBAK table.
    I have selected data from VBAK and VBAP tabble using code :
    SELECT VKORG VTWEG VBAKSPART VKGRP VKBUR KUNNR KNUMV VBAKVBELN VBAPMATNR VBAPARKTX INTO CORRESPONDING FIELDS OF  TABLE GT_DATA
    FROM VBAK INNER JOIN VBAP ON VBAKVBELN = VBAPVBELN
    WHERE VKORG        IN SVKORG
    AND  VTWEG        IN SVTWEG
    AND  VBAK~SPART   IN SSPART
    AND  VKGRP        IN SVKGRP
    AND  VKBUR        IN SVKBUR
    AND  KUNNR        IN SKUNNR
    AND  MATNR        IN SMATNR.
    SELECT MATNR BREIT ZEINR BRGEW INTO CORRESPONDING FIELDS OF TABLE GT_EANCODE FROM MARA
    FOR ALL ENTRIES IN LT_DATA WHERE MATNR = GT_DATA-MATNR.
    SORT GT_EANCODE BY MATNR.
    ENDIF.
    SELECT MATNR MVGR1 MVGR2 MVGR3 INTO CORRESPONDING FIELDS OF TABLE GT_MVGR FROM MVKE
    FOR ALL ENTRIES IN LT_DATA WHERE MATNR = LT_DATA-MATNR.
    SORT GT_MVGR BY MATNR.
    ENDIF.
    SELECT KNUMV KPOSN KSCHL KWERT INTO CORRESPONDING FIELDS OF TABLE GT_KONV  FROM KONV
    FOR ALL ENTRIES IN LT_DATA WHERE KNUMV = LT_DATA-KNUMV AND KSCHL IN ('ZG02').
    SORT GT_KONV BY KNUMV.
    So based on the material field in the table GT_DATA i have to select data from table ausp. The ausp table also having the field
    material ( but the name of the material field in the ausp table is OBJEK) . Material field in t the VBAP table have data type character and field length 18 and OBJEC field in the ausp table have data type character and lenght 50.
    So if i give select statement for ausp table
    SELECT OBJEK ATINN ATWRT  INTO CORRESPONDING FIELDS OF TABLE GT_AUSP FROM AUSP
    FOR ALL ENTRIES IN GT_DATA WHERE OBJEK = LT_DATA-MATNR AND
              .                        MFID = '01' AND
                                       KLART = '001' AND
                                       ATINN = V_ATINN.
    it is giving  error : when you use addition for all entries in internal table the object and GT_DATA-MATNR must have same data type and same length.
    So if i change the length of the matnr field it will effect for other select statement.
    please let me know hw to over come errors.
    Thakns in advace.
    Best Regards,
    Zubera

    Hi shridarudupi ,
    when you are declaring structure  for GT_DATA,define matnr field of type ausp-objek , so when you will select data from AUSP using for all entries of GT_DATA , there will  not be any type mismatch.
    For Ex.
    TYPES : BEGIN OF t_mara ,
             matnr TYPE ausp-objek,
             ersda TYPE mara-ersda,
            END OF t_mara,
             BEGIN OF t_ausp ,
             objek TYPE ausp-objek,
             atinn  TYPE ausp-atinn,
            END OF t_ausp.
    DATA : i_mara     TYPE STANDARD TABLE OF t_mara,
                 i_ausp     TYPE STANDARD TABLE OF t_ausp,
                wa_mara  LIKE LINE OF i_mara,
                wa_ausp  LIKE LINE OF i_ausp.
    SELECT matnr
                 ersda
                 FROM mara INTO TABLE i_mara
                 WHERE matnr = '4510'.
    IF sy-subrc = 0 .
      SELECT objek
                    atinn
                    FROM ausp
                    INTO TABLE i_ausp
                    FOR ALL ENTRIES IN i_mara
                    WHERE objek = i_mara-matnr.
      IF sy-subrc = 0 .
        WRITE : 'successful'.
      ENDIF.
    ENDIF.
    Hope this helps.
    Edited By Tejaswini Khante

  • Fast data retreival from Table BSAD

    Dear Friends,
    I want to retrive data from table BSAD and right now it have more than 1,300,000 records.
    for "where condition" i have Customer number, Document number, Document type fixed RV and only
    debit side S.
    What should i do for fast retreival or any function module . right now data fatching is too slow with simple select.
    regards
    Malik

    Hi Malik,
    Pass all the key fields present in the database table, and in the current selection you are using only 2 key fields.  The remaining key fields in this table i.e, BSAD are:
    BUKRS-----     BUKRS---     CHAR     4     0--
         Company Code
    KUNNR-----     KUNNR---     CHAR     10     0--
         Customer Number 1
    UMSKS------     UMSKS-----CHAR     1     0--
         Special G/L Transaction Type
    UMSKZ------     UMSKZ-----CHAR     1     0--
         Special G/L Indicator
    AUGDT-----AUGDT---DATS8     0--
         Clearing Date
    AUGBL------     AUGBL------     CHAR--     10     0--
         Document Number of the Clearing Document
    ZUONR-----DZUONR-     CHAR     180--
         Assignment number
    GJAHR-----     GJAHR---     NUMC     4     0--
         Fiscal Year
    BELNR-----     BELNR_D--     CHAR--10     0--
         Accounting Document Number
    BUZEI--     BUZEI     NUMC     3     0--
         Number of Line Item Within Accounting Document
    Therefore pass as many key fields as possible to improve the performance of the select query.
    Regards,
    Md Ziauddin.

  • Data access from Application Server - Seeking Opinion

    I am working on a fairly large scale ERP application that is written in Java both on the front end, and middle tier ( using a JBoss application server ).
    All of the database access happens in my app server, and when I wanted to get peoples opinions on the best way to extract and pass data to and from the database from the app server, and of course to and from the client.
    I am using JDBC to make database calls and extra data from the database. This is of course pretty trivial. And I first started writing POJO that represent tables in my database. I then wrote a faily length method that uses reflection to call the setting methods and pass in the objects returned from the database result set. This of course becomes tricky when you start to join multiple tables together. And often you only need a small subset of columns in a table and don't require an object with all the columns from the table ( some set, and some as null objects ).
    So then I decided I was use a combination of ArrayList objects and HashMap's to store the data. If a result set returned multiple rows, it would return an ArrayList of HashMap objects. Each hash map would contain the data for that row, and the hash map keys are the column names.
    This seems to work pretty well and resolves the problem of joining multiple tables together and keeping track of which columns get stored in which objects.
    Does anyone have a different solution or idea as to how to handle this? And thoughts or ideas would be greatly appreciated.

    bryano wrote:
    Let me pose a quick Hibernate question as well.Let me recommend that you not be so thin-skinned about responses.
    >
    If you had a table that had 40 columns in it and say 1000 rows. And you needed to run a query that returned all 1000 rows, but you only needed two out of the
    40 columns. Would it be better to extract those two columns into the HashMap / ArrayList collection I mentioned in my original post? Or would using something like Hibernate and a class that mapped all of the columns in the table be okay?Why not just map the columns you needed in Hibernate? Who said you had to map all 40 and have them be null?
    My concern is on efficiency,
    and I was wondering if building 1000 objects that each have 40 members that only 2 are populated is the most efficient way of extracting the data.Doesn't sound very efficient.
    I will admit, my knowledge of Hibernate is limited at best so I may be missing a component of Hibernate that would allow you to only extract the columns you required, but you are still working with an object that has 38 null value objects for the columns you didn't require.I don't believe you're required to map every column in a table.
    %

  • Data fetch from table GLPCA taking long .

    Hi Friends,
    I am fetching five fields from GLPCA table and i have RACCT and RPRCTR ( account Number and profit Centre res ) in the where condition. neither of these field is the primary key of the table GLPCA. I have around 161096,482 entries in the GLPCA. It takes around 20 min to fetch the data. can you guys think of some method so that it works faster.

    Hi Vidya,
    The time utilization is due to the way data base is been accessed. Just think that you are selecting same data in SE16 with 200 hits. See how that behaves. If you find its Ok(i.e. around 1/2 mins) go for open cursor logic. Check this syntax and change the code accordigly and try:
    OPEN CURSOR w_cur1 FOR
           SELECT  ktabg vkorg ktaar ktaer kunnr
                   vtweg spart
                   FROM vbka
                   WHERE ktabg IN so_ktabg AND
                         vkorg IN so_vkorg AND
                         kunnr IN so_kunnr AND
                         ktaar IN so_ktaar AND
                         ktaer IN so_ktaer.
        DO.
          FETCH NEXT CURSOR w_cur1 INTO CORRESPONDING
                FIELDS OF TABLE it_vbka2 PACKAGE SIZE 200.
          IF sy-subrc NE 0.
            CLOSE CURSOR w_cur1.
            EXIT.
          ENDIF.
       ENDDO.
      It behaves just like Select ... Endselect. The most important thing here is the Pakage size which you have to decide based on the SE16 results. Also please mind that if the Package size is less, number of times it hits the DB is high, reducing the efficiency thereby.
    Regards & Thanks,
    Anand

  • Data retrieve from tables in two diff schema in same db

    hi,
    i have one db and name is HWRDB, in this i have two schema PRLHEEP and PRLCFFP.
    in PRLHEEP my table is NAMAS, and in PRLCFFP also table's name is NAMAS.
    i want
    if :unit = 'H' then
    -- connect to PRLHEEP
    select data into some items from NAMAS
    eslif :unit = 'C' then
    -- connect to PRLCFFP
    select data into some items from NAMAS
    endif;
    plz help me to connect to schema. *** db is oracle db, 10g version***

    here is my code,
    if :deloan.unit = 'H' then
    ....... select nmodpay,nbnkacc
    .......into modpay, bnkacc
    .......from namas where nstfno = :deloan.stfno;
    .......select some colums
    .......into some items
    .......from pafac
    ....... where pstfno = :deloan.stfno and
    elsif :deloan.unit = 'C' then
    ....... select nmodpay,nbnkacc
    .......into modpay, bnkacc
    ....... from prlcffp.namas where nstfno = :deloan.stfno;
    .......select some colums
    ....... into some items
    ....... from prlcffp.pafac
    .......where pstfno = :deloan.stfno and
    in forms builder, i connect to prlheep
    when i compile i get errors:
    identifier *'PRLCFFP.NAMAS'* must be declared
    identifier *'PRLCFFP.PAFAC'* must be declared

  • Error in getting Long data type from Table

    Hi All,
    I have one table say xx_long. In this table one column is having Long data type.
    Now I want this values will get in to the PL/SQL variable. I taken variable data type as long but it is showing error "ORA-00997: illegal use of LONG datatype".
    Sample code with which I tried:
    declare
    a long;
    begin
    select slno into a from xx_long where slno = 100;
    dbms_output.put_line('Value:'||a);
    end;
    Please help me on this.
    Thanks in advance.
    Regards,
    Hari

    LONG columns cannot appear in certain parts of SQL statements:
    WHERE clauses, GROUP BY clauses, ORDER BY clauses, or CONNECT BY clauses or with the DISTINCT operator in SELECT statements
    The UNIQUE operator of a SELECT statement
    The column list of a CREATE CLUSTER statement
    The CLUSTER clause of a CREATE MATERIALIZED VIEW statement
    SQL functions (such as SUBSTR or INSTR)
    Expressions or conditions
    SELECT lists of queries containing GROUP BY clauses
    SELECT lists of subqueries or queries combined by the UNION, INTERSECT, or MINUS set operators
    SELECT lists of CREATE TABLE ... AS SELECT statements
    SELECT lists in subqueries in INSERT statements

  • Dynamic data select from table is giving dump

    Hello Experts,
       Below statement is giving Dump after it move all the data in my dynamic table.
    When i see in debug. All my recored are avilable in <T_TAB> Table.
    SELECT * FROM (pa_tab) INTO CORRESPONDING FIELDS OF TABLE <T_TAB>.
    > IF SY-SUBRC = 0.
    Information on where terminated
    The termination occurred in the ABAP program "ZFIR_ZTABLE_UPLOAD" in
    "F_DOWNLOAD".
    The main program was "ZFIR_ZTABLE_UPLOAD ".
    The termination occurred in line 403 of the source code of the (Include)
    program "ZFIR_ZTABLE_UPLOAD"
    of the source code of program "ZFIR_ZTABLE_UPLOAD" (when calling the editor
    4030).
    Processing was terminated because the exception "CX_SY_OPEN_SQL_DB" occurred in
    the
    procedure "F_DOWNLOAD" "(FORM)" but was not handled locally, not declared in
    the
    RAISING clause of the procedure.
    The procedure is in the program "ZFIR_ZTABLE_UPLOAD ". Its source code starts
    in line 399
    of the (Include) program "ZFIR_ZTABLE_UPLOAD ".
    please help me.
    Regards,
    Amit
    Message was edited by:
            Amit Gupta

    Hi Amit,
    Check if you are doing the following in your program
    FIELD-SYMBOLS <T_TAB> TYPE STANDARD TABLE.
    DATA: g_tabref type ref to data.   "Reference to your table structure
    CREATE DATA g_tabref type standard table of (pa_tab).
    ASSIGN g_tabref->* to <T_TAB>.
    SELECT * FROM (PA_TAB) INTO TABLE <T_TAB>.
    Hope this solves your problem.
    Let me know if you require any further info.
    Enjoy SAP. Reward points of useful
    Rajasekhar

  • Vendor General data extraction from Table

    Hi,
    I need to extract data maintained in 2 fields from vendor master table. These 2 fields are "Standard Communication method" under "communication" tab and "Comments" at the end of the vendor address data. Could you please tell me the table from which I can extract the data maintained in these two fields in vendor master? These fields are not maintained in LFA1 table.
    Thanks
    Satya

    Hi
    Kindly check these tables
         Vendor
         LFA1               Vendor master
         LFB1               Vendor per company code
         LFB5               Vendor dunning data
         LFM1               Purchasing organization data
         LFM2               Purchasing data
         LFBK               Bank details

  • Date Data difference from table

    DB : 11.1.0.7
    I have one table and it has date column without time information. I would like to retrive data for missing consecutive dates more than 2 days.
    For Eg.
    Select * from xyz
    location date
    1 05/10/2011
    1 04/10/2011
    1 01/10/2011
    1 30/09/2011
    1 27/09/2011
    2 04/10/2011
    2 01/10/2011
    2 30/09/2011
    3 04/10/2011
    3 01/10/2011
    3 30/09/2011
    3 29/09/2011
    3 26/09/2011
    3 25/09/2011
    Looking for output be like below.
    Location Missing Date
    1 04/10/2011
    1 30/09/2011
    2 04/10/2011
    3 04/10/2011
    3 29/09/2011
    Any suggestion ?

    with sample_data as (
                         select 1 location ,to_date('05/10/2011','dd/mm/yyyy') dt from dual union all
                         select 1,to_date('04/10/2011','dd/mm/yyyy') from dual union all
                         select 1,to_date('01/10/2011','dd/mm/yyyy') from dual union all
                         select 1,to_date('30/09/2011','dd/mm/yyyy') from dual union all
                         select 1,to_date('27/09/2011','dd/mm/yyyy') from dual union all
                         select 2,to_date('04/10/2011','dd/mm/yyyy') from dual union all
                         select 2,to_date('01/10/2011','dd/mm/yyyy') from dual union all
                         select 2,to_date('30/09/2011','dd/mm/yyyy') from dual union all
                         select 3,to_date('04/10/2011','dd/mm/yyyy') from dual union all
                         select 3,to_date('01/10/2011','dd/mm/yyyy') from dual union all
                         select 3,to_date('30/09/2011','dd/mm/yyyy') from dual union all
                         select 3,to_date('29/09/2011','dd/mm/yyyy') from dual union all
                         select 3,to_date('26/09/2011','dd/mm/yyyy') from dual union all
                         select 3,to_date('25/09/2011','dd/mm/yyyy') from dual
    select  location,
            dt missing_dt
      from  (
             select  location,
                     dt,
                     dt - lag(dt) over(partition by location order by dt) gap
               from  sample_data
      where gap > 2
      LOCATION MISSING_D
             1 30-SEP-11
             1 04-OCT-11
             2 04-OCT-11
             3 29-SEP-11
             3 04-OCT-11
    SQL> SY.

  • Data selection from Table

    Hi ,
    My requirement is to have Commercial Documents which are not Accounted. So that I've used the following logic.
      SELECT a~vbeln
                     a~vbtyp
                     a~fkdat
                     a~bukrs
             a~kunrg
             SUM( b~netwr )
           FROM vbrk AS a INNER JOIN vbrp AS b
           ON avbeln EQ bvbeln
           INTO ls_bill WHERE a~vbtyp EQ 'M'          AND
                              a~fkdat IN s_fkdat      AND
                              a~bukrs IN s_bukrs      AND
                              a~kunrg IN s_kunrg
                        GROUP BY a~vbeln
                                 a~vbtyp
                                 a~fkdat
                                 a~bukrs
                                 a~kunrg.
        l_awkey = ls_bill-vbeln.
        SELECT awkey FROM bkpf INTO l_awkey
                     WHERE awtyp EQ 'VBRK'  AND
                           awkey EQ l_awkey AND
                           bukrs EQ ls_bill-bukrs.
        ENDSELECT.
        IF sy-subrc NE 0.
          APPEND ls_bill TO lt_bill.
        ENDIF.
        CLEAR : ls_bill, l_awkey.
      ENDSELECT.
    Is that the above logic for getting data is correct. or  First taking all the entries from VBRK and VBRP table then selecting entries from BKPF and then if any entry of VBRK is not in BKPF then taking that.
    Regards,
    Rajiv.V
    Moderator message - Moved to the correct forum
    Edited by: Rob Burbank on Dec 10, 2009 9:36 AM

    You should have searched SDN for Performance Tuning.
    Solution :
    Please search SDN for Performance Tuning and then try to understand the use of various statements that you have used in terms of performance.

Maybe you are looking for

  • How to use to_Char in obiee

    Evaluate( 'to_char(%1,%2)' as char,SUM(EQ_HOLDING_FACT.shares),'FM999,999,999,990') A general error has occurred. [nQSError: 42015] Cannot function ship the following expression: Evaluate( to_char(%1,%2),D1.c18, 'FM999,999,999,990') how to resolve it

  • 848P NEO-LS SATA (Native Mode) - Cant Install WinXP

    Okay guys - I have a 848P Neo-LS which seems to be somewhat rare on this site in the support sections. Its a brand new board and looks very fancy. I have a lot of experience with PC's as I repair them on a daily basis however this is my first adventu

  • Why can I not activate chat/text by clicking "Available?"

    I am not able to initiate Chat/Text by clicking "available." At&T and Yahoo believe it has something to do with mal-functioning flash drive. I reloaded lastest Adobe flash drive but problem persists. Any thoughts?? I use Windows XP 32 bit with Intern

  • What is normalization and denormalization in BW

    Hi, i am new to BW i have searched few forums regarding this. some people are telling the if the data in the table is divided in to two tables that is called normalization if suppose if we want to divide the data in to two tables on what condition we

  • Two -annoying- windows open every time I load Photoshop.

    Two -annoying- windows open every time I load Photoshop. One with the message "Could not load the Enable Async I/O module because it doesn't work properly with this version of Photohop" and the other "Could not load the FastCore Routines module becau