Possible for Native SQL to read Pooled Tables?
Hi Experts,
Is it possible to run native SQL against SAP's internal Pool Table, the table that stores the many "Pooled Tables" across SAP? I realize that is much preferred to access the pooled table using Open SQL via ABAP functions, but that is not an option for me. I am writing native SQL against a copy of the SAP ECC underlying tables.
If it is possible, what is the technical name of the table?
Thanks,
Kevin
Hello Kevin,
quite a strange question. As you mentioned it before, the preffered way is to use open sql. The pooled tables are handled by the application server and so, they are not accessible by native sql.
Independently, consider about two things:
1.) The ABAP DDIC uses sometimes different sizes and field-lengths, so you should not read LSTR or LRAW fields with native sql.
2.) You have to be more patient about transaction handling and parameter setting via SQL, because your application server does not get any information about what you have done before.
Kind regards,
Hendrik
Similar Messages
-
Get column names into a VB program, for an SQL query that joins tables
use [mydatabase]
select * from InvNum inum
left join _btblInvoiceLines ilin
on inum.autoindex = ilin.iinvoiceid
left join stkitem s
on ilin.istockcodeid = s.stocklink where InvNumber = 'IVQ0834' or InvNumber = 'IVQ0835'
I need to get out the column names in a VB program in the same order they would appear in the SQL query above...
I want to use something like:
select column_name from information_schema.columns where TABLE_NAME = ....
except there are several tables involved above so I dont know the format!If you execute the query in your program using the SqlDataReader.ExecuteReader method, the column names will be available via the GetName method of the returned reader. But note that your query may return multiple columns with the same name.
Dim reader As SqlDataReader = command.ExecuteReader()
For x = 0 To reader.FieldCount - 1
Console.WriteLine(reader.GetName(x))
Next x
Dan Guzman, SQL Server MVP, http://www.dbdelta.com -
Hi Guru's,
I want to read table 'T077s'
when i see table contents i can see the values for 'TXT30'
when i see the table definition i'm not able to see the field
'TXT30'
how can i read the values of field 'TXT30'.
Thanks in advance.......
Regards,
Vijay.Hi Vijay,
This means u have text table for this.
T077Z is the text table. Pass Language key Chart of accounts and G/L account group to this table.
U can JOIN T077S and T077Z table as well.
To find the text table open ur table in se11=>Menu=>goto=>Text table.
Thanks,
Vinod. -
Looking for PL/SQL to edit simple tables
Does anyone have some pl/sql written
which is a simple table editor?
I have a some 3 or 4 column tables
that I need to be maintaind by an
end user. (100 rows)
I'm not in a windows envirionment!
Any help so that I don't have to do
this from scratch is appreicated!
Thanks,
Robert LeonardDoes anyone have some pl/sql written
which is a simple table editor?
I have a some 3 or 4 column tables
that I need to be maintaind by an
end user. (100 rows)
I'm not in a windows envirionment!
Any help so that I don't have to do
this from scratch is appreicated!
Thanks,
Robert Leonard -
Alternative for EXEC command(Native SQL)
Hi Friends,
While Using the EXEC command in native sql it is showing the obselete Error , Can any one help with giving the alternative for the commands for native SQl.
ImmediateIn a Native SQL statement, data is passed between the ABAP program and the database using host variables. A host variable is an ABAP variable that is identified as such in the Native SQL statement by a preceding colon (:).
Example
Displaying an extract from the table AVERI_CLNT:
DATA: F1(3), F2(3), F3(3).
F3 = ' 1 '.
EXEC SQL.
SELECT CLIENT, ARG1 INTO :F1, :F2 FROM AVERI_CLNT
WHERE ARG2 = :F3
ENDEXEC.
WRITE: / F1, F2.
To simplify the form of the INTO lists in the SELECT statement, you can, as in Open SQL, specify a single structure as the target area.
Example
Displaying an Extract from the Table AVERI_CLNT:
DATA: BEGIN OF WA,
CLIENT(3), ARG1(3), ARG2(3),
END OF WA.
DATA F3(3).
F3 = ' 1 '.
EXEC SQL.
SELECT CLIENT, ARG1 INTO :WA FROM AVERI_CLNT
WHERE ARG2 = :F3
ENDEXEC.
WRITE: / WA-CLIENT, WA-ARG1.
Native SQL supports the directly-executable commands of your underlying database system. There are other special commands that you can use after the EXEC SQL statement for cursor handling, stored procedures (procedures stored in the database), and connections to other databases.
Cursor Processing -
Hi Pals,
I have a requirement which I would like to brief.
I have an internal table with columns FIELD1 and FIELD2. For all the values in FIELD1 I have to query a table MSI(which does not form a part of the R/3 framework) through Native SQL statement and get the corresponding values for FIELD2.
Could anybody suggest how I must proceed writing my statements between EXEC and ENDEXEC.
Do I have to query the database table for each entry in my internal table or is it possible to use for all entries in my SQL statemnt.
Your inputs would be highly appreciated.
Thank You in advance.
Regards,
Gayathri N.Hai Gayathri
check this document
EXEC SQL.
Addition
... PERFORMING form
Effect
Executes the Native SQL command enclosed by the statements EXEC SQL and ENDEXEC . In contrast to Open SQL , addressed database tables do not have to be known to the ABAP/4 Dictionary and the ABAP/4 program does not have to contain appropriate TABLES statements.
Example
Create the table AVERI_CLNT :
EXEC SQL.
CREATE TABLE AVERI_CLNT (
CLIENT CHAR(3) NOT NULL,
ARG1 CHAR(3) NOT NULL,
ARG2 CHAR(3) NOT NULL,
FUNCTION CHAR(10) NOT NULL,
PRIMARY KEY (CLIENT, ARG1, ARG2)
ENDEXEC.
With Native SQL commands, passing data between an ABAP/4 program and the database is achieved using host variables . A host variable is an ABAP/4 variable prefixed by a "*" in the Native SQL statement.
Example
Display a section of the table AVERI_CLNT :
DATA: F1(3), F2(3), F3(3).
F3 = ' 1 '
EXEC SQL.
SELECT CLIENT, ARG1 INTO :F1, :F2 FROM AVERI_CLNT
WHERE ARG2 = :F3
ENDEXEC.
WRITE: / F1, F2.
To simplify the spelling of INTO lists in the SELECT command, you can specify a single structure as the target area as in Open SQL .
Example
Display a section of the table AVERI_CLNT :
DATA: BEGIN OF WA,
CLIENT(3), ARG1(3), ARG2(3),
END OF WA.
DATA F3(3).
F3 = ' 1 '
EXEC SQL.
SELECT CLIENT, ARG1 INTO :WA FROM AVERI_CLNT
WHERE ARG2 = :F3
ENDEXEC.
WRITE: / WA-CLIENT, WA-ARG1.
Notes
In contrast to Open SQL , a client field in Native SQL is a field like any other and must be specified explicitly in calls.
Authorization checks cannot be properly realized in EXEC SQL . You should perform these in the program.
When you start the R/3 System, a CONNECT to the current database is executed automatically. An explicit CONNECT is unnecessary.
A Native SQL command can (but does not have to) end with a ";". Under no circumstances should it end with a ".".
Some database systems allow upper and lower case in table names and field names. If you want to take advantage of this, you must ensure that the spelling of names is correct. To enable entry of lower case letters in names in the ABAP/4 editor, you must set the attribute for upper/lower case in the report.
Since there are no arrays in ABAP/4 , array operations are not possible in Native SQL . If the result of a SELECT command is a table, you can read this table line by line either with the Native SQL command FETCH or with the addition ... PERFORMING form .
Unlike in ABAP/4 programs, the character " in a Native SQL statement does not introduce a comment until the end of the editor line.
Addition
... PERFORMING form
Effect
If the result of a SELECT command is a table, you can read this table line by line in a processing loop. The subroutine form is called once for each line. In this subroutine, you can leave the loop by using EXIT FROM SQL . If the result of the selection is a single record, the subroutine is called only once.
Example
Display a section of the table AVERI_CLNT :
DATA: F1(3), F2(3), F3(3).
F3 = ' 1 '
EXEC SQL PERFORMING WRITE_AVERI_CLNT.
SELECT CLIENT, ARG1 INTO :F1, :F2 FROM AVERI_CLNT
WHERE ARG2 = :F3
ENDEXEC.
FORM WRITE_AVERI_CLNT.
WRITE: / F1, F2.
ENDFORM.
Note
This addition is allowed only with a SELECT command.
Related SELECT , INSERT , UPDATE , MODIFY , DELETE , OPEN CURSOR , FETCH , CLOSE CURSOR, COMMIT WORK and ROLLBACK WORK .
go to se38
type 'EXEC' and put cursor on 'EXEC' press f1-function key
then you get help for EXEC
Thanks & regards
Sreenivasulu P
Message was edited by: Sreenivasulu Ponnadi -
Native sql not populating correct data in ECC6.0 unicode system
Hi,
I am working in an upgrade upgrade project from 4.6c to ECC6.0.
4.6c is non-unicode system. ECC6 is Unicode system.
I am facing Native SQL problem in custom developed programe in ECC6.That means programe reading the data from oracle datbase and stored into internal table.
But data not stored as normal character format that means its stored as different character format.
I am suspecting this is due to unicode system. IF that is issue then please provide
what syntax I have to use for Native SQL statment in unicode system.
I have provided the code which we are using in programe.
data:
i_locn type table of t_locn,
v_locn like line of i_locn.
field-symbols:
<f_005t> type t_005t.
Get existing EIS_VIDEO_LOCN_CONV records
EXEC SQL.
OPEN C FOR
SELECT EIS_LOCN
FROM VIDADMIN.EIS_VIDEO_LOCN_CONV
ENDEXEC.
do.
EXEC SQL.
FETCH NEXT C
INTO :V_LOCN-EIS_LOCN
ENDEXEC.
if sy-subrc ne 0.
exit.
endif.
append v_locn to i_locn.
enddo.
EXEC SQL.
CLOSE C
ENDEXEC.
sort i_locn.
I am facing the problem in i_locn internal table. Please give me your input to solve this issue.
- Anandakumar KHi,
We have resolved this issue with BASIS team help.
We modified the data charcater set as UTF8 in Oracle data base in unicode system ECC6.0 then the programme returns the
exact character format
Regards
K.Anandakumar -
Hi all,
How do i use Native SQL String in the Reciver JDBC Adapter.
Do i need to change the message format could u suggest me some blogs on the same.
Also please can anyone let me knw if i can use this for stored procedure.hi aditya,
there shud be no format as such. for sql xml format there are specific structure. but for native sql there shudnt be any specific structure.
as pointed in sap documentaion:
Instead of an XML document format, a text is expected that represents any valid SQL statement.
When inserting a line into a table the corresponding document looks as follows:
INSERT INTO tableName (column-name1, column-name2, column-name3) VALUES(column-value1, column-value2, column-value3)
so jus make sure that u give a valid sql statement becoz if will be passed as it is to the database and try ur scenario.
regards,
latika. -
Named parameters in Native SQL
A little background first:
Our website uses Hibernate as it's JPA provider, but we've run into several issues with it, one of which they actively refuse to fix out of pure arrogance, even when we gave them a good patch for it. The other one is a performance issue that can be greatly improved by passing arrays as parameters, which I've read rumours is supported in EclipseLink. I first tried implementing a Hibernate UserType as they've specified and it turns out they never read them into the Map that looks-up parameter types during binding, even though it's loaded from their hibernate.cfg.xml. In other words, they're only pretending to support custom user types, but unless you're writing-out the full manual loading of their configuration, there's no way to do it.
After a day of trying to fix all the relation annotations that EclipseLink finds unacceptable in our project (which only uses native SQL and EntityManager.find for selects) I finally got it running and came to discover you don't support named parameters in native SQL. That was really disappointing, because a few months ago we migrated all our queries to named parameters, because positioning ones were too difficult to track and caused more bugs when we had to add more criterias.
My questions are these:
Are named parameters for native SQL not supported by JPA specifications or because they are considered low priority?
Would you accept a patch that supports them?
Can we really use arrays and/or lists as parameters in queries like this "SELECT * FROM some_table WHERE my_column_a IN ? AND my_column_b NOT IN ?"
If yes to above, would it still work if the first one is an array of integers and the second is an array of strings?
Would it work if it's in native SQL and the column types cannot be resolved due to query complexity?A little background first:
Our website uses Hibernate as it's JPA provider, but we've run into several issues with it, one of which they actively refuse to fix out of pure arrogance, even when we gave them a good patch for it. The other one is a performance issue that can be greatly improved by passing arrays as parameters, which I've read rumours is supported in EclipseLink. I first tried implementing a Hibernate UserType as they've specified and it turns out they never read them into the Map that looks-up parameter types during binding, even though it's loaded from their hibernate.cfg.xml. In other words, they're only pretending to support custom user types, but unless you're writing-out the full manual loading of their configuration, there's no way to do it.
After a day of trying to fix all the relation annotations that EclipseLink finds unacceptable in our project (which only uses native SQL and EntityManager.find for selects) I finally got it running and came to discover you don't support named parameters in native SQL. That was really disappointing, because a few months ago we migrated all our queries to named parameters, because positioning ones were too difficult to track and caused more bugs when we had to add more criterias.
My questions are these:
Are named parameters for native SQL not supported by JPA specifications or because they are considered low priority?
Would you accept a patch that supports them?
Can we really use arrays and/or lists as parameters in queries like this "SELECT * FROM some_table WHERE my_column_a IN ? AND my_column_b NOT IN ?"
If yes to above, would it still work if the first one is an array of integers and the second is an array of strings?
Would it work if it's in native SQL and the column types cannot be resolved due to query complexity? -
Using Select option in Native SQL
Hi,
Can any one tell me, how to use select option value in native SQL.
ie.,
I want to use select option in where condition. Need to select all the records from table(non-SAP) where date in given range.
Please suggest.
Thanks,
AmalHi
No!
U need to find a way to convert a range of select-option to a range for Native SQL, probably it should be better doesn't use a select-option for the date but two parameters: one for date from and one for date to.
Max -
Dear all,
could you please help me out from the below.
How to create pooled tables & cluster tables.
When i am trying to create a table, by default it is showing table category as Transparent table.
Regards
Venkathi,
A pool table has many to one relation with the table in the database. For one table in the database there are many tables in the dictionary. Tha table in the database has a diff name than in the table in the data dict, it has diff no of fields and field names are different. A pooled table is stored in the pool at the database level. A table pool is a databse table with a special struct that enables the data of many R3 tables to be stored in it. It can hold only pooled tables
Cluster table are logical tables that must be assigned to a table cluster when they are defined.
Cluster table can be used to store control data they can also used to store temporary data or text such as documentation
Pool table
A database table defined in the ABAP Dictionary whose database instance is assigned to more than one table defined in the ABAP Dictionary. Multiple pool tables are assigned to a table pool in the database. The key fields of a pool table have to be character-type fields. The table pool's primary key consists of two fields: TABNAME for the name of a pool table, and VARKEY for the interdependent contents of the key fields in the corresponding pool table. The non-key fields of the pool table are stored in compressed format in their own column, called VARDATA, of the table pool. The only way to access pool tables is by using Open SQL. Joins are not allowed.
Table Pool
Database table in the database that contains the data of several pool tables.
Cluster Table
Database table defined in the ABAP Dictionary, whose version on the database is not only assigned to one table defined in the ABAP Dictionary. Several cluster tables are assigned to a table cluster in the database. The intersection of the key fields of the cluster tables forms the primary key of the table cluster. The other columns of the cluster tables are stored in compressed form in a single column VARDATA of the table cluster. You can access cluster tables only via Open SQL, and only without using joins.
Table Cluster
Database table in the database that contains the data of several cluster tables.
Note: Never mix up with a database table that has the necessary structure for storing data clusters in database tables and in the shared memory. Those are called INDX-type, with reference to the database table INDX supplied by SAP. Data clusters are groupings of data objects for transient and persistent storage in a selectable storage medium. A data cluster can be processed using the statements IMPORT, EXPORT, and DELETE FROM
Some pooled tables:
T000 Clients
T000C Table for Installing FI-SL Customizing
T000CM Client-specific FI-AR-CR settings
T000F Cross-Client FI Settings
T000G Cross-Client FI-SL Postings
T000GL Flexible general ledger: Customizing check
T000K Group
T000MD MRP at MRP Area Level
T001 Company Codes
T001_ARCH Archive contents short description
T001_CONV Company codes affected by currency convers
T001A Additional Local Currencies Control for Co
T001B Permitted Posting Periods
T001C Valid Posting Periods for Global Companies
T001CM Permitted Credit Control Areas per Company
T001D Validation of Accounting Documents
T001E Company Code-Dependent Address Data
T001F Company code-dependent form selection
T001G Company Code-Dependent Standard Texts
T001I Company Code - Parameter Types
T001J Company Code - Parameter Type Names
T001K Valuation area
T001L Storage Locations
T001M Data on Z5A Foreign Trade Regulations Repo
T001N Company Code - EC Tax Numbers / Notificati
A physical table definition is created in the database for the table definition stored
in the ABAP Dictionary for transparent tables when the table is activated.
The table definition is translated from the ABAP Dictionary to a definition of the particular database.
On the other hand, <b>pooled tables and cluster tables are not created in the database.</b>The data of these tables is stored in the corresponding table pool or table cluster.
It is not necessary to create indexes and technical settings for pooled and cluster tables.
regards,
pritha -
Introduction to Oracle for Experienced SQL Users
Dear members,
where can i find the book for "Introduction to Oracle for Experienced SQL Users" on net in PDF format.
please send my if someone....
Muhammad Nadeem
[email protected]
092-0301-8334434you have to google for it. That's all
"Introduction to Oracle for Experienced SQL Users" -
The number of reloads for the SQL statements
Hi,
in 10g R2, how to see the number of reloads for the SQL statements ? Any query ? Which value is high ? Which valu is low ?
Thanks.thanks all.
It was a test question for 1Z0-042 exam as follows :
The users on your SALESDB are complaining of slow response to their queries. Using the SQL Tuning Advisor, you determine
that the SQL statements are using the best optimization plan. Querying the dynamic views, you see that the number of reloads
for the SQL statements is high, which can cause performance degradation.
Which component of the SGA should you resize to reduce the number of reloads of the SQL statements?
Answer :
shared poolThen I wonder how to see the number of reloads for the SQL ? -
Performance for join 9 custom table with native SQL ?
Hi Expert,
I need your opinion regarding performance to join 9 tables with native sql. Recently i have to tunning some customize extraction cost report. This report extract about 10 million cost of material everyday.
The current program actually, try to populate the condition data and insert into customize table and join all the table to get data using native sql.
SELECT /*+ ordered use_hash(mst,pg,rg,ps,rs,dpg,drg,dps,drs) */
mst.werks, ....................................
FROM
sapsr3.zab_info mst,
sapsr3.zab_pc pg,
sapsr3.zab_rc rg,
sapsr3.zab_pc ps,
sapsr3.zab_rc rs,
sapsr3.zab_g_pc dpg,
sapsr3.zab_g_rc drg,
sapsr3.zab_s_pc dps,
sapsr3.zab_s_rc drs
WHERE mst.zseq_no = :p_rep_run_id
AND mst.werks = :p_werks
AND mst.mandt = rg.mandt(+)
AND mst.ekorg = rg.ekorg(+)
AND mst.lifnr = rg.lifnr(+)
AND mst.matnr = rg.matnr(+)
............................................... unitl all table (9 tables)
AND ps.mandt = dps.mandt(+)
AND ps.knumh = dps.knumh(+)
AND ps.zseq_no = dps.zseq_no(+)
AND COALESCE (dps.kbetr, drs.kbetr, dpg.kbetr, drg.kbetr) <> 0
It seems the query ask for database to using hashed table. would that be it will burden the database ? and impacted to others sap process ?
Please advise
Thank You and Best Regardsyou can only argue coming from measurements and that is not the case.
Coming from the code, I see only that you do not understand it at all, so better leave it as it is. It is not a hash table, but a hash join on these table. -
# coming when I select data from oracle table using Native SQL
Hi Gurus,
I am selecting 'First name' from oracle table directly using native sql. I am fetching 65000 records but 10+ records having '#' at the end of firstname. For eg: John#.
But oracle team couldn't find '#' in their table for those records. What could be problem?
or what could be the character in oracle which comes as '#' in abap?
Pls help...
SajThanks for replies.
My DB NLS_PARAMETER is AL32UTF8. I am able to pullout data with older version of ojdbc jar file. So I think there is no issue regarding NLS setting.
So please guide me with proper solution as soon as possible.
Maybe you are looking for
-
Disk Utility - Won't Repair Flash/Thumb Drive
So my Mac froze for some reason, while my Kingston thumb/flash drive was in. I tried to eject it, but I could only force eject (which it said may cause issues). After that, whenever I put the thumb drive in, it said something like the drive won't wor
-
Pl/sql table - row type records
Hi, Is there any limit on the number of records that a pl/sql table (row type) can accomodate.Iam using oracle 10g
-
In network settings, the ethernet shows up as being disconnected. We have checked physical (ethernet) connections and they all OK. All other devices are working within the LAN. This does not seem to be quite the same as similar discussions RE: confli
-
Connected to internet but will not work.
Hello friends i have gotten an iphone from a friend yesterday. I have yet to get it activated so im just using it on wifi for now. turned it on connected it to my home wifi and had no issues smooth sailing. I later that night went out to eat and conn
-
Can one add subtitles to Itunes downloaded movies without CC?
I recently downloaded a movie in french on Itunes that did not have closed captioning. Is there anyway I can add (french) subtitles to the film? I am learning french and I need to read the titles to fully understand the dialogue. Thanks!