‎2007 Apr 27 12:19 PM
Hi Friends,
I have a customised table with a field BUDTM (Posting date). From this table I want to select the data which are equal to or greater than 01.04.2007.
Kindly guide me.
TIA.
Regards,
Mark K
‎2007 Apr 27 12:20 PM
select * from ztable into table itab
where budtm >= '20070401'.
‎2007 Apr 27 12:27 PM
Hi,
I have tried like this, but not getting the data. But if I look into the table, data is available for the given date.
Kindly suggest me.
Regards,
‎2007 Apr 27 12:29 PM
How is the data stored in the field? Is it a concatenated value of date and time?
eg: 20070104132056
Sudha
‎2007 Apr 27 12:45 PM
‎2007 Apr 27 12:46 PM
Hi,
Data is stored as YYYYMMDD.
Why it is not working, I do not understand.
Regards,
‎2007 Apr 27 12:49 PM
Are u sure there is some data which is GE to the date in your table..
If yes paste the code here may be we can help.
santhosh
‎2007 Apr 27 12:55 PM
Hi Mark,
Try the below example. Its working fine.
data: begin of itab occurs 0,
ebeln type ebeln,
end of itab.
select ebeln from ekpo
into table itab
where aedat >= '20060421'.
Regards,
Ram
Pls reward points if helpful.
‎2007 Apr 27 12:55 PM
Mark,
Can you paste a small dump of the table contents showing the date field in question and the select query that you are using.
Regards,
Gajendra
‎2007 Apr 27 1:06 PM
Hi,
The code is pasted here below.
SELECT ZNUM REASON REMARKS NEW_PIF BELNR BSTNUM
FROM ZFIH0004_1
INTO CORRESPONDING FIELDS OF TABLE IT_DATA
WHERE ZGROUP = ZFIH0004_1-ZGROUP AND
BUDTM = '20070331'.
Regards,
‎2007 Apr 27 1:08 PM
Hi,
Table contains the data as following:
BUDTM
31.03.2007
31.03.2007
31.03.2007
31.03.2007
31.03.2007
31.03.2007
31.03.2007
31.03.2007
31.03.2007
31.03.2007
Regards,
‎2007 Apr 27 1:09 PM
what is 'ZFIH0004_1-ZGROUP'?
if it is one of the values of ZGROUP then change the select statement as below
SELECT ZNUM REASON REMARKS NEW_PIF BELNR BSTNUM
FROM ZFIH0004_1
INTO CORRESPONDING FIELDS OF TABLE IT_DATA
WHERE ZGROUP = <b>'ZFIH0004_1-ZGROUP'</b>
AND BUDTM = '20070331'.
if <b>ZFIH0004_1</b> is a select-option then change the select statement as below
SELECT ZNUM REASON REMARKS NEW_PIF BELNR BSTNUM
FROM ZFIH0004_1
INTO CORRESPONDING FIELDS OF TABLE IT_DATA
WHERE ZGROUP IN <b>ZFIH0004_1</b>
AND BUDTM = '20070331'.
Message was edited by:
Rajesh
Message was edited by:
Rajesh
‎2007 Apr 27 1:10 PM
The code is not working because of WHERE ZGROUP = ZFIH0004_1-ZGROUP condition.
You are fetching data from ZFIH0004_1 and specifying the same in where clause in this way. How this will work?
Please specify correct condition for ZGROUP.
‎2007 Apr 27 1:11 PM
Hi,
Ur select seems to be OK.
1) First check if ZFIH0004_1-ZGROUP has some value in it.
2) se16 or se11 open your table and go to the selection screen have
ZGROUP
and
BUDTM on ur selection screen there enter the zgroup u need and in the select option of BUDTM give the date and select option as GE...
check if u have the relavent data.
santhosh
‎2007 Apr 27 1:11 PM
hi Mark,
Are you sure the first condition satisfied ??
ZGROUP = ZFIH0004_1-ZGROUP AND
What is the declarationg of ZGROUP , chk out if any leading zeroes are missed ,
use CONVERSION_EXIT_ALPHA_INPUT to retain the leading zeroes
‎2007 Apr 27 1:13 PM
HI,
Just check the table SE11 execute your table
double click on the date field in your screen ..
chose >= selection enter the date..
For sure the data is not available in the table..
I think the query you worte does not match your requirement..
rewardsif useful
regards,
nazeer
Message was edited by:
nazeer shaik
‎2007 Apr 27 1:17 PM
HI,
data lv_date type sy-datum value '20070331'.
SELECT ZNUM REASON REMARKS NEW_PIF BELNR BSTNUM
FROM ZFIH0004_1
INTO CORRESPONDING FIELDS OF TABLE IT_DATA
WHERE ZGROUP = ZFIH0004_1-ZGROUP AND
BUDTM = lv_date..
This will work now..
Else Run your code debug mode and see the values . you will get the solution..
regards
nazeer.
‎2007 Apr 27 1:36 PM
Mark,
The code which you have pasted in response to Rajesh's reply is:
SELECT ZNUM REASON REMARKS NEW_PIF BELNR BSTNUM
FROM ZFIH0004_1
INTO CORRESPONDING FIELDS OF TABLE IT_DATA
WHERE ZGROUP = ZFIH0004_1-ZGROUP AND
BUDTM = '20070331'.
In the above code you have BUDTM = '20070331but in your original post you have mentioned that you want to "select the data which are equal to or greater than 01.04.2007.". Clearly your where clause is not in sync with your requirement.
Change the relational operator as follows and after that I'm sure it would work:
SELECT ZNUM REASON REMARKS NEW_PIF BELNR BSTNUM
FROM ZFIH0004_1
INTO CORRESPONDING FIELDS OF TABLE IT_DATA
WHERE ZGROUP = ZFIH0004_1-ZGROUP AND
BUDTM > '20070331'.
Regards,
Gajendra
‎2007 Apr 27 1:41 PM
SELECT ZNUM REASON REMARKS NEW_PIF BELNR BSTNUM
FROM ZFIH0004_1
INTO CORRESPONDING FIELDS OF TABLE IT_DATA
WHERE ZGROUP = ZFIH0004_1-ZGROUP AND
BUDTM = '20070331'.
My query would be what is ZFIH0004_1-ZGROUP ? Have you defined another parameter/field with the same name ?
Regards
Anurag
‎2007 Apr 30 1:38 PM
Mark,
If your issue was resolved then award points and close this thread.
Regards,
Gajendra
‎2007 Apr 27 12:20 PM
select <fields> ....... where <your fiield >= condition.
Regards Jayant
‎2007 Apr 27 12:21 PM
select * from ztable into table itab where BUDTM GE '20070401'.
‎2007 Apr 27 12:22 PM
Data: GV_Date type Custom-table-BUDTM Value '01.04.2007'.
Select <fieldlist>
from custom-table
into table it_itab
where budtm GE gv_date.
santhosh
‎2007 Apr 27 12:23 PM
p_date
SELECT * FROM ZTABLE
WHERE BUDTM >= p_date.
where p_date is the date parameter and you can input it to be 01.04.2007
‎2007 Apr 27 12:24 PM
DATA: <VAR> LIKE SY-DATUM VALUE 'YYYYMMDD'.
SELECT
<fld1>
<fld2>
<fld3>
....
INTO [CORRESPONDING FIELDS OF TABLE ] <itab>
FROM <dbtab>
WHERE
BUDTM GE <VAR>.
Regards,
A. Singh
‎2007 Apr 27 12:33 PM
hi
good
check the begda and endda with in the if statement comarinng with sy-datum.
thanks
mrutyun^
‎2007 Apr 27 12:55 PM
Hi
Look at this code this is working fine.
tables vbak.
data it_vbak like vbak occurs 0 with header line.
select
vbeln
ernam
erdat
from vbak
into table it_vbak
where erdat > '19970122'.
loop at it_vbak.
write:/ it_vbak-vbeln,it_vbak-ernam,it_vbak-erdat.
endloop.
Regards
Haritha.
‎2007 Apr 27 1:16 PM
Hi
May be the other condition which u gave is not getting satisfied. Without giving that condition just give only date condition may be u will get it. As the date format which u gave is correct only.
Regards
Haritha.