‎2008 Jan 11 10:38 AM
Dear All,
I have two select options line so_1date and so_2date
when screen appear i want to display 1st day in running month like 01.01.2008 in the so_1date
and last day in running month like 31.01.2008 in the so_2date screen field
i can get these values to the veriable
i want to assign these to screen fields please help me to solve this matter.
Thanks in Advance
‎2008 Jan 11 10:42 AM
Hi,
use this function module HR_JP_MONTH_BEGIN_END_DATE
to get the start date and end date of the month.
input is the current date ie sy-datum
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = sy-datum
IMPORTING
ev_month_begin_date = lv_date2.
regards
Santosh Thorat.
‎2008 Jan 11 10:42 AM
Hi,
use this function module HR_JP_MONTH_BEGIN_END_DATE
to get the start date and end date of the month.
input is the current date ie sy-datum
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = sy-datum
IMPORTING
ev_month_begin_date = lv_date2.
regards
Santosh Thorat.
‎2008 Jan 11 10:54 AM
Thanks Santosh
but i want how can i assigning values to screen fields.
‎2008 Jan 11 10:57 AM
Hi Nelson,
U Can use initialization event.
for eg
select-options : s_audat for vbak-audat.
initialization.
call the function module.
and then.
s_audat-low = lv_date1.
s_audat-high = lv_date2.
s_audat-sign = 'I'.
s_audat-option = 'BT'.
append s_audat.
regards,
Santosh Thorat
‎2008 Jan 11 11:19 AM
‎2008 Jan 11 10:58 AM
Hi,
First get the first day of the period by using FIRST_DAY_IN_PERIOD_GET. Then get last month of the month by using LAST_DAY_IN_PERIOD_GET. Once you get these dates under the event AT SELECTION-SCREEN OUTPUT.
so_1date = date got from the first FM
so_2date = date got from second FM.
I hope this helps,
Regards
Raju Chitale
‎2008 Jan 11 11:11 AM
Hi ,
Please try the following code in the initialisation event.
data:w_begin type D,
w_end type D.
select-options:s_date for syst-datum.
initialization.
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
IV_DATE = sy-datum
IMPORTING
EV_MONTH_BEGIN_DATE = w_begin
EV_MONTH_END_DATE = w_end
.
if sy-subrc eq 0.
s_date-low = w_begin.
s_date-high = w_end.
s_date-sign = 'I'.
s_date-option = 'BT'.
append s_date.
endif.
Regards
DV
‎2008 Jan 11 11:18 AM
SELECT-OPTIONS : s_date FOR sy-datum.
INITIALIZATION.
s_date-low = sy-datum.
s_date-low+6(2) = '01'.
s_date-sign = 'I'.
s_date-option = 'BT'.
CALL FUNCTION 'DATE_GET_MONTH_LASTDAY'
EXPORTING
i_date = s_date-low
IMPORTING
e_date = s_date-high.
APPEND s_date.
‎2008 Jan 11 11:39 AM
Hi Nelson,
inorder to the get the default valules in the select-options, use the following code:
select-options for <table_name>-<field_name> default '<variable_name>'.
This will make the values in the select options filled with the variable_name value as default whenever you call the screen.
Reward if helpfull.
Regards,
Kashyap