09-28-2007 8:49 AM
Hi Exerpts,
Could you please tell me answer of below issue.
how we can find The Posting date from & to ( selection screen one select-option)should belong to the same period of the same fiscal year?
the two dates are select-options in selection screen.
this is very urgent.
Thanks
Jaya
09-28-2007 9:01 AM
Hi
declare the select-options
Select-options: s_budat for bkpf-budat.
so both the dates should be in the same month(period)
and in the same year means similar to sy-datum+0(4).
in the validation you should write that
if s_budat-low4(2) ne s_budat-high4(2).
if ( s_budat-low0(4) ne sy-datum0(4) or s_budat-high0(4) ne sy-datum0(4) )
error message....
endif.
endif.
Regards
Anji
09-28-2007 9:01 AM
09-28-2007 9:56 AM
SEE THE CODE BELOW, I THINK IT WILL SERVE YOUR PURPOSE...
TABLES BKPF.
SELECT-OPTIONS:
S_BUDAT FOR BKPF-BUDAT.
AT SELECTION-SCREEN.
IF SY-UCOMM EQ 'ONLI' OR SY-UCOMM EQ 'PRIN'.
LOOP AT S_BUDAT.
IF S_BUDAT-HIGH IS NOT INITIAL AND S_BUDAT-HIGH0(6) NE S_BUDAT-LOW0(6).
MESSAGE 'period in From and To is not same' type 'I'.
LEAVE TO SCREEN 1000.
ENDIF.
ENDLOOP.
ENDIF.
Reward points if useful, get back in case of query...
Cheers!!!