‎2009 Jul 21 8:31 AM
Hi,
i am using a select statement where i am writing,
select objectclas from cdhdr where udate = sy-datum+0(4).
this particular statement i feel ll not work as udate is ddmmyyy where i am checking wth only year.
\
can anyone tell me how can i go further on this?
‎2009 Jul 21 8:37 AM
hi
u can select all the objects whose year matches
for that you need to have a range of date type
range-sign = 'EQ'.
range-option = 'I'.
concatenate '%' sy-datum+0(4) into string
range-low = string.select objectclas from cdhdr into table itab where udate in range.
Regards
Sajid
‎2009 Jul 21 8:37 AM
hi
u can select all the objects whose year matches
for that you need to have a range of date type
range-sign = 'EQ'.
range-option = 'I'.
concatenate '%' sy-datum+0(4) into string
range-low = string.select objectclas from cdhdr into table itab where udate in range.
Regards
Sajid
‎2009 Jul 21 8:41 AM
but here udate and range is different right...
udate is full date format where as sydatum+0(4) is just year im considering.
‎2009 Jul 21 8:39 AM
Hi Poonam
Take one variable(lv_date) and assign the value lv_date = sy-datum+0(4) to that variable before selection.
Now call the select query
select objectclas from cdhdr where udate eq lv_date.
It will work for sure.
Regards,
Sreeram
‎2009 Jul 21 8:42 AM
‎2009 Jul 21 8:41 AM
Hi
Use the sy-datum ie yyyymmdd that system internaly use to get the data from tables if no alfa conversion routines are maintained in domain of any fiels.
UDATE having domain as DATUM(yyyymmdd) .Soinsteed of usung sy-datum+0(4) use SY-datum in where clause.
Thanks,
Deepanker Dwivedi
‎2009 Jul 21 8:43 AM
‎2009 Jul 21 8:51 AM
data: date_from like sy-datum, "start date
date_to like sy-datum. "End date
move: '0101' to date_from+4(4),
sy-datum(4) to date_from(4),
'1231' to date_to+4(4),
sy-datum(4) to date_to(4).
* Now you got 2 dates, with the start and the end of the current year
*This select read all changes between the start and the end of the year.
Select objectclas from cdhdr into table itab where udate le date_to
and udate ge date_from.
You can avoid the use of 'DATE_TO' since you got SY-DATUM that is today and SAP register modify until today and not for tomorrow
Edited by: Simone Milesi on Jul 21, 2009 9:51 AM
‎2009 Jul 21 8:55 AM
Hi
Why don't you try something like this:
range-sign = 'CP'.
range-option = 'I'.
concatenate '++++' sy-datum+0(4) into string
range-low = string.The Patterned string could be based on your requirements. Check out the help for the keyword CP.
Hope this helps,
Wenonah