Problem selecting date
i am trying to find out details about purchase orders that were generated on 10th of january 2006.
I fire following query to get the job done. But there is a problem with this query
It does show records for po's generated on 10th jan, but also includes records for 9th jan.
I can use date 8th of jan along with time parameter 23:59:59.
But i don't think it is a correct approach. Can anybody pls give an alternative for this problem.
select * from purchase_order where po_date > '09-jan-2006' and po_date<'11-jan-
2006'
select * from purchase_order where po_date > '09-jan-2006' and po_date<'11-jan-2006' When you said '09-jan-2006' is same as '09-jan-2006 00:00:00', so you will take all row which have '09-jan-2006' with a time after midnight.
You can use trunc :
select * from purchase_order where trunc(po_date)=to_date('100106','DDMMYY');Nicolas.
Similar Messages
-
BI Report Export Problem - Selection data missing
Hi all,
I´m pretty new to Web reports and now I have a problem which might be easy to solve for you experts.
The problem appears when exporting a report. If the user exports the report to PDF or Excel, the data is exported correctly but the selection settings, that the user set, are missing. Only the field name are shown, but not the selected item. Its somewhat of a cosmetical problem, but important to the users.
Interestingly enough, we use many other templates which have the exact same functionality and where it works correctly.
I compared the XML on code on those templates, but there is no major difference.
Here is the important code (at least in my understanding) of the template:
<bi:param name="BUTTON_LIST" type="ORDEREDLIST">
<bi:param name="BUTTON" type="COMPOSITE" index="1">
<bi:param name="CAPTION" value="PDF">
</bi:param>
<bi:param name="ACTION" type="CHOICE" value="INSTRUCTION">
<bi:param name="INSTRUCTION">
<bi:command type="EXPORT">
<bi:param name="ITEM_REF_LIST" type="UNORDEREDLIST">
<bi:param name="ITEM_REF" index="1" value="TEXT_ITEM_9">
</bi:param>
<bi:param name="ITEM_REF" index="2" value="INFO_FIELD_ITEM_2">
</bi:param>
<bi:param name="ITEM_REF" index="3" value="ANALYSIS_ITEM_1">
</bi:param>
</bi:param>
<bi:param name="FOOTER_LEFT" value="DATE">
</bi:param>
<bi:param name="FOOTER_RIGHT" value="PAGEOFPAGES">
</bi:param>
</bi:command>
</bi:param>
</bi:param>
</bi:param>
<bi:item name="INFO_FIELD_ITEM_2" designheight="50" designwidth="300" type="INFO_FIELD_ITEM">
<bi:param name="DATA_PROVIDER_REF" value="DP_1">
</bi:param>
<bi:param name="INFORMATION_ELEMENT_LIST" type="ORDEREDLIST">
<bi:param name="INFORMATION_TYPE" type="CHOICE" index="1" value="VARIABLE">
<bi:param name="VARIABLE" value="IP_VERS_CM01" text="Plan Version">
</bi:param>
</bi:param>
<bi:param name="INFORMATION_TYPE" type="CHOICE" index="2" value="CHARACTERISTIC_LIST">
<bi:param name="CHARACTERISTIC_LIST" type="ORDEREDLIST">
<bi:param name="CHARACTERISTIC" index="1" value="0G_CWW010" text="ProdGr">
</bi:param>
<bi:param name="CHARACTERISTIC" index="2" value="0MATERIAL" text="Material">
</bi:param>
<bi:param name="CHARACTERISTIC" index="3" value="0PROFIT_CTR" text="Planning Unit">
</bi:param>
<bi:param name="CHARACTERISTIC" index="4" value="469EIDJHD8W7F786UEL29ZJVV" text="Country Statement">
</bi:param>
<bi:param name="CHARACTERISTIC" index="5" value="ZXCO_NAV3__ZXCO_BUSN" text="BusSeg Nav">
</bi:param>
</bi:param>
</bi:param>
</bi:param>
</bi:item>
Any input and hints are appreciated.
Regards,
HaraldHello Harald,
As per my understanding, the particular characterisitc is not assigned and that could be the reason for displaying only field name. Please lookinto it.
all the best,
Kind regards,
Praveen -
Error selecting dates around DST
I am having a problem selecting dates from a database at the office. I seem to be unable to select anything on the EDT switchover. I have tried various JDBC versions and it seems to be always wrong. below is my output followed by the code.
I would expect to see this:
2012-03-11 02:24:00.0
2012-03-11 03:24:00.0
What I get
ojdbc14-10.1.0.2.0.jar
2012-03-11 01:24:00.0
2012-03-11 03:24:00.0
ojdbc6_g-11.2.0.2.0.jar
2012-03-11 03:24:00.0
2012-03-11 03:24:00.0
ojdbc6_g-11.2.0.3.jar
2012-03-11 03:24:00.0
2012-03-11 03:24:00.0
import java.sql.*; public class JDBCTest { public static void main(String[] args) throws SQLException { DriverManager.registerDriver(new oracle.jdbc.OracleDriver()); ResultSet bat = DriverManager. getConnection("--JDBCURL--", "username", "password"). prepareCall("select to_date('3/11/2012 02:24:00','mm/dd/yyyy HH:MI:SS') theDate from dual"). executeQuery(); bat.next(); System.out.println(bat.getTimestamp("theDate")); ResultSet man = DriverManager. getConnection("--JDBCURL-", "username", "password"). prepareCall("select to_date('3/11/2012 03:24:00','mm/dd/yyyy HH:MI:SS') theDate from dual"). executeQuery(); man.next(); System.out.println(man.getTimestamp("theDate")); } }
Any ideas on what could be going wrong? What kind of stuff should I be looking at in the DB environment? Is this a potential bug I should file somewhere? Thanks>
I would expect to see this:
2012-03-11 02:24:00.0
2012-03-11 03:24:00.0
>
Your expectations are wrong. There is no 2am thru 2:59:59 am during DST. At 2am the clock moves to 3am so 02:24:00 does not exist.
I get the same results for all of those jar files (including 1.4) except I am not using the _g versions.
>
2012-03-11 03:24:00.0
2012-03-11 03:24:00.0
2012-03-11 01:59:59.0
2012-03-11 03:00:00.0 -- value used was for 02:00:00
>
See Support for Daylight Saving Times in the SQL Language Reference
http://docs.oracle.com/cd/B28359_01/server.111/b28286/sql_elements001.htm -
Extraction problem - selection conditions for data load using abap program
Hi All,
I have a problem loading data over a selected period where the selection of date range is done using ABAP routine (type 6). Here though in the request header tab in monitor screen i'm able to see the selection date range populated correctly, no records are being extracted. But if i delete the abap filter and directly give the same date range for selection we are able to extract data. if any body has faced similar problem and have a solution for it please help me with yur suggestion.
Thanks,
nithin.It seems the the data range is not properly set in the routine.
You can check the value of selection period generated by routine in the data selection tab-> execute button is there .
Click it to to test the selection values generated by the ABAP routine..
If the value here seems correct one then paste the code of the routine that u have written with brief logic details that u have applied.
Sonal..... -
Hi all,
I'm having astrange problem while selecting dates. Could someone please tell me what's wrong:
I'm selecting from S_ASSET_CON, and ATTRIB_26 is the name of the problematic field:
desc S_ASSET_CON;
Name Null? Type
ATTRIB_26 DATE
The query:
SELECT
SAC.ATTRIB_26
FROM S_ASSET SA, S_ASSET_CON SAC, S_PROD_INT SPI
WHERE
SA.SERIAL_NUM = 'XXX'
AND SAC.ASSET_ID = SA.ROW_ID
AND SA.PROD_ID = SPI.ROW_ID;
gives:
ATTRIB_26
06-AUG-10
The query:
SELECT
SAC.ATTRIB_26
FROM S_ASSET SA, S_ASSET_CON SAC, S_PROD_INT SPI
WHERE
SA.SERIAL_NUM = 'XXX'
AND TO_CHAR(SAC.ATTRIB_26, 'YYYY-MM-DD') = '2010-08-06'
AND SAC.ASSET_ID = SA.ROW_ID
AND SA.PROD_ID = SPI.ROW_ID;
gives:
ATTRIB_26
06-AUG-10
But the query:
SELECT
SAC.ATTRIB_26
FROM S_ASSET SA, S_ASSET_CON SAC, S_PROD_INT SPI
WHERE
SA.SERIAL_NUM = 'XXX'
AND SAC.ATTRIB_26 = TO_DATE('2010-08-06', 'YYYY-MM-DD')
AND SAC.ASSET_ID = SA.ROW_ID
AND SA.PROD_ID = SPI.ROW_ID;
returns no row:
no rows selected
Why doesn't the 3rd query return anything??
Thank you in advance!
CThere are mainly 2 reasons
1) If u had inserted hard codedly like
SQL>insert into S_ASSET_CON values ('06-AUG-10');
thn it wud return u the output as it stores the same value
so when u compare S_ASSET_CON='06-AUG-10' thn it will dispalyed
where as if u insert using date format like
SQL>insert into S_ASSET_CON select sysdate from dual;
thn internally it will be stored in the format as 'DD-MON-YY HH24:MI:SS'
so the value of ATTRIB_26='06-AUG-10 13:14:15'
so whn u compare the value will not be matched and so it doesn't return any rows
2)ur 1st query output shows tht ur column has 'DD-MON-YY' date format
and in ur 3rd query
AND SAC.ATTRIB_26 = TO_DATE('2010-08-06', 'YYYY-MM-DD')
here SAC.ATTRIB_26 ,its datatype is date so by default the format will be 'DD-MON-YY' and ur comparing with the format as 'YYYY-MM-DD'
so its also one of the reasons for not returning the value
Regards,
Santosh Minupurey -
Need help - select data from NCLOB column problem
Hi,
Im having problem retrieving data from NCLOB columns via ODBC. After SQLExecdirect on my SELECT statement call to SQLFetch gives me following error:
ORA-24806 LOB form mismatch
I tried following two ways of data retrieval:
SQLExecDirect(hstmt,(SQLTCHAR*)szSQLStatement,SQL_NTS);
SQLBindCol(hstmt,3,SQL_C_TCHAR,chBuffer,sizeof(chBuffer),&iDataLen);
SQLFetch(hstmt);
OR
SQLExecDirect(hstmt,(SQLTCHAR*)szSQLStatement,SQL_NTS);
SQLFetch(hstmt);
SQLGetData(hstmt,3,SQL_C_TCHAR,chBuffer,sizeof(chBuffer),&iDataLen);
Both times call to SQLFetch gives me ORA-24806 LOB form mismatch error.
INSERT and UPDATE for this table works just fine.
If I change NCLOB type to CLOB works just fine, but I will be storing Unicode data, so using CLOB cant be a solution
Any ideas appreciated.
Thanks in advance,
Vlad
Server:
Oracle 9.2 database on Windows 2000 Server
NLS_LANGUAGE = AMERICAN
NLS_TERRITORY = AMERICA
NLS_CHARACTERSET = WE8MSWIN1252
NLS_NCHAR_CHARACTERSET = AL16UTF16
Client:
Unicode C++ application, connects via Oracle 9.2 ODBC driver on Windows XP
NLS_LANG = AMERICAN_AMERICA.WE8MSWIN1252
CREATE TABLE my_nclob_table (
id number (10,0) NOT NULL ,
name nvarchar2 (255) NOT NULL ,
description nvarchar2 (255) NULL ,
definition nclob NOT NULL ,
creation date NOT NULL ,
lastmodified date NOT NULL ,
CONSTRAINT PK_cat_pricelist PRIMARY KEY
id
#define nil NULL
#define null NULL
#define SQL_ERR(__sqlerr__) (((__sqlerr__) != SQL_SUCCESS) && ((__sqlerr__) != SQL_SUCCESS_WITH_INFO))
#define STOP_IF_SQL_ERR(__sqlerr__) \
do \
if (SQL_ERR(__sqlerr__)) goto stop_; \
} while (false)
void eqTestOracleLOBSelect(void)
SQLHENV henv = null;
SQLHDBC hdbc = null;
SQLHSTMT hstmt = null;
SQLRETURN retcode = SQL_SUCCESS;
TCHAR szSQLStatement[] = T("select id, name, definition from mynclob_table");
int iFetchedRows = 0;
TCHAR szMsg[512];
TCHAR chBuffer[2049];
SQLLEN iDataLen = 0;
try
retcode = eqOpenConnectionODBC(_T("myTestDsn"),_T("user"),_T("pwd"),henv,hdbc);
STOP_IF_SQL_ERR(retcode);
retcode = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt);
STOP_IF_SQL_ERR(retcode);
retcode = SQLExecDirect(hstmt,(SQLTCHAR*)szSQLStatement,SQL_NTS);
STOP_IF_SQL_ERR(retcode);
retcode = SQLBindCol(hstmt,3,SQL_C_TCHAR,chBuffer,sizeof(chBuffer),&iDataLen);
STOP_IF_SQL_ERR(retcode);
while (retcode == SQL_SUCCESS)
retcode = SQLFetch(hstmt);
if (retcode == SQL_NO_DATA)
retcode = SQL_SUCCESS;
break;
STOP_IF_SQL_ERR(retcode);
// retcode = SQLGetData(hstmt,3,SQL_C_TCHAR,chBuffer,sizeof(chBuffer),&iDataLen);
// STOP_IF_SQL_ERR(retcode);
++iFetchedRows;
stop_:
if (SQL_ERR(retcode))
MessageBox(null,_T("SQL statement execution error."),_T("Error"),MB_OK);
eqShowStatementError(SQL_HANDLE_STMT,hstmt,retcode);
} else {
_stprintf(szMsg,_T("SQL execution success. Fetched rows: %ld"),iFetchedRows);
MessageBox(null,szMsg,_T("Success"),MB_OK);
catch(...)
MessageBox(null,_T("Unknown exception in eqTestOracleLOBSelect"),_T("Unknown exception"),MB_OK);
if (hstmt != null)
SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
hstmt = null;
if (hdbc != nil)
SQLFreeHandle(SQL_HANDLE_DBC, hdbc);
hdbc = nil;
if (henv != nil)
SQLFreeHandle(SQL_HANDLE_ENV, henv);
henv = nil;
SQLRETURN eqOpenConnectionODBC(TCHAR *szDSN,
TCHAR *szUser,
TCHAR *szPassword,
SQLHENV &henv,
SQLHDBC &hdbc)
SQLRETURN retcode;
henv = nil;
hdbc = nil;
//Allocate environment handle
retcode = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv);
STOP_IF_SQL_ERR(retcode);
//Set the ODBC version environment attribute
retcode = SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_ODBC3, 0);
STOP_IF_SQL_ERR(retcode);
// Allocate connection handle
retcode = SQLAllocHandle(SQL_HANDLE_DBC, henv, &hdbc);
STOP_IF_SQL_ERR(retcode);
// Set login timeout to 5 seconds.
SQLSetConnectAttr(hdbc, SQL_LOGIN_TIMEOUT, (void*)5, 0);
STOP_IF_SQL_ERR(retcode);
retcode = SQLConnect(hdbc, (SQLTCHAR*)szDSN, SQL_NTS,
(SQLTCHAR*)szUser, SQL_NTS,
(SQLTCHAR*)szPassword, SQL_NTS);
stop_:
if (SQL_ERR(retcode))
MessageBox(null,_T("Connection Error."),_T("Error"),MB_OK);
if (hdbc != nil)
eqShowStatementError(SQL_HANDLE_DBC, hdbc,retcode);
SQLFreeHandle(SQL_HANDLE_DBC, hdbc);
hdbc = nil;
if (henv != nil)
eqShowStatementError(SQL_HANDLE_ENV, henv,retcode);
SQLFreeHandle(SQL_HANDLE_ENV, henv);
henv = nil;
} else MessageBox(null,_T("Connected."),_T("Success"),MB_OK);
return retcode;
void eqShowStatementError(SQLSMALLINT chHandleType, SQLHANDLE hHandle,long lErrOrig)
SQLRETURN nErr = SQL_SUCCESS;
int nRecNum = 1;
SQLTCHAR szSqlState[6];
SQLTCHAR szMsg[SQL_MAX_MESSAGE_LENGTH];
SQLSMALLINT nMsgLen;
SQLINTEGER nNativeError;
while ((nErr = SQLGetDiagRec(chHandleType,hHandle,nRecNum,
szSqlState, &nNativeError,
szMsg, sizeof(szMsg), &nMsgLen)) != SQL_NO_DATA)
szSqlState[5] = 0;
MessageBox(NULL,(const TCHAR *)szMsg,_T("ODBC Error"),MB_OK);
++nRecNum;Yes, the 9.2.0.2 driver can be downloaded from OTN. I don't believe it will solve your particular problem, but it will help in general. If you don't grab the latest version, you'll probably have to chack the "Force SQL_WCHAR Support" option in the DSN configuration.
From the help file
"The C data type, SQL_C_WCHAR, was added to the ODBC interface to allow applications to specify that an input parameter is encoded as Unicode or to request column data returned as Unicode. The macro SQL_C_TCHAR is useful for applications that need to be built as both Unicode and ANSI. The SQL_C_TCHAR macro compiles as SQL_C_WCHAR for Unicode applications and as SQL_C_CHAR for ANSI applications."
My first thought would be that your application is not being compiled as Unicode. If you substitute SQL_C_WCHAR for SQL_C_TCHAR when you're dealing with NCLOB columns, I suspect you'll have better luck.
More help file
"The SQL data types, SQL_WCHAR, SQL_WVARCHAR, and SQL_WLONGVARCHAR, were added to the ODBC interface to represent columns defined in a table as Unicode. These values are potentially returned from calls to SQLDescribeCol, SQLColAttribute, SQLColumns, and SQLProcedureColumns. In Oracle release 8.1.7.0.0 or 9.0.1.0.0, the Oracle database does not support encoding columns as Unicode. These values would not be returned from the ODBC Drivers for Oracle release 8.1.7.0.0 or for Oracle 9.0.1.0.0 databases.
In Oracle release 9.2.0.0.0, Unicode encoding was supported for SQL column types NCHAR, NVARCHAR2, and NCLOB. In addition, Unicode encoding was also supported for SQL column types CHAR and VARCHAR2 if the character semantics were specified in the column definition.
Starting with release 9.2.0.2.0, the ODBC Driver supports these SQL column types and maps NCHAR to the SQL data type SQL_WCHAR, NVARCHAR2 is mapped to SQL_WVARCHAR, and NCLOB is mapped to SQL_WLONGVARCHAR. The SQL CHAR column is mapped to SQL_WCHAR and the VARCHAR2 column is mapped to SQL_WVARCHAR if the character semantics are specified for the column. While the Force SQL_WCHAR Support option is still available in the 9.2.0.2.0 ODBC Driver, it is no longer required for Unicode support."
Justin -
Hi,
I have the below code
Select VBELN VKORG From LIKP into table IT_LIKP
where VKORG = VKORG
AND ERDAT = ERDAT
AND WADAT_IST NE ' '.
I want to select all deliveries VBELN from LIKP as per criteria in where clause and as i mention WADAT_IST NE ' '. but still it is selecting data where WADAT_IST is blank I also try with using SPACE insted of ' ' not still it is selecting two records.
regards,
zafarhi
No matters let it come like that ,
delete those unwanted spaced rows , from the internal table as.
loop at IT_LIKP into IT_LIKP.
if it_likp-WADAT_IST = ' '.
delete it_likp.
endif.
endloop. -
Problem in data selection tab in infopack
Hi,
I created one text datasource ZACCOUNT_GRP_TEXT based on infoset.
in r/3 , SPRAS is selected as a selection field .
but wen i created the infopak for this , in data selection tab its not giving me the option of sparas selection dats coming blank .
plz let me know the reason why data selection tab is blank and how i can correct it.
thnxhi,
go to extract structure and see whether the selection coulmn is checked for this field.
if not check then check and save it.
now go to rsa3 and see wheter the field is coming in selection.
if yes then replicate the datasourcee to the bw.
now create the infopackage u get the field in IP. -
Facing problem in selecting data based on the join s tatement ppls suggest
hi
cosider a sceneio as below
there are six tables table1
table2
table3 table4
table5 table6
join conditons between tables
table1-lclic (primary key) = table2-lclic
table1-lgreg = table3-lgreg (PK for table 3)
table2-pobj = table4-pobj
i have used join statment to join table 1 table 2table3
i want to select data from table5
table5-ccngn and table6-text
now condion for validation is that
table5-field1 is selected if table4-ctsex = table3-ctsty and tehre is no link between table 5 and table 3 o nly link is through table 4
table4-ctsnum=table5-ctsnum (primary keys)
can anyone suggest how to format the select statement
regards
AroraHi Nishant,
Using Table Joins for multiple tables would severely hamper the performance of the SAP system.
Instead use individual select statements for each database table, and later reconcile all the internal tables.
<b>Reward points, if helpful.</b>
Regards,
Atin -
Error while selecting date from external table
Hello all,
I am getting the follwing error while selecting data from external table. Any idea why?
SQL> CREATE TABLE SE2_EXT (SE_REF_NO VARCHAR2(255),
2 SE_CUST_ID NUMBER(38),
3 SE_TRAN_AMT_LCY FLOAT(126),
4 SE_REVERSAL_MARKER VARCHAR2(255))
5 ORGANIZATION EXTERNAL (
6 TYPE ORACLE_LOADER
7 DEFAULT DIRECTORY ext_tables
8 ACCESS PARAMETERS (
9 RECORDS DELIMITED BY NEWLINE
10 FIELDS TERMINATED BY ','
11 MISSING FIELD VALUES ARE NULL
12 (
13 country_code CHAR(5),
14 country_name CHAR(50),
15 country_language CHAR(50)
16 )
17 )
18 LOCATION ('SE2.csv')
19 )
20 PARALLEL 5
21 REJECT LIMIT UNLIMITED;
Table created.
SQL> select * from se2_ext;
SQL> select count(*) from se2_ext;
select count(*) from se2_ext
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04043: table column not found in external source: SE_REF_NO
ORA-06512: at "SYS.ORACLE_LOADER", line 19It would appear that you external table definition and the external data file data do not match up. Post a few input records so someone can duplicate the problem and determine the fix.
HTH -- Mark D Powell -- -
Devloped an ALV report for daily cash receipts for selected date range
hi,
how to devlop an ALV report for daily cash receipts for selected date range.for this report what are the tables and fields we have to use.what is the selectionscreen&what is logic.give me sample report.Hi,
You can develop simple reports using Report Painter.
You may be also interested in:
Check report SAPMF05A for credit memo
See the following Std reports on Payment Advices execute the Tcodes:
S_ALR_87009888
S_ALR_87009889
S_ALR_87009890
S_ALR_87009891
S_ALR_87009892
S_ALR_87009893
S_ALR_87009978
S_ALR_87009979
S_ALR_87009980
S_ALR_87009981
S_ALR_87009982
S_ALR_87009983
S_ALR_87010056
S_ALR_87010057
S_ALR_87010058
S_ALR_87010059
S_ALR_87010060
S_ALR_87010061
S_ALR_87010066
S_ALR_87010067
S_ALR_87012106
S_ALR_87012107
S_ALR_87012108
S_ALR_87012109
S_ALR_87012110
S_ALR_87012111
S_ALR_87012116
S_ALR_87012117
S_ALR_87012200
S_ALR_87012201
S_ALR_87012202
S_ALR_870122
S_ALR_87012204
S_ALR_87012205
S_ALR_87012350
S_ALR_87012351
S_ALR_87012352
S_ALR_87012353
S_ALR_87012354
S_ALR_87012355
sample ALV report:
tables:
marav. "Table MARA and table MAKT
Data to be displayed in ALV
Using the following syntax, REUSE_ALV_FIELDCATALOG_MERGE can auto-
matically determine the fieldstructure from this source program
Data:
begin of imat occurs 100,
matnr like marav-matnr, "Material number
maktx like marav-maktx, "Material short text
matkl like marav-matkl, "Material group (so you can test to make
" intermediate sums)
ntgew like marav-ntgew, "Net weight, numeric field (so you can test to
"make sums)
gewei like marav-gewei, "weight unit (just to be complete)
end of imat.
Other data needed
field to store report name
data i_repid like sy-repid.
field to check table length
data i_lines like sy-tabix.
Data for ALV display
TYPE-POOLS: SLIS.
data int_fcat type SLIS_T_FIELDCAT_ALV.
select-options:
s_matnr for marav-matnr matchcode object MAT1.
start-of-selection.
read data into table imat
select * from marav
into corresponding fields of table imat
where
matnr in s_matnr.
end-of-selection.
Now, we start with ALV
To use ALV, we need a DDIC-structure or a thing called Fieldcatalogue.
The fieldcatalouge can be generated by FUNCTION
'REUSE_ALV_FIELDCATALOG_MERGE' from an internal table from any
report source, including this report.
The only problem one might have is that the report and table names
need to be in capital letters. (I had it )
Store report name
i_repid = sy-repid.
Create Fieldcatalogue from internal table
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = sy-repid
I_INTERNAL_TABNAME = 'IMAT' "capital letters!
I_INCLNAME = sy-repid
CHANGING
CT_FIELDCAT = int_fcat
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = i_repid
I_STRUCTURE_NAME = 'marav'
I_DEFAULT = 'X'
I_SAVE = 'A'
TABLES
T_OUTTAB = imat.
IF SY-SUBRC <> 0.
WRITE: 'SY-SUBRC: ', SY-SUBRC .
ENDIF.
Hope this will help.
Regards,
Naveen. -
How to select data from a table by passing document number from another tab
How to select data from a table by passing document number from another table.
for eg:-
I want to display name, adres, region from ADRC table
by using field delivery document number
Kind Regards,
Shanbagavalli.SHi Shanbagavalli,
There are multiple solutions to this questions a few i will try to answer and then you can take the best required for your requirements.
**Consider that you have a Internal table having document number from other table..
SELECT NAME ADRES REGION FROM ADRC
INTO IT_ADRC
FOR ALL ENTRIES IN IT_DOC
WHERE DOCUMENT_NO = IT_DOC-DOCUMENT_NO.
**Consider that you have 1 document number then
SELECT NAME ADRES REGION FROM ADRC
INTO IT_ADRC
WHERE DOCUMENT_NO = W_DOCUMENT_NO.
Hope this solves your problem.
Regards,
Kunjal -
"evdre encountered a problem retrieving data from the webserver"
Hi
We are using a big report which takes very long time to expand and sometimes we get the error message "evdre encountered a problem retrieving data from the webserver" when expanding the report, but not very often for most of our users. But we have one user who gets this error message almost every second time he expands the report. This user have a computer with same capacity as the rest of us, can there be some setting on the computer or in the client installtion the cause this problem?
We are using BPC 5.1 SP 5
/FredrikHi,
This error occurs usually if we have huge data in combination of our dimensions.
Even, if the selection of your memberset is not apt to the combination of the data present in the back end, you may encounter a data retrival error.
regards
sashank -
I have one problem with Data Guard. My archive log files are not applied.
I have one problem with Data Guard. My archive log files are not applied. However I have received all archive log files to my physical Standby db
I have created a Physical Standby database on Oracle 10gR2 (Windows XP professional). Primary database is on another computer.
In Enterprise Manager on Primary database it looks ok. I get the following message Data Guard status Normal
But as I wrote above the archive log files are not applied
After I created the Physical Standby database, I have also done:
1. I connected to the Physical Standby database instance.
CONNECT SYS/SYS@luda AS SYSDBA
2. I started the Oracle instance at the Physical Standby database without mounting the database.
STARTUP NOMOUNT PFILE=C:\oracle\product\10.2.0\db_1\database\initluda.ora
3. I mounted the Physical Standby database:
ALTER DATABASE MOUNT STANDBY DATABASE
4. I started redo apply on Physical Standby database
alter database recover managed standby database disconnect from session
5. I switched the log files on Physical Standby database
alter system switch logfile
6. I verified the redo data was received and archived on Physical Standby database
select sequence#, first_time, next_time from v$archived_log order by sequence#
SEQUENCE# FIRST_TIME NEXT_TIME
3 2006-06-27 2006-06-27
4 2006-06-27 2006-06-27
5 2006-06-27 2006-06-27
6 2006-06-27 2006-06-27
7 2006-06-27 2006-06-27
8 2006-06-27 2006-06-27
7. I verified the archived redo log files were applied on Physical Standby database
select sequence#,applied from v$archived_log;
SEQUENCE# APP
4 NO
3 NO
5 NO
6 NO
7 NO
8 NO
8. on Physical Standby database
select * from v$archive_gap;
No rows
9. on Physical Standby database
SELECT MESSAGE FROM V$DATAGUARD_STATUS;
MESSAGE
ARC0: Archival started
ARC1: Archival started
ARC2: Archival started
ARC3: Archival started
ARC4: Archival started
ARC5: Archival started
ARC6: Archival started
ARC7: Archival started
ARC8: Archival started
ARC9: Archival started
ARCa: Archival started
ARCb: Archival started
ARCc: Archival started
ARCd: Archival started
ARCe: Archival started
ARCf: Archival started
ARCg: Archival started
ARCh: Archival started
ARCi: Archival started
ARCj: Archival started
ARCk: Archival started
ARCl: Archival started
ARCm: Archival started
ARCn: Archival started
ARCo: Archival started
ARCp: Archival started
ARCq: Archival started
ARCr: Archival started
ARCs: Archival started
ARCt: Archival started
ARC0: Becoming the 'no FAL' ARCH
ARC0: Becoming the 'no SRL' ARCH
ARC1: Becoming the heartbeat ARCH
Attempt to start background Managed Standby Recovery process
MRP0: Background Managed Standby Recovery process started
Managed Standby Recovery not using Real Time Apply
MRP0: Background Media Recovery terminated with error 1110
MRP0: Background Media Recovery process shutdown
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[1]: Assigned to RFS process 2148
RFS[1]: Identified database type as 'physical standby'
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[2]: Assigned to RFS process 2384
RFS[2]: Identified database type as 'physical standby'
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[3]: Assigned to RFS process 3188
RFS[3]: Identified database type as 'physical standby'
Primary database is in MAXIMUM PERFORMANCE mode
Primary database is in MAXIMUM PERFORMANCE mode
RFS[3]: No standby redo logfiles created
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[4]: Assigned to RFS process 3168
RFS[4]: Identified database type as 'physical standby'
RFS[4]: No standby redo logfiles created
Primary database is in MAXIMUM PERFORMANCE mode
RFS[3]: No standby redo logfiles created
10. on Physical Standby database
SELECT PROCESS, STATUS, THREAD#, SEQUENCE#, BLOCK#, BLOCKS FROM V$MANAGED_STANDBY;
PROCESS STATUS THREAD# SEQUENCE# BLOCK# BLOCKS
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
RFS IDLE 0 0 0 0
RFS IDLE 0 0 0 0
RFS IDLE 1 9 13664 2
RFS IDLE 0 0 0 0
10) on Primary database:
select message from v$dataguard_status;
MESSAGE
ARC0: Archival started
ARC1: Archival started
ARC2: Archival started
ARC3: Archival started
ARC4: Archival started
ARC5: Archival started
ARC6: Archival started
ARC7: Archival started
ARC8: Archival started
ARC9: Archival started
ARCa: Archival started
ARCb: Archival started
ARCc: Archival started
ARCd: Archival started
ARCe: Archival started
ARCf: Archival started
ARCg: Archival started
ARCh: Archival started
ARCi: Archival started
ARCj: Archival started
ARCk: Archival started
ARCl: Archival started
ARCm: Archival started
ARCn: Archival started
ARCo: Archival started
ARCp: Archival started
ARCq: Archival started
ARCr: Archival started
ARCs: Archival started
ARCt: Archival started
ARCm: Becoming the 'no FAL' ARCH
ARCm: Becoming the 'no SRL' ARCH
ARCd: Becoming the heartbeat ARCH
Error 1034 received logging on to the standby
Error 1034 received logging on to the standby
LGWR: Error 1034 creating archivelog file 'luda'
LNS: Failed to archive log 3 thread 1 sequence 7 (1034)
FAL[server, ARCh]: Error 1034 creating remote archivelog file 'luda'
11)on primary db
select name,sequence#,applied from v$archived_log;
NAME SEQUENCE# APP
C:\ORACLE\PRODUCT\10.2.0\ORADATA\IRINA\ARC00003_0594204176.001 3 NO
C:\ORACLE\PRODUCT\10.2.0\ORADATA\IRINA\ARC00004_0594204176.001 4 NO
Luda 4 NO
Luda 3 NO
C:\ORACLE\PRODUCT\10.2.0\ORADATA\IRINA\ARC00005_0594204176.001 5 NO
Luda 5 NO
C:\ORACLE\PRODUCT\10.2.0\ORADATA\IRINA\ARC00006_0594204176.001 6 NO
Luda 6 NO
C:\ORACLE\PRODUCT\10.2.0\ORADATA\IRINA\ARC00007_0594204176.001 7 NO
Luda 7 NO
C:\ORACLE\PRODUCT\10.2.0\ORADATA\IRINA\ARC00008_0594204176.001 8 NO
Luda 8 NO
12) on standby db
select name,sequence#,applied from v$archived_log;
NAME SEQUENCE# APP
C:\ORACLE\PRODUCT\10.2.0\ORADATA\LUDA\ARC00004_0594204176.001 4 NO
C:\ORACLE\PRODUCT\10.2.0\ORADATA\LUDA\ARC00003_0594204176.001 3 NO
C:\ORACLE\PRODUCT\10.2.0\ORADATA\LUDA\ARC00005_0594204176.001 5 NO
C:\ORACLE\PRODUCT\10.2.0\ORADATA\LUDA\ARC00006_0594204176.001 6 NO
C:\ORACLE\PRODUCT\10.2.0\ORADATA\LUDA\ARC00007_0594204176.001 7 NO
C:\ORACLE\PRODUCT\10.2.0\ORADATA\LUDA\ARC00008_0594204176.001 8 NO
13) my init.ora files
On standby db
irina.__db_cache_size=79691776
irina.__java_pool_size=4194304
irina.__large_pool_size=4194304
irina.__shared_pool_size=75497472
irina.__streams_pool_size=0
*.audit_file_dest='C:\oracle\product\10.2.0\admin\luda\adump'
*.background_dump_dest='C:\oracle\product\10.2.0\admin\luda\bdump'
*.compatible='10.2.0.1.0'
*.control_files='C:\oracle\product\10.2.0\oradata\luda\luda.ctl'
*.core_dump_dest='C:\oracle\product\10.2.0\admin\luda\cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_file_name_convert='luda','irina'
*.db_name='irina'
*.db_unique_name='luda'
*.db_recovery_file_dest='C:\oracle\product\10.2.0\flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=irinaXDB)'
*.fal_client='luda'
*.fal_server='irina'
*.job_queue_processes=10
*.log_archive_config='DG_CONFIG=(irina,luda)'
*.log_archive_dest_1='LOCATION=C:/oracle/product/10.2.0/oradata/luda/ VALID_FOR=(ALL_LOGFILES, ALL_ROLES) DB_UNIQUE_NAME=luda'
*.log_archive_dest_2='SERVICE=irina LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES, PRIMARY_ROLE) DB_UNIQUE_NAME=irina'
*.log_archive_dest_state_1='ENABLE'
*.log_archive_dest_state_2='ENABLE'
*.log_archive_max_processes=30
*.log_file_name_convert='C:/oracle/product/10.2.0/oradata/irina/','C:/oracle/product/10.2.0/oradata/luda/'
*.open_cursors=300
*.pga_aggregate_target=16777216
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=167772160
*.standby_file_management='AUTO'
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='C:\oracle\product\10.2.0\admin\luda\udump'
On primary db
irina.__db_cache_size=79691776
irina.__java_pool_size=4194304
irina.__large_pool_size=4194304
irina.__shared_pool_size=75497472
irina.__streams_pool_size=0
*.audit_file_dest='C:\oracle\product\10.2.0/admin/irina/adump'
*.background_dump_dest='C:\oracle\product\10.2.0/admin/irina/bdump'
*.compatible='10.2.0.1.0'
*.control_files='C:\oracle\product\10.2.0\oradata\irina\control01.ctl','C:\oracle\product\10.2.0\oradata\irina\control02.ctl','C:\oracle\product\10.2.0\oradata\irina\control03.ctl'
*.core_dump_dest='C:\oracle\product\10.2.0/admin/irina/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_file_name_convert='luda','irina'
*.db_name='irina'
*.db_recovery_file_dest='C:\oracle\product\10.2.0/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=irinaXDB)'
*.fal_client='irina'
*.fal_server='luda'
*.job_queue_processes=10
*.log_archive_config='DG_CONFIG=(irina,luda)'
*.log_archive_dest_1='LOCATION=C:/oracle/product/10.2.0/oradata/irina/ VALID_FOR=(ALL_LOGFILES, ALL_ROLES) DB_UNIQUE_NAME=irina'
*.log_archive_dest_2='SERVICE=luda LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES, PRIMARY_ROLE) DB_UNIQUE_NAME=luda'
*.log_archive_dest_state_1='ENABLE'
*.log_archive_dest_state_2='ENABLE'
*.log_archive_max_processes=30
*.log_file_name_convert='C:/oracle/product/10.2.0/oradata/luda/','C:/oracle/product/10.2.0/oradata/irina/'
*.open_cursors=300
*.pga_aggregate_target=16777216
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=167772160
*.standby_file_management='AUTO'
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='C:\oracle\product\10.2.0/admin/irina/udump'
Please help me!!!!Hi,
After several tries my redo logs are applied now. I think in my case it had to do with the tnsnames.ora. At this moment I have both database in both tnsnames.ora files using the SID and not the SERVICE_NAME.
Now I want to use DGMGRL. Adding a configuration and a stand-by database is working fine, but when I try to enable the configuration DGMGRL gives no feedback and it looks like it is hanging. The log, although says that it succeeded.
In another session 'show configuration' results in the following, confirming that the enable succeeded.
DGMGRL> show configuration
Configuration
Name: avhtest
Enabled: YES
Protection Mode: MaxPerformance
Fast-Start Failover: DISABLED
Databases:
avhtest - Primary database
avhtestls53 - Physical standby database
Current status for "avhtest":
Warning: ORA-16610: command 'ENABLE CONFIGURATION' in progress
It there anybody that experienced the same problem and/or knows the solution to this?
With kind regards,
Martin Schaap -
Selecting data from external table
Hi there
I was wondering if somebody could assist me. When I try to select data from an external table, no data is displayed, and in my log file I receive the following error:
KUP-04026: field too long for datatype. Please find attached my external table script.
CREATE TABLE DEMO_FILE_EXT
MACODE NUMBER(7),
MANO NUMBER(7),
DEPNO VARCHAR2(2 BYTE),
DEPTYPE NUMBER(5),
STARTDATE NUMBER(8),
ENDDATE NUMBER(8),
OPTIONSTART NUMBER(8),
BENEFITSTART NUMBER(8),
STARTSUSPEND NUMBER(8),
ENDSUSPEND NUMBER(8),
INITIALS VARCHAR2(5 BYTE),
FIRSTNAME VARCHAR2(20 BYTE),
SURNAME VARCHAR2(25 BYTE),
STR1 VARCHAR2(30 BYTE),
STR2 VARCHAR2(30 BYTE),
STR3 VARCHAR2(30 BYTE),
STR4 VARCHAR2(30 BYTE),
SCODE VARCHAR2(6 BYTE),
POS1 VARCHAR2(30 BYTE),
POS2 VARCHAR2(30 BYTE),
POS3 VARCHAR2(30 BYTE),
POS4 VARCHAR2(30 BYTE),
PCODE VARCHAR2(6 BYTE),
TELH VARCHAR2(10 BYTE),
TELW VARCHAR2(10 BYTE),
TELC VARCHAR2(10 BYTE),
IDNUMBER VARCHAR2(13 BYTE),
DOB NUMBER(8),
GENDER VARCHAR2(1 BYTE),
EMPLOYER_CODE VARCHAR2(10 BYTE),
EMPLOYER_NAME VARCHAR2(900 BYTE)
ORGANIZATION EXTERNAL
( TYPE ORACLE_LOADER
DEFAULT DIRECTORY DEMO_FILES
ACCESS PARAMETERS
( RECORDS DELIMITED BY newline
BADFILE 'Tinusb.txt'
DISCARDFILE 'Tinusd.txt'
LOGFILE 'Tinusl.txt'
SKIP 1
FIELDS TERMINATED BY '|'
MISSING FIELD VALUES ARE NULL
(MACODE,
MANO,
DEPNO,
DEPTYPE,
STARTDATE,
ENDDATE,
OPTIONSTART,
BENEFITSTART,
STARTSUSPEND,
ENDSUSPEND,
INITIALS,
FIRSTNAME,
SURNAME,
STR1,
STR2,
STR3,
STR4,
SCODE,
POS1,
POS2,
POS3,
POS4,
PCODE,
TELH,
TELW,
TELC,
IDNUMBER,
DOB,
GENDER,
EMPLOYER_CODE,
EMPLOYER_NAME
LOCATION (DEMO_FILES:'Test1.txt')
REJECT LIMIT UNLIMITED
LOGGING
NOCACHE
NOPARALLEL;
I have the correct privileges on the directory, but the error seems to be on the EMPLOYER_NAME field. The file I try to upload is in pipe-delimited format. The last field in the file does not have a pipe-delimiter at the end. Can this be the problem? Must I go and look for any trailing spaces? Can I specify in the external table script how many characters I need for the employer_name field? We receive this file from an external company
Thank you very much for the help
Ferdiecommon mistake, you gave the field sizes in the
column listing of the table, but not in the file
definition. oracle does not apply one to the other.
in the file defintion section, give explict field
sizes.Hi shoblock
Sorry for only coming back to you now, thank you for your help, I had to give the explicit field size for the last column (employer name).
Thank you once again!!
Ferdie
Maybe you are looking for
-
Finder stuck in full screen with black background on one monitor
Just upgraded to Mavericks on launch day and a day or so later when I went to change the new Mavericks desktop backgound with another image, the Finder appears to be stuck in full screen mode, but raising the mouse to the top doesn't reveal the norma
-
Need to create a Default Value or WorkFlow with Time Expressions
There are numerous times where our people's targets are measured by week. Our weeks run from Monday through Sunday so we say "week ending" is on Sunday night at midnight. Each rep puts in calls, proposals, etc. but are measured on each weeks targets.
-
I may be switching to a Mac Pro from a PC and had a few questions. I have worked a lot with *Nix so I like the idea of switching due to OS X being based on that. Here are my questions: 1.I am seeing a lot of problems with Leopard on these boards. I h
-
Two error messages appear while trying to synch to I-pod touch. "I-pod cannot be synced. An error occurred while writing to the device." Second msg: I-pod cannot be synced, required disk cannot be found."
-
Upgrading RoboHelp 7 to RoboHelp 9 RoboSource
Hi I'm Trying to upgrade Robohelp 7 to Robohelp 9 as we have just gone Windows7 we also use RoboSource. What are the steps to successfully upgrade?.