‎2008 Mar 06 10:39 AM
Could you please tell me the logic to validate the date.? it should tell us in what quarter the date falls into..
if the from date is in I quarter it should restric the user to enter the to date from the I quarter itself.. respectively for the other quarters..
Please..
‎2008 Mar 06 10:52 AM
hello Nalina,
check this out.
DATA: w_last_date TYPE d, w_q_flag(3), w_quarter TYPE string.
SELECT-OPTIONS: s_date FOR w_last_date OBLIGATORY.
AT SELECTION-SCREEN ON s_date.
IF s_date-low+0(4) <> s_date-high+0(4).
MESSAGE e000(vz) WITH text-e01.
ENDIF.
IF s_date-low+4(2) <= '3'.
CONCATENATE s_date-low+0(4) '03' '31' INTO w_last_date.
w_q_flag = '1st'.
ELSEIF s_date-low+4(2) <= '6'.
CONCATENATE s_date-low+0(4) '06' '30' INTO w_last_date.
w_q_flag = '2nd'.
ELSEIF s_date-low+4(2) <= '9'.
CONCATENATE s_date-low+0(4) '09' '30' INTO w_last_date.
w_q_flag = '3rd'.
ELSE.
CONCATENATE s_date-low+0(4) '12' '31' INTO w_last_date.
w_q_flag = '4th'.
ENDIF.
IF s_date-high > w_last_date.
MESSAGE e000(vz) WITH text-e02 w_last_date.
ENDIFif it works, please reward if it is helpful
‎2008 Mar 06 10:48 AM
Hi,
I guess there is no standard FM or report for your requirement. you can do it manually, capture the month from your from date based on the month number pass the quarter value in to some variable v_from_quarter. Do the same process for the TO date also and capture into v_to_quarter. Later check the v_from_quarter and v_to_quarter in the at selection-screen variant, if both same then give message.
Rgds,
Bujji
‎2008 Mar 06 10:50 AM
‎2008 Mar 06 10:52 AM
hello Nalina,
check this out.
DATA: w_last_date TYPE d, w_q_flag(3), w_quarter TYPE string.
SELECT-OPTIONS: s_date FOR w_last_date OBLIGATORY.
AT SELECTION-SCREEN ON s_date.
IF s_date-low+0(4) <> s_date-high+0(4).
MESSAGE e000(vz) WITH text-e01.
ENDIF.
IF s_date-low+4(2) <= '3'.
CONCATENATE s_date-low+0(4) '03' '31' INTO w_last_date.
w_q_flag = '1st'.
ELSEIF s_date-low+4(2) <= '6'.
CONCATENATE s_date-low+0(4) '06' '30' INTO w_last_date.
w_q_flag = '2nd'.
ELSEIF s_date-low+4(2) <= '9'.
CONCATENATE s_date-low+0(4) '09' '30' INTO w_last_date.
w_q_flag = '3rd'.
ELSE.
CONCATENATE s_date-low+0(4) '12' '31' INTO w_last_date.
w_q_flag = '4th'.
ENDIF.
IF s_date-high > w_last_date.
MESSAGE e000(vz) WITH text-e02 w_last_date.
ENDIFif it works, please reward if it is helpful