Select Query Date Problem?
Hi,
I using 10g and here is my sample query which brings nothing. I know there are records in the database. It must be related with my date conversions.
SELECT a.gm_cd, a.draw_cd, NVL(b.cpns, 0) cpns, NVL(b.clms, 0) clms, NVL(b.amn, 0) amn FROM (SELECT gm_cd,draw_cd,TO_DATE(draw_tm, 'DD/MM/YYYY') draw_tm FROM draw WHERE gm_cd = 10105 AND TO_DATE(draw_tm, 'DD/MM/YYYY') = TO_DATE(sysdate-1, 'DD/MM/YYYY') ) a, ( SELECT SUM (DECODE (a.from_draw, a.to_draw, a.cpns * b.sing_ind, 0)) cpns, SUM (a.clms* b.sing_ind) clms, SUM (a.amn* b.sing_ind) amn FROM draw_sales a, ACC_TYPE b WHERE a.tp = b.cd AND a.DT = TO_DATE(sysdate-1, 'DD/MM/YYYY') AND a.gm_cd = 10105 ) b ORDER BY a.gm_cd, a.draw_cd
Any ideas?
By the way, draw_tm is a DATE column (11/05/2013 03:59:59) and DT is also a DATE column (10/05/2013)
raysefo wrote:
Hi,
I using 10g and here is my sample query which brings nothing. I know there are records in the database. It must be related with my date conversions.
SELECT a.gm_cd, a.draw_cd, NVL(b.cpns, 0) cpns, NVL(b.clms, 0) clms, NVL(b.amn, 0) amn FROM (SELECT gm_cd,draw_cd,TO_DATE(draw_tm, 'DD/MM/YYYY') draw_tm FROM draw WHERE gm_cd = 10105 AND TO_DATE(draw_tm, 'DD/MM/YYYY') = TO_DATE(sysdate-1, 'DD/MM/YYYY') ) a, ( SELECT SUM (DECODE (a.from_draw, a.to_draw, a.cpns * b.sing_ind, 0)) cpns, SUM (a.clms* b.sing_ind) clms, SUM (a.amn* b.sing_ind) amn FROM draw_sales a, ACC_TYPE b WHERE a.tp = b.cd AND a.DT = TO_DATE(sysdate-1, 'DD/MM/YYYY') AND a.gm_cd = 10105 ) b ORDER BY a.gm_cd, a.draw_cd
Any ideas?
By the way, draw_tm is a DATE column (11/05/2013 03:59:59) and DT is also a DATE column (10/05/2013)If draw_tm is a DATE datatype then you shouldn't be doing a TO_DATE on it, as you don't need to convert it to a date. If you're trying to remove any time component from it, then you should use TRUNC(draw_tm).
Likewise with sysdate, you should use TRUNC to truncate it. Never use TO_DATE on DATA datatypes otherwise you cause an implicit conversion to varchar2 which will depend on your NLS settings and can fail.
Similar Messages
-
hey guys,
i've used a select query to get details from KNA1, KNVV, ADRC, KNVP, pa0002. tables by joining. but i'm getting only about 170 records. there are more than 3000 records in the database. for each tables. here is my select query
SELECT KNA1KUNNR KNA1NAME1 KNA1NAME2 ADRCSTR_SUPPL1 ADRCSTR_SUPPL2 ADRCSTR_SUPPL3 ADRCCITY1 KNVVVWERK KNVPPERNR PA0002VORNA PA0002NACHN KNVVVKBUR KNVVKDGRP KNA1STCD1 KNA1~STCEG
INTO CORRESPONDING FIELDS OF TABLE IT_FINAL FROM KNA1
INNER JOIN KNVV ON KNA1KUNNR = KNVVKUNNR
INNER JOIN ADRC ON KNA1ADRNR = ADRCADDRNUMBER
INNER JOIN KNVP ON KNA1KUNNR = KNVPKUNNR
INNER JOIN PA0002 ON KNVPPERNR = PA0002PERNR
WHERE KNA1KUNNR IN S_KUNNR AND KNVVVWERK in P_VWERK AND PA0002PERNR IN S_PERNR AND KNVVVKBUR IN S_VKBUR AND KNVV~KDGRP IN S_KDGRP.
can anyone tell me the problem in the above query.
thanks.Hi
you are using tables KNA1, KNVV, ADRC, KNVP, pa0002.
Create internal table for each table mentioned above with all the primary keys and find the links between them
then select data in one table and select data from another table into your internal table for all the entries exists in firs internal table.
go for below links.
http://www.sapdev.co.uk/abap/commands/select_forallentries.htm
http://wiki.sdn.sap.com/wiki/display/ABAP/FORALLENTRIES-Home+page
http://help.sap.com/abapdocu_70/en/ABENWHERE_LOGEXP_ITAB.htm
Thanks
lalit -
hi experts,
i have start date & end date in query and difference of the days
must in that query for that what i have to do
i have to calculated key fig r formula
i think normally we will assign date field as char right
if yes, what is the condition & how to choose to fields i.e date either char or key fig
pl give clear idea
thanks in advance
venuHi,
Here you have to include both date charactestics as a part of rows(including in Rows part of query designer), you can use 2 formula variables to get No of days in the report.
1) Create a formula variable with
processing as 'Replacement path'
Caharacterstic = 'Date 1'
Replacement variable with = 'Key'
Dimesion id = 'date'.
2) Create a formula variable with
processing as 'Replacement path'
Caharacterstic = 'Date 2'
Replacement variable with = 'Key'
Dimesion id = 'date'.
3) use the above two formula variables in a formula of the query as difference.
refe the links for reference :
Re: No of Days
Re: formular variable 0calday = today?
with rgds,
Anil Kumar Sharma .P -
How can i use index in select query.. facing problem with the select query.
Hi Friends,
I am facing a serious problem in one of the select query. It is taking a lot of time to fetch data in Production Scenario.
Here is the query:
SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary
FROM ztftelat LEFT JOIN ztfzberep
ON ztfzberep~gjahr = st_input-gjahr
AND ztfzberep~poper = st_input-poper
AND ztfzberepcntr = ztftelatrprctr
WHERE rldnr = c_telstra_accounting
AND rrcty = c_actual
AND rvers = c_ver_001
AND rbukrs = st_input-bukrs
AND racct = st_input-saknr
AND ryear = st_input-gjahr
And rzzlstar in r_lstar
AND rpmax = c_max_period.
There are 5 indices present for Table ZTFTELAT.
Indices of ZTFTELAT:
Name Description
0 Primary key( RCLNT,RLDNR,RRCTY,RVERS,RYEAR,ROBJNR,SOBJNR,RTCUR,RUNIT,DRCRK,RPMAX)
005 Profit (RCLNT,RPRCTR)
1 Ledger, company code, account (RLDNR,RBUKRS, RACCT)
2 Ledger, company code, cost center (RLDNR, RBUKRS,RCNTR)
3 Account, cost center (RACCT,RCNTR)
4 RCLNT/RLDNR/RRCTY/RVERS/RYEAR/RZZAUFNR
Z01 Activity Type, Account (RZZLSTAR,RACCT)
Z02 RYEAR-RBUKRS- RZZZBER-RLDNR
Can anyone help me out why it is taking so much time and how we can reduce it ? and also tell me if I want to use index number 1 then how can I use?
Thanks in advance.Hi Shiva,
I am using two more select queries with the same manner ....
here are the other two select query :
***************1************************
SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary
FROM ztftelpt LEFT JOIN ztfzberep
ON ztfzberep~gjahr = st_input-gjahr
AND ztfzberep~poper = st_input-poper
AND ztfzberepcntr = ztftelptrprctr
WHERE rldnr = c_telstra_projects
AND rrcty = c_actual
AND rvers = c_ver_001
AND rbukrs = st_input-bukrs
AND racct = st_input-saknr
AND ryear = st_input-gjahr
and rzzlstar in r_lstar
AND rpmax = c_max_period.
and the second one is
*************************2************************
SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary
FROM ztftelnt LEFT JOIN ztfzberep
ON ztfzberep~gjahr = st_input-gjahr
AND ztfzberep~poper = st_input-poper
AND ztfzberepcntr = ztftelntrprctr
WHERE rldnr = c_telstra_networks
AND rrcty = c_actual
AND rvers = c_ver_001
AND rbukrs = st_input-bukrs
AND racct = st_input-saknr
AND ryear = st_input-gjahr
and rzzlstar in r_lstar
AND rpmax = c_max_period.
for both the above table program is taking very less time .... although both the table used in above queries have similar amount of data. And i can not remove the APPENDING CORRESPONDING. because i have to append the data after fetching from the tables. if i will not use it will delete all the data fetched earlier.
Thanks on advanced......
Sourabh -
Can I retrieve data from a multiple select query?
I recently have been able to consolidate many queries into one large one, or into large compound queries. I found an instance where I am using a select query in a for loop that may execute up to 400 times. I tried building a huge compound query, and using DB Tools Execute Query vi, followed by the DB Tools Fetch Recordset Data vi. The query executes at the database without an error, but the Fetch Recordset Data vi only returns the first instance. Is there a way to retrieve all the data without having to send up to 400 separate select queries?
Sorry I didn't replt earlier, I was on vacation. The query I am using is to check serial numbers, and determine if they are all valid. The programs purpose is to define a serial number to a pre-existing part number. Our company makes inclinometers and accelerometers, and this entire series of LabVIEW programs is designed to automate the calibration and testing of these units. The part number definitions can contain 3 or 4 hundred parameters, so the database itself consistes of 44 tables with potentially several hundred columns per table. It is designed to not only provide definitions to every part number, but also to store all potential raw unit data to be calculated and formed into a report at any time. The logistics of getting that much data in and out of the database have forced me to do things more effeciently. The actual query in question is to take each serial number either manually entered, or automatically picked, and see if they already exist with the part number they are being defined as. If there are any duplicates, then the program will alert the operator that serial numbers x, y, and z for instance have already been asigned as the part number in question. Currently I run a simple query once for each serial number. This works, but there may be 200 serial numbers assigned. Also the serial numbers can contain upper or lower case letters. By making all the serial number letters into capitals, then into lower case, it could mean up to 400 individual queries going out over the LAN. This is a bandwidth hog, and time consuming. I started experimenting with compound queries. The actual query used is below.
SELECT SERIALNO FROM "maintable" WHERE PARTNO = '475196-001' AND SERIALNO = '3000005';SELECT SERIALNO FROM "maintable" WHERE PARTNO = '475196-001' AND SERIALNO = '3000006';SELECT SERIALNO FROM "maintable" WHERE PARTNO = '475196-001' AND SERIALNO = '3000007';SELECT SERIALNO FROM "maintable" WHERE PARTNO = '475196-001' AND SERIALNO = '3000008';SELECT SERIALNO FROM "maintable" WHERE PARTNO = '475196-001' AND SERIALNO = '3000009'
When I execute this query, SQL Server 2000 has no problem with it, but the DB Tools Fetch Recordset Data vi only returns the first match. I think my answer may lie with OR statements. Rather than sending what amounts to potentially dozens of individual queries, I should be able to chain them into one query with a lot of OR statements. As long as the OR statement is not an exclusive OR statement, I think it should work. I haven't tried it yet, and it may take some time to get the syntax right. The query is built in a for loop with the number of iterations equal to the number of serial numbers being defined. Once I get this working I will alter it to include both upper and lower case letters that can be included in the query. Any suggestiona of how the query should be structured would be most helpful, or another way to achieve what I am trying to accomplish.
SciManStev -
Select query to read data from a view
Hi friends,
We have been using a query to read data from a custom view which used to work perfectly. Now the program sits at that select query forever. We are able to extract same data from se16. Not sure what could be the problem.
Thanks in advance.Dev
Have a look at the Table Index for the tables involved in the View... I think there is some change in the Indexes.. (Add / Remove / Change)
Thanks
Amol Lohade -
Select query problem in JDBC sender adapter
Hello Experts,
We have a problem with PI sender adapter that PI has started to miss records in database some database records are missing and we are using the below selet query :
SELECT * FROM [database name].[dbo].[Material_Movement] WHERE [Process_Order_Number] = (Select TOP 1 [Process_Order_Number] FROM [database name].[dbo].[Material_Movement] WHERE ([PI_Read_Date] IS NULL AND [Movement_Type] = (SELECT TOP 1 [Movement_Type] FROM [database name].[dbo].[Material_Movement] WHERE [Transaction_Code] = 'xyz' AND [PI_Read_Date] IS NULL ORDER BY Created_Date ASC))) AND [Transaction_Code] = 'xyz' AND [Movement_Type] = (SELECT TOP 1 [Movement_Type] FROM [database name].[dbo].[Material_Movement] WHERE [Transaction_Code] = 'xyz' AND [PI_Read_Date] IS NULL ORDER BY Created_Date ASC) AND [PI_Read_Date] IS NULL ORDER BY [Transaction_ID] ASC
I am weak in select query could you please check and suggest how the query can be modified to avoid this issue .
Thanks,
SomenathHi ,
After looking into These Query .. I found ...
Your Query Will run such Kind of scenario ..
1.) Movement Type will be fetched from from below Query
SELECT TOP 1 Movement_Type
FROM database name.dbo.Material_Movement
WHERE Transaction_Code = 'xyz'
AND PI_Read_Date IS NULL
ORDER BY Created_Date ASC
2.) on the basis of abovr fetched moment code . your Query will fetch 1 Process Order number
Select TOP 1 Process_Order_Number
FROM database name.dbo.Material_Movement
WHERE ( PI_Read_Date IS NULL
AND Movement_Type = Moment Type will be same as 1.
3.)
After Getting 1 and 2 . Query will fetch Data from table " dbo.Material_Movement "
On the basis of ..
Movement_Type = value from 1.
Process_order_type = value from 2.
Transaction_Code = 'xyz'
ORDER BY Transaction_ID ASC
So check Missed record Fullfill this Condition or not ....................
If not ... You will get why they are not picked by your given Query ...........
Hope it helps ..
regards
Prabhat Sharma. -
Performance Problem in Select query
Hi,
I have performance Problem in following Select Query :
SELECT VBELN POSNR LFIMG VRKME VGBEL VGPOS
FROM LIPS INTO CORRESPONDING FIELDS OF TABLE GT_LIPS
FOR ALL ENTRIES IN GT_EKPO1
WHERE VGBEL = GT_EKPO1-EBELN
AND VGPOS = GT_EKPO1-EBELP.
as per trace i have analysed that it is fetch the complete table scan from the LIPS table and table contants almost 3 lakh records.
Kindly Suggest what we can do to optimize this query.
Regards,
Harshtypes: begin of line,
vbeln type lips-vbeln
posnr type lips-posnr
lfimg type lips-lfimg
vrkme type lips-vrkme
vgbel type lips- vgbel
vgpos type lips-vgpos
end of line.
data: itab type standard table of line,
wa type line.
IF GT_EKPO1[] IS NOT INITIAL.
SELECT VBELN POSNR LFIMG VRKME VGBEL VGPOS
FROM LIPS INTO TABLE ITAB
FOR ALL ENTRIES IN GT_EKPO1
WHERE VGBEL = GT_EKPO1-EBELN
AND VGPOS = GT_EKPO1-EBELP.
ENDIF. -
How to compare dates in a select query in open sql
Hi
How can I retrieve data pertaining to a specified date using a select query.
I have inserted date using the following code:
String dateString = "2009-03-11";
java.sql.Date date = java.sql.Date.valueOf(dateString);
PreparedStatement stmt =con.prepareStatement("insert into DATEACCESS"
+ "(DATETEST)"
+ "values (?)");
stmt.setDate(1,date);
stmt.executeUpdate();
How can I pass this in a select query,the below mentioned query did not fetch me any results.
Select * from DATEACCESS where DATETEST='2009-03-11'Hi
Has ur date problem resolved ?
If not resolved u can do the following
As u already have sql date today declared . You want to get the data depending on that date
As ur query is
if( today != null)
String query2 = select * from DATEACCESS where DATETEST<= ?
PreparedStatement ps = conn.prepareStatement(query2);
ps.setDate(1,today)
ResultSet rs = ps.executeQuery();
While(rs.next)
////// Here u will get data from query u needed ///
If this also does not work just print the date and check in which format is it returning u .
Regards
Anuradha Rao
Edited by: Anuradha Rao on Mar 20, 2009 10:16 AM -
Problem in select query in QUERY INFOSET
Hi All
I have requirement to find the sales text maintained for sales order in mass in production. By using the FM READ_TEXT i can pass the necessary values to get the sales text. We dont want to write a program and then transprot to P01. So what i did in SQ02 i create a infoset and worte code in the infoset. Here i am facing the problem that in the select query where clause what ever on the selection screen values, for that the query need to fetch the records. But selection screen is dymically selected based on SQVI t-code.
In select query if i write like this
SELECT TDOBJECT TDNAME TDID TDSPRAS
FROM STXH
INTO TABLE IT_TEXT_DETAIL
WHERE TDOBJECT EQ C_KNMT .
Here i have hardcoded KNMT so it will fetch only that value irrespective of any values on the selection screen. How to get the values based on the selection screen. I debugged the query it automatically generates the code for selection screen which i am not able to pass in the program.
SAP has generated this code
select-options SP$00004 for STXH-TDOBJECT.
select-options SP$00005 for STXH-TDNAME.
select-options SP$00006 for STXH-TDID.
If i pass SP$00004 on where clause its giving me error. So how to pass it dynamically. Waiting for experts answer.
Regards
VijayHi Vijay,
In this case concatenate 'TDOBJECT' 'EQ' C_KNMT INTO V_WHERE (Say) SEPERATED BY SPACE.
DATA : v_where(90) type c.
clear v_where.
CONCATENATE 'TDOBJECT'
'EQ'
C_KNMT
INTO V_WHERE
SEPERATED BY SPACE.
SELECT TDOBJECT TDNAME TDID TDSPRAS
FROM STXH
INTO TABLE IT_TEXT_DETAIL
WHERE (V_WHERE) .
Try to do this and let me know in case of any.
Regards,
SRinivas -
Problem during the setting the query data source name in forms 6i
We are now doing assignments in forms 6i actually there is a problem during setting the query data source name in run time.
The problem is
declare
v_query varchar2(200),
begin
v_query :='(select empno,ename,deptno from emp where hiredate =' || control .value1 ||')';
go_block('emp');
set_block_property('emp',query_data_source_name,v_query);
end;
that bolded area is the problem that ia varchar value the single qoutes embedded with that value.how can i embedded single qoutes in that concatenation.
That is now query will run like select empno,ename,deptno from emp where hiredate =control.value
But we need like select empno,ename,deptno from emp where hiredate ='control.value'
Message was edited by:
PunithavelThanks for your response
We fixed the error
and the answer is
declare
v_query varchar2(200),
begin
v_query :='(select empno,ename,deptno from emp where hiredate = ' ' ' || control .value1 ||' ' ' ) ' ;
go_block('emp');
set_block_property('emp',query_data_source_name,v_query);
end; -
Problem in selection from data base with RANGE-TABLE.
Dear folks,
I am facing weird problem with range table in selection query.I have problem with bold part of code.Here when i give input to both ranges r_salesno,r_brandid then and the selection occurs ,when i put black in one of those it does not work.I haev passed Empty table to range if no inpiut in elements..although it does not work..I dont know why it is happening...By the i m using this code in Webdynpro ABAP.Please help points will be awarded..
if Stru_Cn_Selcrtr-ca_slsrl is not initial.
wa_salesno-sign = 'I'.
wa_salesno-option = 'EQ'.
wa_salesno-LOW = Stru_Cn_Selcrtr-ca_slsrl.
APPEND wa_salesno TO r_salesno.
CLEAR : wa_salesno .
else.
wa_salesno-sign = 'I'.
wa_salesno-option = 'EQ'.
wa_salesno-LOW = space.
APPEND wa_salesno TO r_salesno.
CLEAR : wa_salesno .
endif.
if Stru_Cn_Selcrtr-ca_brand is not initial.
wa_brandid-sign = 'I'.
wa_brandid-option = 'EQ'.
wa_brandid-LOW = Stru_Cn_Selcrtr-ca_brand.
APPEND wa_brandid TO r_brandid.
CLEAR : wa_brandid .
else.
wa_brandid-sign = 'I'.
wa_brandid-option = 'EQ'.
wa_brandid-LOW = space.
APPEND wa_brandid TO r_brandid.
CLEAR : wa_brandid .
endif.
*If any of these are given then select data accordingly.
<b>select * from ZNSLVWHDIMMD_LCL
into corresponding fields of table IT_VIEW
WHERE SALESRLNO in r_salesno
* and CREATEDBY in It_crtby_selopt
* and STARTDATE in It_validfrm_selopt
* and ENDDATE in It_validto_selopt
* and STATUS in It_status_selopt1
and BRANDID in r_brandid.
* and MODELNO in It_model_selopt.</b>Hello Nirad
Your coding is problematic. I assume that field SALESRLNO (of table ZNSLVWHDIMMD_LCL) probably means sales number (or sales order) and, thus, must not be empty. If this is correct then the first IF statement is probably wrong:
if Stru_Cn_Selcrtr-ca_slsrl is not initial.
wa_salesno-sign = 'I'.
wa_salesno-option = 'EQ'.
wa_salesno-LOW = Stru_Cn_Selcrtr-ca_slsrl.
APPEND wa_salesno TO r_salesno.
CLEAR : wa_salesno .
else.
REFRESH: r_salesno. " means: select all sales numbers
" NOTE: If you fill the range like below this means that only sales order
" with no sales number (= ' ', space) should be select.
" Thus, there will never be any sales order selected.
* wa_salesno-sign = 'I'.
* wa_salesno-option = 'EQ'.
* wa_salesno-LOW = space.
* APPEND wa_salesno TO r_salesno.
* CLEAR : wa_salesno .
endif.
The same logic applies to the second IF statement. If you want to select all BRANDID if none has been provided as selection criteria then code:
if Stru_Cn_Selcrtr-ca_brand is not initial.
wa_brandid-sign = 'I'.
wa_brandid-option = 'EQ'.
wa_brandid-LOW = Stru_Cn_Selcrtr-ca_brand.
APPEND wa_brandid TO r_brandid.
CLEAR : wa_brandid .
else.
REFRESH: r_brandid. " means: select all BRANDID
* wa_brandid-sign = 'I'.
* wa_brandid-option = 'EQ'.
* wa_brandid-LOW = space.
* APPEND wa_brandid TO r_brandid.
* CLEAR : wa_brandid .
endif.
Regards
Uwe -
Select query in MB51 failing only for posting date(BUDAT)02/02/2010
Hello Experts,
I am having below select query.
It is running perfectly fine for all the dates except 02/02/2010.On all other dates it is getting executed with in second.
For 02/02/2010 it keeps on running for more than 10 minutes and then fails with timeout error.
Please let me know if anyone know any solution for this.
select (g_t_fields)
into corresponding fields of table itab
from mkpf inner join mseg
on mkpfmandt = msegmandt
and mkpfmblnr = msegmblnr
and mkpfmjahr = msegmjahr
WHERE MKPF~BUDAT in BUDAT
and MSEG~BWART in BWART
and MSEG~CHARG in CHARG
and MKPF~FRBNR in FRBNR
and MSEG~KUNNR in KUNNR
and MSEG~LGORT in LGORT
and MSEG~LIFNR in LIFNR
and MSEG~MATNR in MATNR
and MSEG~SOBKZ in SOBKZ
and MKPF~USNAM in USNAM
and MKPF~VGART in VGART
and MSEG~WERKS in WERKS
and MKPF~XBLNR in XBLNR
%_HINTS
ORACLE '&SUBSTITUTE VALUES&'
Moderator message - Please see Please Read before Posting in the Performance and Tuning Forum before posting and please use code tags when posting code - post locked
Edited by: Rob Burbank on Feb 4, 2010 9:02 AMHi Sameer,
Please check on which date the production order has status as "completed".
It could be on 01.02.2015.
Thanks,
Vimal -
In oracle rac, If user query a select query and in processing data is fetched but in the duration of fetching the particular node is evicted then how failover to another node internally?
The query is re-issued as a flashback query and the client process can continue to fetch from the cursor. This is described in the Net Services Administrators Guide, the section on Transparent Application Failover.
-
Problem with JOINs in SELECT query
The parameter wa_dob-e_dob is not getting its definition ....
it contains DOB in current yr.
As i am using Joins also Workarea.... so is it coz Joins & WA cant be used simultaneously in a SELECT query....
Is there any other option to do the same...?
* Global Structure
TYPES : BEGIN OF t_data , "Structure
emp_dob TYPE pa0002-gbdat,
emp_Mailid TYPE pa0105-usrid,
END OF t_data,
BEGIN OF t_dob,
e_dob TYPE pa0002-gbdat,
e_pernr type pa0002-pernr,
END OF t_dob.
* Global Internal Tables (I_)
DATA : i_data TYPE TABLE OF t_data, "Internal Table for output data
i_dob TYPE TABLE OF t_dob. "Internal table for Dob
* Global Work Area (WA_)
DATA : wa_data TYPE t_data, "Work Area for output data
wa_dob TYPE t_dob. "Work Area for Dob
*this is the query where i am getting error
* Field "WA_DOB-E_DOB" Not found.
LOOP AT i_dob INTO wa_dob.
SELECT pa0002~gbdat pa0105~usrid INTO CORRESPONDING FIELDS OF wa_data
FROM pa0002
INNER JOIN pa0105
ON pa0002~pernr = pa0105~pernr
WHERE pa0105~subty EQ 'MAIL' AND
wa_dob-e_dob BETWEEN w_sysdate AND w_edit_sysdate.
ENDSELECT.
APPEND wa_data TO i_data.
CLEAR wa_data.
CLEAR wa_dob.
CLEAR l_temp_dob.
ENDLOOP.Hi,
you are checking the work area in the SELECT. IN WHERE condition of the select u should specify fields in either of the tables pa0002 , pa0105 for data population.
The select is on the database table and not on the work area.for checking the data in the work area do this way:
loop at it_dob into wa_dob.
if wa_dob-e_dob between the range u want (w_sysdate AND w_edit_sysdate)
endif.
endloop.
ie: wa_dob-e_dob >w_sysdate AND wa_dob-e_dob < w_edit_sysdate or
wa_dob-e_dob < w_sysdate AND wa_dob-e_dob > w_edit_sysdate
watever ur requirement is..
regards,
madhu
Maybe you are looking for
-
Can't get songs to show up on ipod
Just recently I had deleted my usual songlist on the ipod and now I can't get any songs to transfer onto the ipod. I tried the restore, reinstall,...from the ipod support but no luck. I am using Musicmatch but it worked on many other occasions. Any a
-
Impact on Packet delay and Jitter due to IPSec
We are planning to use IPSec between two 7604 routers. And IPSec actually adds more overhead to the packet there will be impact on the traffic. We would like to know the impact on Packet delay and Jitter due to IPsec on 7604 or 7606 routers.
-
Make list of names in local variable list appear in alphabetical order?
When you select a variable name from the drop down list of a local variable the list appears to be in chronological order. Is there any to make this list appear in alphabetical order? George
-
Adding field in MRRL Tcode Initial screen
Hi, We have a requirement that i have to add one parameter in MRRL initial screen, Please can any one give guidelines to resolve this issue. With Thanks & Regards, Samba
-
Multiple Aperture Libraries onto iPad
I have several Aperture Libraries. just got an iPad 2 last week. I would like to bring in several Photo Albums into the iPad that are spread across multiple Aperture Libraries. I appears that iTunes only lists the "current" Aperture library's albums