‎2006 Sep 22 2:23 PM
In select-options, how to get the default values as current month first date and last date by default?
Eg: 1/12/2004 and 31/12/2004
Thanks
Vicky
‎2006 Sep 22 2:25 PM
In INITIALIZATION event, do:
S_BUDAT-LOW = 1/12/2004
S_BUDAT-HIGH = 31/12/2004
Regards
‎2006 Sep 22 2:26 PM
Not for One month!!It should be with respect to sy-datum..
Thanks
Vicky
‎2006 Sep 22 2:40 PM
Hi,
Use this in INITIALIZATION
Use Fm 'FIRST_DAY_IN_PERIOD_GET' to get first day of month.
Export parameters:
I_GJAHR = sy-datum+0(4)
I_PERIV = K4
I_POPER = sy-datum+4(2)
Use Fm 'LAST_DAY_IN_PERIOD_GET' to get first day of month.
Export parameters:
I_GJAHR = sy-datum+0(4)
I_PERIV = K4
I_POPER = sy-datum+4(2)
regrds..
jaison
‎2006 Sep 22 2:40 PM
Try:
SELECT-OPTIONS: s_date FOR sy-datum.
DATA: date_lo LIKE sy-datum,
date_hi LIKE sy-datum.
INITIALIZATION.
date_lo = sy-datum.
date_lo+6 = '01'.
date_hi = date_lo + 33.
date_hi+6 = '01'.
date_hi = date_hi - 1.
s_date-option = 'EQ'.
s_date-sign = 'I'.
s_date-low = date_lo.
s_date-high = date_hi.
APPEND s_date.
Rob
‎2013 Aug 04 10:53 AM
‎2006 Sep 22 2:26 PM
Hi
In Initialization write the following.
s_date-option = 'EQ'.
s_date-sign = 'I'.
S_date-low = '20041201'.
s_date-high = '20041231'.
append s_date.
clear s_date.
Regards,
Raj
‎2006 Sep 22 2:31 PM
Hi
Use FM <b>HR_JP_MONTH_BEGIN_END_DATE</b>
and pass <b>Sy-datum</b>, you will get first date of month and last date..populate in s_date (select-option field)
Regards,
Raj
For eg:
Test for function group HRJE
Function module
HR_JP_MONTH_BEGIN_END_DATE
Import parameters
Value
IV_DATE 21.09.2006
Export parameters Value
EV_MONTH_BEGIN_DATE 01.09.2006
EV_MONTH_END_DATE 30.09.2006
Message was edited by: Rajasekhar Dinavahi
‎2006 Sep 22 2:40 PM
hi,
check this sample code...
tables: mkpf.
data date like sy-datum.
data date1 like sy-datum.
select-options: s_date for mkpf-budat.
initialization.
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = sy-datum
IMPORTING
EV_MONTH_BEGIN_DATE = date
EV_MONTH_END_DATE = date1
.
s_date-option = 'EQ'.
s_date-sign = 'I'.
s_date-low = date.
s_date-high = date1.
append s_date.
reward if it helps..
Message was edited by: srinu k
‎2006 Sep 22 2:40 PM
You can use sy-datum and find the month by offsetting method.
Start date is always going to be 1st. So no issues. you can concatenate and find.
Now the problem is to find the end date, it might be 28,29,30, 31.
use this functional module to find the last date of the month.
SLS_MISC_GET_LAST_DAY_OF_MONTH
Then you have to assign
sel_date-option = EQ'.
sel_date-sign = 'I'.
Sel_date-low =
sel_date-high =
append sel-date
regards
Vivek
<b> reward points for all the useful answers </b>
‎2006 Sep 22 2:39 PM
in INITIALIZATION use:
<b>I_BUDAT-OPTION = 'EQ'.
I_BUDAT-SIGN = 'I'.</b>
<b>I_BUDAT-LOW = sy-datum. "lets say 20060922
I_BUDAT-LOW+6(2) = '01'.<-- Populate 1 day of that month</b>
here this I_BUDAT-LOW becomes 20060901
i_budat-high = sy-datum.
CALL FUNCTION 'LAST_DAY_OF_MONTHS'
EXPORTING
DAY_IN = I_BUDAT-HIGH "20060922
IMPORTING
LAST_DAY_OF_MONTH = <b>I_BUDAT-HIGH</b>. 20060930
-> Gives you the last day of a Month
<b>APPEND I_BUDAT.</b>
this function module will get Last day of the month in date format,if we pass current date.
Regards
Srikanth
Message was edited by: Srikanth Kidambi
‎2006 Sep 22 2:49 PM
Hey just follow these steps.
<b>No need to code anything.</b>
Create a variant.
1. While Saving the variant Check the box for the your date field and Selection variable "L" and
2. Click on the Selection variable button.
3. Choose option "D"
4. Below your date field you can find a down arrow, press it.
5. Select the opotion "Current period" and choose.
6. Save it.
Whenever you use this variant again, you can find the low & high fields got pupulated with the First & Last date's of the current month.
Reward if useful,
-Vinodh.
‎2006 Sep 22 3:11 PM
Hello,
In the event INITIALIZATION,
S_MATHR-LOW = MUM7000.
S_MATNR-HIGH = MUM7999.
Regs,
Venkat
‎2006 Sep 25 10:46 AM
use
FIRST_DAY_IN_PERIOD_GET to get the first day of the month .
LAST_DAY_IN_PERIOD_GET to get the last day of the period .
provide the required exporting parmeters .
Store the result in selection screen parameters.
use these function modules in initilazation event to get the default values ion to the selction screen