07-30-2007 5:40 AM
Hi Experts,
Can u tell me that if We have a date type select-option, so in range of input field I want to display by default, date of first day of current month and in last input field date of last day of current month. How can we do that?
07-30-2007 5:43 AM
code your default values(what ever it may be)
in the event initialization
07-30-2007 5:44 AM
hi,
U can give it as
so_date-low = date default
so_date-high = date default
07-30-2007 5:45 AM
Example of a date calculation:
DATA: ultimo TYPE d.
ultimo = sy-datum.
ultimo+6(2) = '01'. " = first day of this month
ultimo = ultimo - 1. " = last day of previous month
http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb334a358411d1829f0000e829fbfe/content.htm
07-30-2007 5:46 AM
Hi Chaitanya kumar
REPORT zazudate .
SELECTION-SCREEN : BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : sodate FOR sy-datum.
SELECTION-SCREEN : END OF BLOCK bl1.
INITIALIZATION.
DATA: lowdate TYPE sy-datum,
diff(2).
CALL FUNCTION 'LAST_DAY_OF_MONTHS'
EXPORTING
day_in = sy-datum
IMPORTING
last_day_of_month = sodate-high
EXCEPTIONS
DAY_IN_NO_DATE = 1
OTHERS = 2
.
diff = sodate-high6(2) - ( sodate-high6(2) - 1 ).
IF ( STRLEN( diff ) EQ 1 ).
CONCATENATE sodate-high+0(6) '0' diff INTO lowdate.
ELSE.
CONCATENATE sodate-high+0(6) diff INTO lowdate.
ENDIF.
sodate-low = lowdate.
sodate-sign = 'I'.
sodate-option = 'BT'.
APPEND sodate.
<b>Regards,
Azhar</b>
07-30-2007 7:47 AM
Hi,
Selection-screen begin of block b1 with frame title text-001.
select-options : so_pdate for cdhdr-udate.
selection-screen end of blok b1.
data : l_date type sy-datum.
INITIALIZATION.
CALL FUNCTION 'LAST_DAY_OF_MONTHS'
EXPORTING
day_in = sy-datum
IMPORTING
last_day_of_month = l_date.
EXCEPTIONS
DAY_IN_NO_DATE = 1
OTHERS = 2
.
move '01' to sy-datum+6(2).
so_pdate-low = sy-datum.
so_pdate-high = l_date.
append so_pdate.
if helpsssssssss...
REWARD.....
rgds
harris