‎2005 Nov 15 10:24 AM
In select-options, how to get the default values as current month first date and last date by default?
‎2005 Nov 15 10:31 AM
Hi Savitha,
In the Initialization part,
give
use fm ISB_GET_FIRST_DAY to get the first day,
and LAST_DAY_OF_MONTHS for the last day.
s_month-low = month_first_day.
S-month-high = month_last_day.
S_Month-options = 'BT'.
s_month-sign = 'I'.
append s_Month.
Clear s_month.
‎2005 Nov 15 10:31 AM
Hi Savitha,
In the Initialization part,
give
use fm ISB_GET_FIRST_DAY to get the first day,
and LAST_DAY_OF_MONTHS for the last day.
s_month-low = month_first_day.
S-month-high = month_last_day.
S_Month-options = 'BT'.
s_month-sign = 'I'.
append s_Month.
Clear s_month.
‎2005 Nov 15 10:34 AM
Hi savita,
Add the event "INITIALIZATION" to you report. Here you can code for example (suppose your select option is se_date):
se_date-sign = 'I'.
se_date-option = 'BT'.
se_date-low = <first date of month>.
se_date-high = <lastt date of month>.
APPEND se_date.
Regards,
john.
‎2005 Nov 15 10:35 AM
Hi,
Here is the saqmple code.
INITIALIZATION.
Setting the date
PERFORM f101_default_values.
FORM f101_default_values.
MOVE: sy-datum0(4) TO s_sdate-low0(4),
'01' TO s_sdate-low+4(2),
'01' TO s_sdate-low+6(2).
MOVE: sy-datum0(4) TO s_sdate-high0(4),
'12' TO s_sdate-high+4(2),
'31' TO s_sdate-high+6(2).
ENDFORM. " f101_default_values
Kindly reward points by clicking the star on the left of reply,if it helps.
‎2005 Nov 15 11:01 AM
Savita,
I am not sure whether u would be able to use the function module ISB_GET_FIRST_DAY!.
But u can see the possiblity of using the following Code:
select-options: soDate for sy-datum.
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.
Thanks
Kam
Note : allot points for all worth ful psotings
Message was edited by: Kam