‎2007 Nov 12 5:41 AM
Hi experts,
i want to know day of the perticular date,even when i add to the 5 years.
thanks in advance
chandu
‎2007 Nov 12 5:43 AM
‎2007 Nov 12 5:43 AM
‎2007 Nov 12 5:49 AM
Hi
When you want to get name of day by using date in ABAP/4, you can apply function module "DATE_TO_DAY".
Check this sample
*&---------------------------------------------------------------------*
*& Form get_name_of_day
*&---------------------------------------------------------------------*
FORM get_name_of_day USING PAR_DATUM
CHANGING PAR_DAY_NAME.
clear par_day_name.
CALL FUNCTION DATE_TO_DAY
EXPORTING
DATE = par_datum
IMPORTING
WEEKDAY = par_day_name
.
ENDFORM. " get_name_of_dayCheck this link
http://www.dbforums.com/archive/index.php/t-581692.html
http://sap.ionelburlacu.ro/abap/sap2/SAP_Functions.html
Regards
Pavan
‎2007 Nov 12 5:51 AM
hi,
try using :
CALCULATE_DATE : Calculates the future date based on the input .
DATE_TO_DAY : Returns the Day for the entered date.
plz reward if useful..
‎2007 Nov 12 5:51 AM
CALL FUNCTION 'MONTH_PLUS_DETERMINE'
EXPORTING
months = 1 " Number your months in your year
olddate = sy-datum " your date.
IMPORTING
newdate = gs_date.
write gs_date.
CALL FUNCTION 'RH_GET_DATE_DAYNAME'
EXPORTING
LANGU = SY-LANGU
DATE = gs_date
IMPORTING
DAYTXT = dd
EXCEPTIONS
NO_LANGU = 1
NO_DATE = 2
NO_DAYTXT_FOR_LANGU = 3
INVALID_DATE = 4
OTHERS = 5.
write dd.
regards
sayan
‎2007 Nov 12 6:23 AM
Hi,
We can use FM DATE_TO_DAY or DATE_COMPUTE_DAY(Pro grammatically)
Sample code:
clear: hold_day_of_week.
CALL FUNCTION 'DATE_COMPUTE_DAY'
EXPORTING
DATE = workdate
IMPORTING
DAY = day_of_week_num
EXCEPTIONS
OTHERS = 8.
CASE day_of_week_num.
WHEN 1.
hold_day_of_week = 'Monday'.
WHEN 2.
hold_day_of_week = 'Tuesday'.
WHEN 3.
hold_day_of_week = 'Wednesday'.
WHEN 4.
hold_day_of_week = 'Thursday'.
WHEN 5.
hold_day_of_week = 'Friday'.
WHEN 6.
hold_day_of_week = 'Saturday'.
WHEN 7.
hold_day_of_week = 'Sunday'.
WHEN OTHERS.
hold_day_of_week = 'invalid'.
ENDCASE.
or
You can use DATE_COMPUTE_DAY to get the day number of the week (for example, today gives 5)
then use WEEKDAY_GET which returns an itab with seven entries (one for each day of the week.)
You enter in this itab and get the field langt to get the day name.
Reward if helpful.
Regards,
Harini.S