‎2009 Feb 24 1:55 PM
Hi Experts,
Based on the last rundate, default the current rundate-begda to last rundate and the current rundate-ennda to current date.
Means if last rundate is 02/08/2009, and program is being executed today (02/18/2009) then current payroll rundate on selection screen will default to 02/08/2009 u2013 02/17/2009.
Thanks&Regards
Rahul
‎2009 Feb 24 2:16 PM
Hello,
You can try this code:
SELECT-OPTIONS:
s_date FOR sy-datum.
INITIALIZATION.
DATA:
v_date TYPE datum,
wa_indx TYPE indx.
* Get the serial number for the file from DB table INDX
IMPORT v_date = v_date
FROM DATABASE indx(xy)
TO wa_indx
CLIENT sy-mandt ID 'SDN'.
IF v_date IS INITIAL.
s_date-sign = 'I'.
s_date-option = 'BT'.
s_date-low = sy-datum - 1.
s_date-high = sy-datum - 1.
APPEND s_date.
v_date = sy-datum.
ELSE.
IF v_date = sy-datum.
s_date-sign = 'I'.
s_date-option = 'BT'.
s_date-low = v_date.
s_date-high = v_date.
APPEND s_date.
ELSE.
s_date-sign = 'I'.
s_date-option = 'BT'.
s_date-low = v_date.
s_date-high = sy-datum - 1.
APPEND s_date.
ENDIF.
ENDIF.
* Export the date & serial number to DB
EXPORT v_date = v_date
TO DATABASE indx(xy)
FROM wa_indx
CLIENT sy-mandt ID 'SDN'.Hope this helps.
BR,
Suhas
Edited by: Suhas Saha on Feb 24, 2009 3:18 PM