07-15-2008 8:28 AM
I want to write a select query for getting data into an internal table. This query is based on a condition. The data from the zcycle_details custom table has two fields event_date and cycle_act_date. The data should be selected such that the event_date field value containing date shoudld be greater than cycle_act_date.
07-15-2008 8:39 AM
Hi,
write the select queary like this..
select *
from zcycle_details as a
into table i_cycle_details
where aevent_date gt acycle_act_date.
Thanks,
Rajinikanth
07-15-2008 8:32 AM
hi
do like this
if zcycle_details-event_date > zcycle_details-cycle_act_date
select x
y
z
into table XYZ
from zcycle_details
where
date1 = event_date
and
date2 = cycle_act_date
endif.
Cheers
Snehi
Edited by: snehi chouhan on Jul 15, 2008 9:32 AM
07-15-2008 8:33 AM
Hi,
u can use
select event_date cycle_act_date from zcycle_details where event_date > cycle_act_date.
Hope it helps.
Anju
07-15-2008 8:33 AM
Hi
If your z-table hasn't a very large number of hits u can write:
SELECT * FROM ZCYCLE_DETAILS INTO T_ZCYCLE_DETAILS.
IF T_ZCYCLE_DETAILS-EVENT_DATE > T_ZCYCLE_DETAILS-CYCLE_ACT_DATE.
APPEND T_ZCYCLE_DETAILS.
ENDIF.
ENDSELECT.
Max
07-15-2008 8:36 AM
hi yogesh,
data: DATA: i_zcycle_details LIKE STANDARD TABLE OF zcycle_details .
select event_date
cycle_act_date
from zcycle_details
into i_zcycle_details .
loop at i_zcycle_details into wa_zcycle_details
if wa_zcycle_details - event_date > wa_zcycle_details - cycle_act_date.
write : wa_zcycle_details .
else.
exit.
endif.
endloop.
regards,
sandeep
07-15-2008 8:36 AM
HI,
You can get all the details into table it_itab and delete the unwanted ones through the following code.
loop at it_itab where cycle_act_date GT event_date.
delete it_itab.
endloop.
OR
delete it_itab where cycle_act_date GT event_date.
Thanks,
Shailaja
07-15-2008 8:39 AM
Hi,
write the select queary like this..
select *
from zcycle_details as a
into table i_cycle_details
where aevent_date gt acycle_act_date.
Thanks,
Rajinikanth