‎2008 Jan 02 1:12 PM
HALLOW
i declare range like below and i get wrong data
what i miss?
eg. i put in table range low 012007 and high 122007
and when i do the select i get data for 2008
Regards
year is input for year.
RANGES: all_year FOR zzepop-period.
CONCATENATE '01' year INTO mon_beg."Create year range
CONCATENATE '12' year INTO mon_end.
all_year-sign = 'I'.
all_year-option = 'BT'.
all_year-low = mon_beg.
all_year-high = mon_end.
APPEND all_year.
SELECT *
FROM (proj_tab_name)
INTO CORRESPONDING FIELDS OF TABLE proj_tab "from year start project until sy-datum
WHERE proj = project
AND period IN all_year.
Regards
‎2008 Jan 02 3:59 PM
Hi Ricardo,
One possible solution of ur problem is this.... if u want all records for year 2007...
>SELECT *
>FROM (proj_tab_name)
>INTO CORRESPONDING FIELDS OF TABLE proj_tab
>WHERE proj = project.
>
>LOOP AT proj_tab.
>IF proj_tab-proj+2(4) = '2007'.
>write : / proj_tab-proj.
>ENDIF.
>ENDLOOP.
it will search all the records for year 2007... it the date is stored in MMYYYY format eg 082007
Hope it will solve your problem..
Reward points if useful...
Thanks & Regards
ilesh 24x7
‎2008 Jan 02 1:15 PM
‎2008 Jan 02 1:39 PM
hi rich
i change the format like u tell (200701- 200712) but i don't get any data in the select and i have data (project) in table with
period 012007 it supposed to work , i check all the types
and year is char4 and period char 6 (i do concatenate 01 - 12 for all year ,
i don't understand this,
maybe u can give me idea?
Regards
‎2008 Jan 02 1:52 PM
Hi,
You can try in otherway by taking char(6 ) and use concatenate and offlength.
Regds
Sivaparvathi
Please reward points if helpful..
‎2008 Jan 02 1:55 PM
‎2008 Jan 02 2:24 PM
hi frinds
maybe some one can give an idea?
its urgent
i reward
Regards
‎2008 Jan 02 2:30 PM
Hi,
Could you please let us know what is the characterisitics of period in select statement.
May be it is not considering the range. You can do thing here :
Remove period from the select statement.
And add below code after select statement.
Delete itab where period not in all_year.
Thanks,
Sriram Ponna.
‎2008 Jan 02 2:36 PM
hi sriram
in the debugerr i have value like below
I BT 012008 122008
but in table for the project i ask i have in field period just 122007 (for this project ) all the varibale is type char period char6.
regards
‎2008 Jan 02 2:49 PM
hi sriram
i try with delete but its no working
DELETE proj_tab WHERE period NOT IN all_year.
i get subrc ne 0.
Regards
‎2008 Jan 02 2:56 PM
Hi,
Go to Se11 and input the table and give the condition what you are using in the program, see whether the table have the data or not, whether it is retrieving any data or not?
Thanks,
Sriram Ponna.
‎2008 Jan 02 2:39 PM
Hi Ricardo,
Check below field in DDIC and check how date is stored there...
proj_tab_name-period
nd then provide the mon_beg and mon_end in the same way it is stored in database....
all_year-low = mon_beg.
all_year-high = mon_end.
Hope it will solve your problem..
Reward points if useful..
Thanks & Regards
ilesh 24x7
‎2008 Jan 02 2:47 PM
yes ilesh
the have the same type char6,i dont understand way its dont work?
Regards
‎2008 Jan 02 2:52 PM
Before you investigate any further, you MUST make sure that the data in the database table is being stored as YYYYPP, if it is not, then you need to change it so that it does. Storing it in any other format is wrong. ONce you have your data correct, you need to setup your selection options the same way, 200701 200712
Regards,
Rich Heilman
‎2008 Jan 02 3:41 PM
HI RICH
the data is stored in same format this is the first thing i check,
Regards
‎2008 Jan 02 3:01 PM
MOVE:'I' TO so_bukrs-sign,
'EQ' TO so_bukrs-option,
'US90' TO so_bukrs-low.
APPEND so_bukrs.
if ur trying to delete
move E into sign and say in range...
Edited by: jackandjay on Jan 2, 2008 10:02 AM
‎2008 Jan 02 3:41 PM
Hi Ricardo,
m not sure but
it might be becoz the data is stored in the database as Char type...
> eg. i put in table range low 012007 and high 122007
> and when i do the select i get data for 2008
here suppose the value is 072008 then it comes between the values low 012007 and high 122007 and due to that u are getting the value of year 2008 also in your internal table...
Reward points if useful...
Thanks & Regards
ilesh 24x7
‎2008 Jan 02 3:59 PM
Hi Ricardo,
One possible solution of ur problem is this.... if u want all records for year 2007...
>SELECT *
>FROM (proj_tab_name)
>INTO CORRESPONDING FIELDS OF TABLE proj_tab
>WHERE proj = project.
>
>LOOP AT proj_tab.
>IF proj_tab-proj+2(4) = '2007'.
>write : / proj_tab-proj.
>ENDIF.
>ENDLOOP.
it will search all the records for year 2007... it the date is stored in MMYYYY format eg 082007
Hope it will solve your problem..
Reward points if useful...
Thanks & Regards
ilesh 24x7
‎2008 Jan 02 4:04 PM
‎2008 Jan 02 4:49 PM
‎2008 Jan 02 4:54 PM
Hi Ricardo,
Do below modification in my previous code.....
See bold letters...
By mistake i used diff field name....
SELECT *
FROM (proj_tab_name)
INTO CORRESPONDING FIELDS OF TABLE proj_tab
WHERE proj = project.
LOOP AT proj_tab.
IF proj_tab-period+2(4) = '2007'.
write : / proj_tab-proj, proj_tab-period.
ENDIF.
ENDLOOP.
Hope it will solve your problem..
Reward points if useful....
Thanks & Regards
ilesh 24x7