Query related to database tables
Hi,
Im having a requirement wherein i would like to create one ztable and the purpose is only to get the fields but not the values for the same. Bez, with the help of these fields in ztable and developing some logic and it shld be dynamic based on the no of fields appended into ztable.
To be clear, can i write a select query only to get the fields from the table but not the values ( in this no way i will get the values bez i won't insert any records for the same).
I thnk im clear from my end.
Thanks
rohith
To get the fields, you can write the query like this too :
tables: dd03l.
data: begin of itab occurs 0,
fieldname like dd03l-fieldname,
end of itab.
*parameters: p_tab like dd03l-tabname.
select fieldname from dd03l into table itab where tabname = 'VBAK'.
LOOP AT ITAB.
WRITE:/ itab-fieldname.
ENDLOOP.
Similar Messages
-
Query related to Internal Table
Hi ,
I have a small query related to internal table , can we dump millions of records to an internal .
The actual requirment is like i need to develop a report in BI side where i have to dump records into an internal table from PSA tables without filtering .
Can we do so ....
or do we have any other option to dump the data to an internal tables .
need some tips on the same .
Thanks ,
VInay.Hello Vinay,
I believe the following extract will give you a brief idea on the size limitations for an internal table.......
Internal tables are dynamic data objects, since they can contain any number of lines of a particular type. The only restriction on the number of lines an internal table may contain are the limits of your system installation. <u><i>The maximum memory that can be occupied by an internal table (including its internal administration) is 2 gigabytes. A more realistic figure is up to 500 megabytes. An additional restriction for hashed tables is that they may not contain more than 2 million entries.</i></u>
Hope it proved useful
Reward if helpful
Regards
Byju -
Design an uix page which is not related an database table
Hi;
I want to design a uix page, but this page elements is not related an database table, only pass through the parameter to run a report, how can i do this easly
ThanksSuch functionality is not generated/supported by JHeadstart. But you can build this page manually using JDeveloper. Please use the JDeveloper online help and/or the JDeveloper forum for help if you get stuck.
In monitoring this forum we have to set priorities, and we simply lack the resources to help you with questions not related to JHeadstart. I hope you understand this.
Steven Davelaar,
JHeadstart Team. -
How to adjust adhoc query when the database table changed.
DearFreinds,
I have created an adhoc Query , however after few days there was a requirement to remove some fields and change the length of some fields . Now the Adhoc query showing as to adjust , however when iam trying to adjust nothing is happening. Could any one let me know how to adjust with the table strucutre in the adhoc query.
Regards
madhu.Hi Sumit,
Yes i have adjusted the database from se11 itself by going into utlity > adjust database . However i can still see the
adhoc query -> infoset asking me when iam trying to go in change mode saying the database table has been changed do you want to adjust .
I have adjusted by going to more functions still there is no change. Please let me know what exactly i have to do.
regards
madhu -
MV Incremental Refresh on join query of remote database tables
Hi,
I am trying to create a MV with incremental refresh option on a join query with 2 tables of remote database.
Created MV logs on 2 tables in the remote database.
DROP MATERIALIZED VIEW LOG ON emp;
CREATE MATERIALIZED VIEW LOG ON emp WITH ROWID;
DROP MATERIALIZED VIEW LOG ON dept;
CREATE MATERIALIZED VIEW LOG ON dept WITH ROWID;
Now, trying to create the MV,
CREATE MATERIALIZED VIEW mv_emp_dept
BUILD IMMEDIATE
REFRESH FAST
START WITH SYSDATE
NEXT SYSDATE1/(24*15)+
WITH PRIMARY KEY
AS
SELECT e.ename, e.job, d.dname FROM emp@remote_db e,dept@remote_db d
WHERE e.deptno=d.deptno
AND e.sal>800;
Getting ORA-12052 error.
Can you please help me.
Thanks,
AnjanPrimary Key is on EMPNO for EMP table and DEPTNO for DEPT table.
Actually, I have been asked to do an feasibility test whether incremental refresh can be performed on MV with join query of 2 remote database tables.
I've tried with all combinations of ROWID and PRIMARY KEY, but getting different errors. From different links, I found that it's possible, but cannot create any successful testcase anyway.
It will be very much helpful if you can correct my example or tell me the restrictions in this case.
Thanks,
Anjan -
Help with SQL Query Involving Three Database Tables
Hi,
My SQL is very rusty since I have not touched it in over one year.
I was given an SQL question in a job interview and I am curious to know the right answer.
This was a pre-prepared written test and the interviewer did not know the answer.
There are three database tables: STUDENTS, COURSES and STUDENT_COURSES
Table STUDENTS has STUDENT_ID and STUDENT_NAME columns.
Table COURSES has COURSE_ID and COURSE_DESCRIPTION columns.
Table STUDENT_COURSES has columns STUDENT_ID and COURSE_ID.
Provide a query that returns all the students that are enrolled in all the courses.
Thanks,
Avi.It is probably good to say that this task may be solved such way, if database normalized and there are references
Basically here just is a variant of your solution
DROP TABLE student_course;
DROP TABLE student;
DROP TABLE course;
CREATE TABLE student
(student_id NUMBER(9) PRIMARY KEY,
student_name VARCHAR2(30));
CREATE TABLE course
(course_id NUMBER(9) PRIMARY KEY,
dscr VARCHAR2(100));
CREATE TABLE student_course
(student_id NUMBER(9),
course_id NUMBER(9));
ALTER TABLE student_course
ADD CONSTRAINT pk_st_crs PRIMARY KEY
(student_id, course_id);
ALTER TABLE student_course
ADD CONSTRAINT fk_student
FOREIGN KEY (student_id)
REFERENCES student(student_id);
ALTER TABLE student_course
ADD CONSTRAINT fk_course
FOREIGN KEY (course_id)
REFERENCES course(course_id);
INSERT INTO student
VALUES (1, 'NAME1');
INSERT INTO student
VALUES (2, 'NAME2');
INSERT INTO student
VALUES (3, 'NAME3');
INSERT INTO course
VALUES (101, 'Desc 1');
INSERT INTO course
VALUES (102, 'Desc 2');
INSERT INTO course
VALUES (103, 'Desc 3');
INSERT INTO student_course
VALUES (1, 101);
INSERT INTO student_course
VALUES (1, 102);
INSERT INTO student_course
VALUES (2, 101);
INSERT INTO student_course
VALUES (2, 103);
INSERT INTO student_course
VALUES (3, 101);
INSERT INTO student_course
VALUES (3, 102);
INSERT INTO student_course
VALUES (3, 103);
COMMIT ;
WITH st_crs_cnt AS
(SELECT student_id,
COUNT (*) tot
FROM student_course
GROUP BY student_id)
SELECT sc.student_id,
sc.tot
FROM st_crs_cnt sc
WHERE sc.tot = (SELECT COUNT (*) FROM course); -
How to query a sql database table from webdynpro?
Hi All,
Can someone tell me the steps involved in accessing a sql server database table and retrieving the record set from a webdynpro application.
Thanks in advance.
Best regards,
DivyaHello Divya,
I would recommend you to read "Java Persistence" section in Development manual describing various options for database integration http://help.sap.com/saphelp_nw04/helpdata/en/61/fdbc3d16f39e33e10000000a11405a/frameset.htm
Tutorials
http://help.sap.com/saphelp_nw04/helpdata/en/46/ddc4705e911f43a611840d8decb5f6/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/91/9c2226df76f64fa7783dcaa4534395/frameset.htm
Web serices
http://help.sap.com/saphelp_nw04/helpdata/en/d6/f9bc3d52f39d33e10000000a11405a/frameset.htm
EJB
http://help.sap.com/saphelp_nw04/helpdata/en/19/f9bc3d8af79633e10000000a11405a/frameset.htm
Best regards, Maksim Rashchynski. -
hello Experts,
Is there any System table to get the Year.For Example to get the Month we can use T247 database table like this any system table to get year.
thanks
regards,
Ashok.Sorry can you explain what do you mean to get year ??
The below would give you the year.
Year = Sy-datum(4).
If you wish to convert it into words you can use SPELL_WORD and make sure to use currency with zero decimails..in that case it would return two thousand six in words. -
Query related to external table authentication
Hi Gurus,
I am new to OBIEE. When we login to the Oracle Business intelligence, we used to give user as Administrator and password as Administrator.
At this point, can we authentication the userid and password which is stored in external table in a users schema?
~ John"Administrator" will always be a user which is registered in the repository. All other users can be authenticated by external table authentication.
You can create an init block which sets the USER system variable by
SELECT user FROM users WHERE user = ':USER' and password = ':PASSWORD' -
Hello ,
After upgrade , we have observed that there are junk characteristics in field PLZU-PLNNR ( Key for Task List Group)
Could someone explain the contents of table PLZU & what are the dependencies of PLZU with other PL* tablesHello,
I'm not sure I got your exact request.
Below you can find the routing tables and you can chech the contect of each in the TA SE11
(the key fields are always flagged in the tables).
Routing
PLPO Routing Operation Details
PLKO Routing Header Details
MAPL Routing Link to Material
PLAB Relationships - Standard Network
PLAS Task List - Selection of Operations
PLMZ Component Allocation
PLPH CAPP Sub-operations
PLFH PRT Allocation
PLWP Maintenance Package Allocation
PLMK Inspection Characteristics
Best Regards,
Dora -
How an INDEX of a Table got selected when a SELECT query hits the Database
Hi All,
How an Index got selected when a SELECT query hits the Database Table.
My SELECT query is as ahown below.
SELECT ebeln ebelp matnr FROM ekpo
APPENDING TABLE i_ebeln
FOR ALL ENTRIES IN i_mara_01
WHERE werks = p_werks AND
matnr = i_mara_01-matnr AND
bstyp EQ 'F' AND
loekz IN (' ' , 'S') AND
elikz = ' ' AND
ebeln IN s_ebeln AND
pstyp IN ('0' , '3') AND
knttp = ' ' AND
ko_prctr IN r_prctr AND
retpo = ''.
The fields in the INDEX of the Table EKPO should be in the same sequence as in the WHERE clasuse?
Regards,
VijiHi,
You minimize the size of the result set by using the WHERE and HAVING clauses. To increase the efficiency of these clauses, you should formulate them to fit with the database table indexes.
Database Indexes
Indexes speed up data selection from the database. They consist of selected fields of a table, of which a copy is then made in sorted order. If you specify the index fields correctly in a condition in the WHERE or HAVING clause, the system only searches part of the index (index range scan).
The primary index is always created automatically in the R/3 System. It consists of the primary key fields of the database table. This means that for each combination of fields in the index, there is a maximum of one line in the table. This kind of index is also known as UNIQUE. If you cannot use the primary index to determine the result set because, for example, none of the primary index fields occur in the WHERE or HAVING clause, the system searches through the entire table (full table scan). For this case, you can create secondary indexes, which can restrict the number of table entries searched to form the result set.
reference : help.sap.com
thanx. -
Need to insert into NVARCHAR2 column in a database table
I need to insert into a table with column type NVARCHAR2(2000) in java.
Cant use normal setString on that column. How can I do this using PreparedStatement in Java?The scenario is:
I have to read a CSV file which contains a column in Urdu language, and show it on the JTable first.
Then I have to import the JTable contents into a database table.
Database Table structure is:
CREATE TABLE IMPORT_TMP (
ctype VARCHAR2(3),
urdu_name NVARCHAR2(2000)
);My java code which inserts into the database table is:
Vector dataVector = tableModel.getDataVector();
rowVector = (Vector) dataVector.get(row);
cType = "";
if (rowVector.get(INDEX_BANK) != null) {
cType = rowVector.get(INDEX_CTYPE).toString();
urduName = "";
if (rowVector.get(INDEX_URDU_NAME) != null) {
urduName = rowVector.get(INDEX_URDU_NAME).toString();
statementInsert.setString(1, cType);
statementInsert.setString(2, urduName);I also applied Renderer on the table column, my renderer class is:
public class LangFontRenderer extends JLabel implements TableCellRenderer {
private Font customFont;
public LangFontRenderer(Font font) {
super();
customFont = font;
System.out.println("font = " + font.getFontName());
this.setFont(font);
@Override
public Component getTableCellRendererComponent(JTable table,
Object value, boolean isSelected, boolean hasFocus, int row, int column) {
if (value != null) {
if (value instanceof String) {
setText((String) value);
return this;
return this;
@Override
public Font getFont() {
return customFont;
// overriding other methods for performance reasons only
@Override
public void invalidate() {
@Override
public boolean isOpaque() {
return true;
@Override
public void repaint() {
@Override
public void revalidate() {
@Override
public void validate() {
}I applied the renderer on the column as:
TableColumn col = IATable.getColumnModel().getColumn(INDEX_URDU_NAME);
LangFontRenderer langRenderer = new LangFontRenderer(new java.awt.Font("Urdu Naskh Asiatype", 0, 11));
col.setCellRenderer(langRenderer);It does not give any error but when i query on the database table it does not show the column data in Urdu language.
Also it does not show the correct value on JTable column, some un-identified symbols.
Furthermore when I open the CSV file in notepad, it shows the correct language in that column, as I have installed the Urdu language and font on my system. -
How to print database table records in graphical format?
In ABAP Editor,I put select query on one database table and fetch few records .Now I want to show these records in BAR Graph / pie chart.Kindly let me know is it possible and how?
Thanks in advance.
Edited by: rushah on May 21, 2009 5:30 AMHi Hadiman,
Can you please elaborate more on it.
Like my code is......
SELECT * FROM trfcqout
INTO CORRESPONDING FIELDS OF itab
WHERE ( qstate = 'SYSFAIL' OR qstate = 'CPICERR' OR errmess <> '' )
and ( QRFCDATUM >= date-low and QRFCDATUM <= date-high ).
count = 0.
if itab is not initial.
SELECT * FROM trfcqout
INTO CORRESPONDING FIELDS OF itab1
WHERE qname = itab-qname AND errmess = ''.
count = count + 1.
ENDSELECT.
itab-retrydate = sysdate.
itab-retrytime = systime.
itab-qtype = 'OUTBOUND'.
itab-nentries = count - 1.
append itab.
MODIFY zqueue FROM itab.
endif.
ENDSELECT.
Print details on Report
write: / sy-vline no-gap,(7) 'QTYPE' COLOR 1, sy-vline no-gap,(23)
'QNAME' COLOR 1,sy-vline no-gap,(14) 'QSTATE' COLOR 1, sy-vline no-gap,
(54) 'Error' COLOR 1,sy-vline no-gap,(10) 'Number' COLOR 1.
uline.
LOOP AT itab.
write: / sy-vline no-gap, (8) itab-qtype no-gap,
sy-vline no-gap, (24) itab-qname no-gap,
sy-vline no-gap, (15) itab-qstate no-gap,
sy-vline no-gap, (55) itab-errmess no-gap,
sy-vline no-gap, (10) itab-nentries no-gap.
ENDLOOP.
uline.
refresh itab.
endform. "queuedata
Now I want to print data in graphical form. how to do that? -
RELATIONAL DATABASE TABLES IN SAP BW
hi
friends please give me the information regarding the RELATIONAL DATABASE TABLES IN SAP BW?Hi,
See the tables.
InfoObjects Table:
RSDIOBJ Directory of all InfoObjects
RSDIOBJT Texts of InfoObjects
InfoCube Tables:
RSDCUBE Directory of InfoCubes
RSDCUBET Texts on InfoCubes
DSO Tables:
RSDODSO Directory of all ODS Objects
RSDODSOT Texts of all ODS Objects
PSA Table:
RSTSODS Directory of all PSA Tables
For reports:
RSRREPDIR
Thanks & Regards,
Sathish -
Inner join query used with 7 Database tables
HI All,
In a report they used the Inner join Query with 6 Data base table..now there is a performance issue with at query.
its taking so much of time to trigger that query. Please help how to avoid that performance issue for that.
In that 2 database tables containing lakhs of records..
According to my knowledge it can be avoided by using secondary indexs for those 2 database tables..
and by replacing the Inner join Query with FOR ALL ENTRIES statement.
i want how to use the logic by using FORALL ENTRIES statement for this..
So, please give you proper suggestion to avoid this issue..
Thanking you.
Moderator message: Please Read before Posting in the Performance and Tuning Forum
Edited by: Thomas Zloch on Oct 16, 2011 10:27 PMHi,
And what do you mean with "they used"? If "SAP used" then yo will need to ask a SAP for note
FOR ALL ENTRIES is quite good described in help. Please search forum also.
Without query it won't be possible to tell how it can be optimized, however you can try to use SE30/SAT and ST05. Maybe it will help you.
BR
Marcin Cholewczuk
Maybe you are looking for
-
I am trying to use Adobe Captivate 5 and I am receiving this message when trying to open the application, "Adobe® Captivate® has encountered a problem and needs to close. We are sorry for the inconvenience." Can you explain how this issue can be reso
-
Dear Experts Non valuated material is transferred to another plant via stock transfer order. We have used FRB1 condition in STO with FRE and FR1 keys. In this transaction we want to post freight cost to one of our expense account (GR/IR freight vend
-
as title
-
"Unparseable date" Error at reconciliation
Hi, I am running recconiciliation task using 9.1. GTC DatabaseAppTable connector. In the trusted source table (MS SQL) I have a column containing a date field in the following format: "10/31/1983 12:00:00 AM" In the Connector configuration page, I ha
-
BAPI_CONTRACT_CREATE : Agreement date
Hi, I'm using this fm in order to create contract. I filled BAPI parameter like this: Header-creat_date = 2008.07.20 It should normally fill the agreement date in ME31K but when I take a look after executing BAPI, this date is always sy-datum. Can an