Get Nexr working day for the given calendar id
Hello,
My requirenment is I have a date.If that date falls on friday then I have to get the next working day date i.e.Monday for the given Calender iD
DATA:wk_dat TYPE scal-indicator.
PARAMETERS:pa_dat TYPE sy-datum.
CALL FUNCTION 'DATE_COMPUTE_DAY'
EXPORTING
date = pa_dat
IMPORTING
day = wk_dat.
CHECK wk_dat = 5.
pa_dat = pa_dat + 3.
WRITE pa_dat.
here if u want to get the next working day
Use FM DATE_CHECK_WORKINGDAY after the check statement.
add the date until u find a working day.
Similar Messages
-
Any FM to get count of each week day for the given date range
Hi guys,
Any FM to get count of each week day for the given date range?
eg: If i give 14/07/2008 to 14/08/2008
I need to find how many Mondays, tuesdays...sundays in this given date range.
If not single FM is available, any logic that gives above result is also appreciated.
Thanks,
Vinod.hi Vinod,
this is not a full solution, I just give you a basic idea:
DATA : lv_start TYPE sy-datum VALUE '20080714',
lv_end TYPE sy-datum VALUE '20080814'.
WHILE lv_start LE lv_end.
CALL FUNCTION 'FTR_DAY_GET_TEXT'
EXPORTING
pi_date = lv_start.
* IMPORTING
* PE_DAY_TEXT1 =
* PE_DAY_TEXT2 =
* PE_DAY =
* you have to summarize the output here somehow...
lv_start = lv_start + 1.
ENDWHILE.
hope this helps
ec -
Working day for a Holiday Calendar
Hi, experts.
I'm looking for a FM that returns me the next working day based on a Holiday Calendar (SCAL).
It should have the same functionality as Factory Calendar FM FIMA_DAY_CONVERT_TO_WORKINGDAY.
Can you help me out?
Thanks in advance,
FlaviaUse this function module & make sure you pass the plant details, as factory calendar mostly depeneds on the Plant.
Below is just an example to get the plant depending on Requisition & pass it to the function module.
Createdate --> will be the current date.
SELECT SINGLE t~fabkl
INTO lv_fabkl
FROM ( t001w AS t
INNER JOIN eban AS e ON ewerks = twerks )
WHERE banfn = reqnumber.
CALL FUNCTION 'FKK_ADD_WORKINGDAY'
EXPORTING
i_date = createdate
i_days = days
I_CALENDAR1 = lv_fabkl
I_CALENDAR2 =
IMPORTING
E_DATE = workingday.
E_RETURN = -
Query to Get next Highest Value for the given value passed
Hello Gurus
i want help with a query that would get me the next highest value from a table for a given value passed. Let say these are the values in col of a table
col
6000
5000
4000
3000
2000
1000
if i pass 2000 then the output should be 3000 or if i pass 4000 then query should result 5000. Please helpMay be this:
WITH t AS (SELECT 6000 val FROM DUAL
UNION ALL
SELECT 5000 FROM DUAL
UNION ALL
SELECT 4000 FROM DUAL
UNION ALL
SELECT 3000 FROM DUAL
UNION ALL
SELECT 2000 FROM DUAL
UNION ALL
SELECT 1000 FROM DUAL)
SELECT min(val)
FROM t
WHERE val > &YourVal -
Any F.Module is there to get 'Month and day ' from the given input number
Hi experts,
I am working on Inventory withdrawl report and in the selection screen, If i enter the CHARG (Batch number) then I need to display the posting date by default in the next selection input based on the Batch number.
In the selection screen :
Batch : 7111WF0211.
Posting Date : (I need to display by default based on batch number).
My requirement is, in the above Batch first digit '7' is the year.
And from 2nd to 4th digit. i.e., 111. I need to find out month and day from 111.
I mean from 1 to 365 days, In which day and which month '111' will come ?
Please send me the code or suitable Function Module. Your help will be appreciated.
Thanks,
Ranji.Use FM ADD_TIME_TO_DATE
Do this
days = batch+1(3).
days = days - 1.
Call Function 'ADD_TIME_TO_DATE'
exporting
i_idate = '01.01.2008'
i_time = days
i_iprkz = 'D'
importing
o_idate = date_p_d
You will get the date in date_p_d.
But what about Leap years? IS the first number the year?
IF so pass in i_idate the first of january of that year so you get the correct day depending if it is a leap year or not
Edited by: Ramiro Escamilla on Feb 26, 2008 9:56 PM -
I keep get emails sent to me saying that I am requesting to change my password when I haven't they been sending it to me for 3 days now and been getting a few a day about it.
Doesn't strike me as a "high traffic" issue, if you pause the download can you open the /Applications/ folder on your Mac and see if the installer already present? If you can stop the download and delete the installer (because it is not finished), the try again?
If you've already done the above have you tried using Disk Utility First Aid from your Recovery HD?
Try to verify/repair the disk and see if that takes care of it. (Of course make sure you have a good, recent backup before trying this.)
If you're still having issues: re-install OS X from the Recovery HD, install all available software updates, try again. -
Calculate Avg for the given months based on the no. of days in months
Dear Experts
I have a report in which there is a characterictic claenderyr/month.The Input paramter is claenderyr/month which is restricted by a variable of type interval. i mean user will enter calenderyr/month as interval say 012010 to 06.2010. Now I have to calculate Avg sale Qty for the given months based on the no. of days for the given range of months. How I can achieve this in BW Query. Pl. advice
Dinesh SharmaHi,
Create formula for the sales qty.
maintain the exception aggregation as average based on calday
Best Regards,
M.H.REDDY -
Who to get Actual Shipment Date for the Sales Order
Dear All,
How to Get Actual Shipment Date for the given sales order.
REgards
sudheerHai,
If you want the actual shipment date of an order call the function module RV_ORDER_FLOW_INFORMATION and pass the order number as vbeln in the structure COMWA.select the values from the return table which corresponds to 'J' type which are delivery and get thedate.
THis will give the actual delivery date (if created).
Oher way is to look for vbeln in table LIPS using VGBEL = order number as the selection criteria.
Cheers,
Sandeep -
i can't get icloud to sync my ipad notepad to my mac. it works fine for email and calendar?I have clicked the notepad setting on my iPad to ON.
On the iPad tap Settings > iCloud. Switch Calendars off then back on then reset the iPad.
Hold the On/Off Sleep/Wake button and the Home button down at the same time for at least ten seconds, until the Apple logo appears.
On the iMac, open System Preferences > iCloud. Deselect the box next to Calendars then reselect that box then restart your iMac. -
To find the no of working days b/w given date
Hi ABAP Experts,
Here i have one requirement .
table is tfacs
in this table i want to know the no of working days b/w the given date. Here i have attached my code .pls go through it and do me needful.
TABLES : tfacs,vbrk.
DATA: BEGIN OF ty_tfacs OCCURS 0,
ident TYPE tfacs-ident,
jahr TYPE tfacs-jahr,
mon01 TYPE tfacs-mon01,
mon02 TYPE tfacs-mon02,
mon03 TYPE tfacs-mon03,
mon04 TYPE tfacs-mon04,
mon05 TYPE tfacs-mon05,
mon06 TYPE tfacs-mon06,
mon07 TYPE tfacs-mon07,
mon08 TYPE tfacs-mon08,
mon09 TYPE tfacs-mon09,
mon10 TYPE tfacs-mon10,
mon11 TYPE tfacs-mon11,
mon12 TYPE tfacs-mon12,
basis TYPE tfacs-basis,
fenum TYPE tfacs-fenum,
wenum TYPE tfacs-wenum,
load TYPE tfacs-load,
string1(31) TYPE c,
string2(31) TYPE c,
string3(31) TYPE c,
string4(31) TYPE c,
string5(31) TYPE c,
string6(31) TYPE c,
string7(31) TYPE c,
string8(31) TYPE c,
string9(31) TYPE c,
string10(31) TYPE c,
string11(31) TYPE c,
string12(31) TYPE c,
uk(31) TYPE c,
total1 TYPE i,
total2 TYPE i,
total3 TYPE i,
total4 TYPE i,
total5 TYPE i,
total6 TYPE i,
total7 TYPE i,
total8 TYPE i,
total9 TYPE i,
total10 TYPE i,
total11 TYPE i,
total12 TYPE i,
END OF ty_tfacs.
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_jahr FOR tfacs-jahr MODIF ID b1.
SELECT-OPTIONS : mon FOR tfacs-mon01 MODIF ID b1.
SELECT-OPTIONS : s_month FOR vbrk-erdat MODIF ID b2.
SELECTION-SCREEN : END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME.
PARAMETERS r1 RADIOBUTTON GROUP c DEFAULT 'X' USER-COMMAND flag .
PARAMETERS r2 RADIOBUTTON GROUP c .
SELECTION-SCREEN END OF BLOCK b.
INITIALIZATION
INITIALIZATION.
AT SELECTION-SCREEN OUTPUT.
IF r1 NE space.
LOOP AT SCREEN.
IF screen-group1 EQ 'B2'.
screen-output = 1.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF screen-group1 EQ 'B1'.
screen-output = 1.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
start - of - selection
start-of-selection.
IF r1 = 'X'.
PERFORM get-data.
PERFORM display-data.
ENDIF.
& form get-data
text
--> p1 text
<-- p2 text
form get-data .
DATA : total1 TYPE i.
SELECT * FROM tfacs INTO TABLE ty_tfacs
WHERE ident EQ 'IN'
AND jahr IN s_jahr.
LOOP AT ty_tfacs WHERE ident = 'IN'.
IF sy-subrc EQ 0.
PERFORM get_string USING ty_tfacs-string1
ty_tfacs-mon01
ty_tfacs-total1.
PERFORM get_string USING ty_tfacs-string2
ty_tfacs-mon02
ty_tfacs-total2.
PERFORM get_string USING ty_tfacs-string3
ty_tfacs-mon03
ty_tfacs-total3.
PERFORM get_string USING ty_tfacs-string4
ty_tfacs-mon04
ty_tfacs-total4.
PERFORM get_string USING ty_tfacs-string5
ty_tfacs-mon05
ty_tfacs-total5.
PERFORM get_string USING ty_tfacs-string6
ty_tfacs-mon06
ty_tfacs-total6.
PERFORM get_string USING ty_tfacs-string7
ty_tfacs-mon07
ty_tfacs-total7.
PERFORM get_string USING ty_tfacs-string8
ty_tfacs-mon08
ty_tfacs-total8.
PERFORM get_string USING ty_tfacs-string9
ty_tfacs-mon09
ty_tfacs-total9.
PERFORM get_string USING ty_tfacs-string10
ty_tfacs-mon10
ty_tfacs-total10.
PERFORM get_string USING ty_tfacs-string11
ty_tfacs-mon11
ty_tfacs-total11.
PERFORM get_string USING ty_tfacs-string12
ty_tfacs-mon12
ty_tfacs-total12.
ENDIF.
ty_tfacs-uk = ty_tfacs-total1 + ty_tfacs-total2
+ ty_tfacs-total3 + ty_tfacs-total4
+ ty_tfacs-total5 + ty_tfacs-total6
+ ty_tfacs-total7 + ty_tfacs-total8
+ ty_tfacs-total9 + ty_tfacs-total10
+ ty_tfacs-total11 + ty_tfacs-total12.
MODIFY ty_tfacs TRANSPORTING total1 total2 total3
total4 total5 total6
total7 total8 total9
total10 total11 total12
uk.
ENDLOOP.
PERFORM write1-data USING 'COU' 'YEAR' 'MONTH01'
'MONTH02' 'MONTH03' 'MONTH04'
'MONTH05' 'MONTH06' 'MONTH07'
'MONTH08' 'MONTH09' 'MONTH10'
'MONTH11' 'MONTH12' 'TOTAL WDAYS' .
LOOP AT ty_tfacs.
PERFORM write1-data USING ty_tfacs-ident ty_tfacs-jahr
ty_tfacs-total1 ty_tfacs-total2
ty_tfacs-total3 ty_tfacs-total4
ty_tfacs-total5 ty_tfacs-total6
ty_tfacs-total7 ty_tfacs-total8
ty_tfacs-total9 ty_tfacs-total10
ty_tfacs-total11 ty_tfacs-total12
ty_tfacs-uk.
ENDLOOP.
ENDFORM. " get-data
TOP-OF-PAGE.
FORMAT COLOR 5 ON.
WRITE :/10 'COUNTRY',
20 'YEARS',
35 'MON01',
45 'MON02',
55 'MON03',
65 'MON04',
75 'MON05',
85 'MON06',
95 'MON07',
105 'MON08',
115 'MON09',
125 'MON10',
135 'MON11',
145 'MON12',
170 'total wdays'.
FORMAT COLOR OFF.
WRITE :/ SY-ULINE.
*& Form display-data
text
--> p1 text
<-- p2 text
FORM display-data .
LOOP AT ty_tfacs.
WRITE :/10 ty_tfacs-ident,
20 ty_tfacs-jahr,
30 ty_tfacs-total1,
40 ty_tfacs-total2,
50 ty_tfacs-total3,
60 ty_tfacs-total4,
70 ty_tfacs-total5,
80 ty_tfacs-total6,
90 ty_tfacs-total7,
100 ty_tfacs-total8,
110 ty_tfacs-total9,
120 ty_tfacs-total10,
130 ty_tfacs-total11,
140 ty_tfacs-total12,
150 ty_tfacs-uk.
ENDLOOP.
ENDFORM. " display-data
*& form get_string
text
-->p_0250 text
-->p_0251 text
-->p_0252 text
form get_string using p_0250 " month
p_0251 " string
p_0252. " total
p_0250 = p_0251. " move month to string
TRANSLATE p_0250 USING '0 ' . " translate
CONDENSE p_0250 NO-GAPS. " condense
p_0252 = STRLEN( p_0250 ). " pass length of string to total
ENDFORM. " get_string
***& Form write1-data
text
-->P_0306 text
-->P_0307 text
-->P_0308 text
-->P_0309 text
-->P_0310 text
-->P_0311 text
-->P_0312 text
-->P_0313 text
-->P_0314 text
-->P_0315 text
-->P_0316 text
-->P_0317 text
-->P_0318 text
-->P_0319 text
-->P_0320 text
*form write1-data using p_0306
p_0307
p_0308
p_0309
p_0310
p_0311
p_0312
p_0313
p_0314
p_0315
p_0316
p_0317
p_0318
p_0319
p_0320.
*WRITE :/ p_0306,
p_0307,
p_0308 left-justified,
p_0309 left-justified,
p_0310 left-justified,
p_0311 left-justified,
p_0312 left-justified,
p_0313 left-justified,
p_0314 left-justified,
p_0315 left-justified,
p_0316 left-justified,
p_0317 left-justified,
p_0318 left-justified,
p_0319 left-justified,
p_0320 left-justified.
*ENDFORM. " write1-data
from this report what i am getting is year and its 12 months but my requirement is i will give date using select options and i should get the total no of working days in b/w this date.Use the following code to find no of working days b/w given date. Use the correct factory_calendar_id in the function module. L_DAYS will display the required result:
PARAMETERS: p_date1 TYPE sydatum,
p_date2 TYPE sydatum.
DATA: date1 LIKE scal-date,
date2 LIKE scal-date,
correction LIKE scal-indicator,
calendar LIKE scal-fcalid,
factorydate1 LIKE scal-facdate,
workday1 LIKE scal-indicator,
factorydate2 LIKE scal-facdate,
workday2 LIKE scal-indicator,
l_days TYPE scal-facdate.
CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
EXPORTING
date = p_date1
correct_option = '+'
factory_calendar_id = 'US'
IMPORTING
date = date1
factorydate = factorydate1
workingday_indicator = workday1
EXCEPTIONS
correct_option_invalid = 1
date_after_range = 2
date_before_range = 3
date_invalid = 4
factory_calendar_not_found = 5.
IF sy-subrc = 0.
CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
EXPORTING
date = p_date2
correct_option = '+'
factory_calendar_id = 'US'
IMPORTING
date = date2
factorydate = factorydate2
workingday_indicator = workday2
EXCEPTIONS
correct_option_invalid = 1
date_after_range = 2
date_before_range = 3
date_invalid = 4
factory_calendar_not_found = 5.
IF sy-subrc = 0.
l_days = factorydate2 - factorydate1.
WRITE: / l_days.
ENDIF.
ENDIF. -
Need working days for all months in a given year
Hi,
I need no of working days for all the months in a given year.
(i.e year is the input and the query should return 12 columns(jan-dec). Saturday and Sunday are holidays)
Regards,
VigneshMaybe you can use this:
break on month skip 1
set linesize 200
set pagesize 2000
column month format a20
column week format a4
with req as (select '&Required_Year_YYYY' as yr from dual)
,offset as (select case when to_char(trunc(to_date(yr,'YYYY'),'YYYY'),'IW') in ('52','53') then 1 else 0 end as offset from req)
select lpad( Month, 20-(20-length(month))/2 ) month,
'('||week||')' as week, "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"
from (
select to_char(dt,'fmMonth YYYY') month,
case when to_char(dt, 'mm') = '12' and to_char(dt,'iw') = '01' and offset = 0 then '53'
when to_char(dt, 'mm') = '12' and to_char(dt,'iw') = '01' and offset = 1 then '54'
when to_char(dt, 'mm') = '01' and to_char(dt,'iw') in ('52','53') then '1'
else to_char(to_number(to_char(dt,'iw'))+offset) end as week,
max(decode(to_char(dt,'d'),'1',lpad(to_char(dt,'fmdd'),2))) "Su",
max(decode(to_char(dt,'d'),'2',lpad(to_char(dt,'fmdd'),2))) "Mo",
max(decode(to_char(dt,'d'),'3',lpad(to_char(dt,'fmdd'),2))) "Tu",
max(decode(to_char(dt,'d'),'4',lpad(to_char(dt,'fmdd'),2))) "We",
max(decode(to_char(dt,'d'),'5',lpad(to_char(dt,'fmdd'),2))) "Th",
max(decode(to_char(dt,'d'),'6',lpad(to_char(dt,'fmdd'),2))) "Fr",
max(decode(to_char(dt,'d'),'7',lpad(to_char(dt,'fmdd'),2))) "Sa"
from ( select trunc(to_date(req.yr,'YYYY'),'y')-1+rownum dt
from all_objects, req
where rownum <= add_months(trunc(to_date(req.yr,'YYYY'),'y'),12) - trunc(to_date(req.yr,'YYYY'),'y') )
,offset
group by to_char(dt,'fmMonth YYYY'), case when to_char(dt, 'mm') = '12' and to_char(dt,'iw') = '01' and offset = 0 then '53'
when to_char(dt, 'mm') = '12' and to_char(dt,'iw') = '01' and offset = 1 then '54'
when to_char(dt, 'mm') = '01' and to_char(dt,'iw') in ('52','53') then '1'
else to_char(to_number(to_char(dt,'iw'))+offset) end
) x
order by to_date( month, 'Month YYYY' ), to_number(x.week)
/ L. -
Find the 'DAY' for a given 'DATE'
Hi Folks,
I need a help regarding finding the day for a given date.
My requirement is that..,
If I enter a date using 'parameters', it should write the 'day' for the corresponding date.
To be more specific.....,
if I enter date as ' 07/15/2008 ' it should return me the day as 'Tuesday'.
Regards,
Naveen GHI,
FM LIST WITH RESPECT TO DAY, WEEK, AND MONTH.
CALCULATE_DATE : Calculates the future date based on the input .
DATE_TO_DAY : Returns the Day for the entered date.
DATE_COMPUTE_DAY : Returns weekday for a date
DATE_GET_WEEK : Returns week for a date
RP_CALC_DATE_IN_INTERVAL : Add days / months to a date
MONTHS_BETWEEN_TWO_DATES : To get the number of months between the two dates.
END_OF_MONTH_DETERMINE_2 : Determines the End of a Month.
HR_HK_DIFF_BT_2_DATES : Find the difference between two dates in years, months and days.
FIMA_DAYS_AND_MONTHS_AND_YEARS : Find the difference between two dates in years, months and days.
MONTH_NAMES_GET : Get the names of the month
WEEK_GET_FIRST_DAY : Get the first day of the week
HRGPBS_HESA_DATE_FORMAT : Format the date in dd/mm/yyyy format
SD_CALC_DURATION_FROM_DATETIME : Find the difference between two date/time and report the difference in hours
L_MC_TIME_DIFFERENCE : Find the time difference between two date/time
HR_99S_INTERVAL_BETWEEN_DATES : Difference between two dates in days, weeks, months
LAST_DAY_OF_MONTHS : Returns the last day of the month
DATE_CHECK_PLAUSIBILITY :Check for the invalid date.
Reward points if useful,
siri -
Only one of my earbuds on my bose headphones works with my ipad, iphone and macbook- if I hold them there the right earbud will work, but for the life of me, I can't get them to both work. Why is this? And is Apple doing anything about this? While Apple's headphones have (finally) admittedly gotten better of late, I still prefer the much more comfortable headphones & sound quality that Bose makes and that I spent the money for.
Bose Product Support
-
How to get the date of Friday for the given week
HI,
I have a requirement to get the date of Friday for the given week.
Eg: I have an input of 200722 (Yearweek), From this I need to get the Date of the friday for this week 22 of Year 2007.
Plz let me know how to get this..
Thanks in advance..
Sridhar.Hi,
Thanks for your reply...
I have implemented your logic but not getting exact output as required.
Suppose, If i give the input as 200720, I am getting an output as 18 (friday of week 20 of year 2007), but i need to get an output of 18.05.2007
Plz let me know how to do thdi.
Thanks in advance.. -
I just upgraded my iPhone 3GS to 4.3.5 and my universal doc stopped working with it? It has worked flawlessly for the last year and suddenly I get the message: "this iphone is not optimized for this device." I dismiss the message, but the remote no longer works with it and the music is too quite to the speakers. The remote works fine with my Macbook Pro. I tried a restore on the iPhone and started from scrach, but the same problem exists.
Any help with this?
Thanks,
JTyep... my iphone 4 also having problem like astoker.. u see on dock pin using torch light.. i found 2 pin touch each other.. i solve my problem ready.. thanks wjosten.
Maybe you are looking for
-
How do I access my e-mail account on my i-pod touch?
I would like to set up my e-mail account on my i-pod touch so that I can quickly access it. Not in list of Mail Accounts currently when I hit the "MAIL" icon. Any help gladly accepted.
-
Re: CVI 9.0 file open error (FileSelectPopup - hang) on Vista deployments
Hoffman, I have attached the file you were originally seeing hang; however, I recompiled this on an identical (well, as close to identical as I can get - Windows XP SP3 with the 9.1.0.428 runtime engine you specified) and, upon recompiling, both of t
-
How to monitor DML acticity in a database
Besides logminer and fine grain auditing; is there any other functionality in oracle that can be use to capture DML activities for a given table in a given time? What I am trying to accomplish is to create a matrix on daily basis of all the DML opera
-
From where the VBRK-STCEG field value in the invoice header gets filled.
Hi Friends, I have a scenario in my client system. I have one sales organisation in Spain which sends a order to France based sales organisation. In the France based sales organisation the sales order will be created with sold to partner as the Spain
-
Use oracle http server to configure mod_plsql
Hi, I have a question. I have already installed HTTP server using the Oracle Database10g Companion CD on my Windows 2000 SP4. At the end of the installation, it refers to http://<computer_name>:7777 to open the HTTP server page. It seems work fine th