FM to find same date of next month
Hi All,
Please tell me the FM to find out the same date of the next month?
Thanks - Chandan
Hi,
Use the FM HR_PT_ADD_MONTH_TO_DATE.
Give the input like this,
Import Parameters Value
DMM_DATIN 12.11.2007
DMM_COUNT 1
DMM_OPER -
DMM_POS 1
Export Parameters Value
DMM_DAOUT 12.10.2007
if the count is ' - ' ,it will give the previous month same date and and '+' will give u the next month same date depending upon the count u give i.e. 1 or 2 etc.
reward pts if useful.
Regards,
Subha
Similar Messages
-
Same date of previous month / Leap year
In my requirment , I am passing a date, I want a function module which will return me the same date of last month. I have found a function HR_PSD_DATES_ADD_MONTHS , but it is not giving output if I pass date as 31st March 2000 , as previous month is February and its a leap yr.
If you know function module which could help me , pls help me.Hello,
Try this way :
REPORT ZTEST_NP .
parameters: p_dt type d.
data:
lst_dt type d,
l_dt type d,
days type i,
prv_dt type d.
l_dt0(4) = p_dt0(4).
l_dt4(2) = p_dt4(2) - 1.
if l_dt+4(2) le '00'.
l_dt+4(2) = '12'.
endif.
l_dt6(2) = p_dt6(2).
CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
EXPORTING
DAY_IN = l_dt
IMPORTING
LAST_DAY_OF_MONTH = lst_dt
EXCEPTIONS
DAY_IN_NO_DATE = 1
OTHERS = 2
if lst_dt ge l_dt.
prv_dt = l_dt.
else.
prv_dt = lst_dt.
endif.
write: prv_dt.
regards,
Naimesh -
Report carry forwarding the current month 2weeks data to next month
Hi experts,
Issue statement:
XXXXX Procurement reports in MSTR (MRP Adhoc report) is showing weeks out of order, the last 2 weeks of a current month are carried over to the first two weeks of the next month (ie, working week 33-ww34 from August are repeated as the first 2 weeks of September, therefore September will have 7 weeks, ww33 to ww39), this happens month over month, this issue is probably making the EOH calculation to be wrong and most likely any other calculations. Materilas need this report to place PO's based on inventory levels and so far the data is not trustable and wrong. Need this to be fixed asap. Thanks a lot.
we running the process chain the Job set to clear every 2 weeks data, could you plz let me know why it geting current month 2weeks data to next month.thanks
-
Hello,
I'm trying to get the next month's value from a variable named &V_FIRST_FORECAST.
So, let's say if my first forecast is "Oct", I want a function to return the next month "Nov" and write on it.
And also I want it to be dynamic if I want to write on the next 3 or 4 months.
I've tried using @Next(Element X,1)=@Next(Element Y,1). But the @next function isn't working on the left hand side of the equation..
So, what can be done in order to enable the left hand side of the equation to write starting from next month or the month after and so on ?
Any help?
Thank you.Yeah.. that wont work. You need to try to get your next member either in a calc block or fix statement to get this to work. If you share more about what you are trying to do (more code sharing), people here may be able to help you point in the right direction.
-
I wanted to do a basic check on a Table, 10g.
customer_id, DATE
Basically I wanted to do a check, to make sure that each customer_id has a DISTINCT DATE, so for the data returned,
the DATE should be unique and not repeat, I know its probably something super easy, but I wanted to analyze the whole
table and do a count of such instances:
this would be ok:
12345 20101001
25487 20101002
this would not be ok:
12345 20101001
12345 20101001 -- duplicate date
25487 20101002
the DATE column in a varchar2, it is in format YYYYMMDD, not using type DATE, just fyi. Ya, I know, I didn't set that up.
Would I employ a SELF JOIN here, not much experience in that.Hi,
Here's one way:
WITH got_cnt AS
SELECT customer_id
, dt -- DATE is not a good column name
, COUNT (*) OVER ( PARTITION BY customer_id
, dt
) AS cnt
FROM table_x
SELECT *
FROM cot_cnt
WHERE cnt > 1
ORDER BY customer_id
, dt
;A self-join would be anouther way to find the duplicates, but maybe not as efficient. Also, what would you want if there happened to be 3 (or even more) rows with the same customer_id and dt?
Edited by: Frank Kulash on Oct 21, 2010 4:44 PM
D'oh!
If all you want to display are the duplicated columns, you can do something even faster and simlpler:
SELECT customer_id
, dt
, COUNT (*) AS cnt
FROM table_x
GROUP BY customer_id
, dt
HAVING COUNT (*) > 1
; -
Insert same data with next holiday date
Hi All,
I have write a pl block where in i need to copy the existing records from the
table A to table A itself with date+1.
Say for eg. there is a situation were daily one record is inserted into table A
and there is a data column init but NO records for sat,sunday and holidays
I need to write a block to insert records for sat,sun and holiday in the table A
which rec? if rec is missing for say for eg date 04/May/2007 then I need to take
records from 03/May/2007 and insert a new records by copying all the rec from previous date with data column in A as 04/May/2007.
like wise there are lac of rec in table A and thousands of missing rec for sat,sun & holiday.
I am trying to do this by taking cursor and finding out the missing rec and insert it.
i have just started can any one of you help in this. by posting the best logic for this
Thanks,
AAK.Hi1
pls try this --
SQL>
SQL> set serveroutput on
SQL>
SQL>
SQL> set lin 1000
SQL>
SQL> select * from emp_q;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO C PHONE
7777 Avik CLERK 7839 02-MAR-07 3456 263 30 M 12547896
6666 prithwi CLERK 7839 22-JUL-06 1234 248 30 M 14782563
7639 Roni CLERK 3434 17-DEC-80 12121 50 F
7499 ALLEN SALESMAN 7469 20-FEB-81 1234 300 30 M
7521 WARD SALESMAN 7698 14-FEB-07 1234 500 10 F
7566 JONES MANAGER 7469 02-APR-81 1000 10 F
7654 MARTIN SALESMAN 7698 28-SEP-81 1234 1400 53 F
7698 BLAKE MANAGER 7839 01-MAY-81 1234 40 M
7782 CLARK MANAGER 7839 09-JUN-81 1234 20
6194 Verona CLERK 7839 30-APR-07 2365 125 30 F 12543698
6698 Fereda CLERK 7839 30-APR-07 2365 125 30 M 12543698
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO C PHONE
6903 Aliva CLERK 7839 30-APR-07 2365 125 30 F 12543698
7411 Naba CLERK 7839 27-APR-07 1450 452 30 29631478
7529 Indra SALESMAN 7839 27-APR-07 5025 250 30 M 28963147
7698 BLAKE MANAGER 7839 01-MAY-81 1234 40 M 23515485
7782 CLARK MANAGER 7839 09-JUN-81 1234 20 23651489
7788 SCOTT ANALYST 7566 19-APR-87 1234 40 F 25483698
7839 KING PRESIDENT 7839 17-NOV-81 1234 40 F 23691436
7844 TURNER SALESMAN 7698 08-SEP-81 1234 0 30 F 23459687
7876 ADAMS CLERK 7788 23-MAY-87 1234 10 M 23984297
7900 BARRY CLERK 7698 03-DEC-81 1234 500 10 F 25983147
7902 FORD ANALYST 7566 03-DEC-81 1234 40 F 29541236
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO C PHONE
7934 MILLER CLERK 7458 23-JAN-82 1234 10 F 24893175
23 rows selected.
SQL>
SQL>
SQL> insert into emp_q
2 select empno,ename,job,mgr,sysdate+1,sal,comm,deptno,code,phone
3 from emp_q
4 where empno = 7777;
1 row created.
SQL>
SQL>
SQL> commit;
Commit complete.
SQL>
SQL> select * from emp_q;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO C PHONE
7777 Avik CLERK 7839 02-MAR-07 3456 263 30 M 12547896
6666 prithwi CLERK 7839 22-JUL-06 1234 248 30 M 14782563
7639 Roni CLERK 3434 17-DEC-80 12121 50 F
7499 ALLEN SALESMAN 7469 20-FEB-81 1234 300 30 M
7521 WARD SALESMAN 7698 14-FEB-07 1234 500 10 F
7566 JONES MANAGER 7469 02-APR-81 1000 10 F
7654 MARTIN SALESMAN 7698 28-SEP-81 1234 1400 53 F
7698 BLAKE MANAGER 7839 01-MAY-81 1234 40 M
7782 CLARK MANAGER 7839 09-JUN-81 1234 20
6194 Verona CLERK 7839 30-APR-07 2365 125 30 F 12543698
6698 Fereda CLERK 7839 30-APR-07 2365 125 30 M 12543698
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO C PHONE
6903 Aliva CLERK 7839 30-APR-07 2365 125 30 F 12543698
7411 Naba CLERK 7839 27-APR-07 1450 452 30 29631478
7529 Indra SALESMAN 7839 27-APR-07 5025 250 30 M 28963147
7698 BLAKE MANAGER 7839 01-MAY-81 1234 40 M 23515485
7782 CLARK MANAGER 7839 09-JUN-81 1234 20 23651489
7788 SCOTT ANALYST 7566 19-APR-87 1234 40 F 25483698
7839 KING PRESIDENT 7839 17-NOV-81 1234 40 F 23691436
7844 TURNER SALESMAN 7698 08-SEP-81 1234 0 30 F 23459687
7876 ADAMS CLERK 7788 23-MAY-87 1234 10 M 23984297
7900 BARRY CLERK 7698 03-DEC-81 1234 500 10 F 25983147
7902 FORD ANALYST 7566 03-DEC-81 1234 40 F 29541236
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO C PHONE
7934 MILLER CLERK 7458 23-JAN-82 1234 10 F 24893175
7777 Avik CLERK 7839 04-MAY-07 3456 263 30 M 12547896
24 rows selected.
SQL> Regards.
Satyaki De. -
To find the data of previous month
Hi
I am trying to retrieve the SR created in the previous month. I have used the condition of Month (opened date)= month (Now()) -1. But when I try to retrieve the report in Jan it ends up in no data as they are subtracting 1-1 which gives 0. kindly suggest a workaround where in I can use a common function which gives me the data of dec in Jan.
Thanks
MeenaYour issue likes user5413821.
If you want to show the last month, you can use this formula:
TIMESTAMPADD(SQL_TSI_MONTH, -1, CURRENT_MONTH)
Hope it can solve your issue. -
How do we find first date of a month and last date of month?
is it required long caluculation or is there any simple method?
hi,
try this FM -> 'HR_JP_MONTH_BEGIN_END_DATE'
chk this also
CALL FUNCTION 'LAST_DAY_OF_MONTHS'
EXPORTING
DAY_IN = sy-datum
IMPORTING
LAST_DAY_OF_MONTH = v_lastdate. <--Gives you the last day of a Month
Other FM
SG_PS_GET_LAST_DAY_OF_MONTH
HRVE_LAST_DAY_OF_MONTH
SLS_MISC_GET_LAST_DAY_OF_MONTH
rgds
anver
if hklped mark points -
I have 10 gb data..the next month rolled over...
Now I have 20gb of data since it rolled over the next more an extra 10 gigs a month . I have only 10gbs of data on my plan.Will it rolloveer another 10 gbs month next month so I'll have about 30 gbs as rollever date?if so, in total, if thats true ill have used 4gb out of 26 gb of date for next month.
I know many people think that using your base data first makes rollover useless but it sure comes in handy when you need it. In this current bill cycle my family has for the first time used all of our base data and we are now using what rolled over from last month. So far I have avoided over $100 in overage charges. I realize I won't have any rollover data next month but I don't mind.
-
Find date if year, month, week and day is given
Hi,
How to find the date, if year, month, week and day is given?
For example:
Given, year - 2010, month - 03, Day - Wednesday, Week - 3,
Then how can we get the date as 17-Mar-2010.
Thanks,
Chriswith dt_tbl as (
select 2010 year,
3 month,
3 week,
'Wednesday' day
from dual
select trunc(to_date(year || '-' || month || '-01','yyyy-mm-dd'),'iw') + (week - 1) * 7 +
case day
when 'Monday' then 0
when 'Tuesday' then 1
when 'Wednesday' then 2
when 'Thursady' then 3
when 'Friday' then 4
when 'Saturday' then 5
when 'Sunday' then 6
end dt
from dt_tbl
DT
17-MAR-10
SQL> SY. -
MDX to fetch record from 1st of current month to 5th of next month and same for previous year
In my date dimension I have a attribute CalendarDate. I do have a hierarchy [Date].[Year].[Quarter].[Month].[CalendarDate] as well. I need to fetch data starting from 1st working day of current month to 5th working day of next month by MDX. I do have a attribute
to filter working day as IsWorkingDay. How can we get a dynamic MDX that will find the current month first and than it will filter the record from 1st working day of current month to 5th working day of next month. And same for the previous year same month
to compare.
Thanks in advance!
PalashHi P,
You can use a calculated member to dynamically add all the days in the current month and the first 5 in the following month. You will need to change measure, cube and hierarchy names.
with member measures.ThisMonthAnd5 as
sum([Date].[Year].parent.children,Measures.[Sales])
+sum(Head([Date].[Year].parent.nextmember.children,5),Measures.[Sales])
select
{Measures.[Sales]
,Measures.ThisMonthAnd5
} on 0,
non empty [Date].[Year].[CalendarDate]
on 1
from MyCube
Richard -
I can't be the only person who has this problem with iCal- when a month ends on a Saturday I can't drag events into the next month and instead have to cut and paste - a real pain in the butt. I thought there was something called "scroll" but I can't find that.
Yeah that works, but, it involves a click on the event, a click on edit, a click on the date, keystrokes, plus, since you can't see the next month you have to have a calendar in front of you so as to put it to the right date. It's easier just to cut it and advance the month and paste it, once you are in the right month you can move it around helter skelter willy nilly no problems. Although now that you mention it I will try it, maybe it is easier than cut and paste as I don't really care about the date, as long as it gets moved into the right month I can drag it around all I want.
-
ICal moving an event to a new date, next week or next months,
how do i drag my event from todays days to next months, i can not seem to drag an event from a date to another date unless its in the same week if in week view, or same month if in the mionth view, Their must be a simple drag function
Message was edited by: CaptainStarwarsCaptainStarwars,
Dragging is not possible under the circumstances that you describe.
You click on the event and use (⌘C) and then (⌘V). if you want to remove the event from the first occurrence use (⌘X), and (⌘V).
;~) -
Hi,
How to find the last date of the next month.
Thanks in advance
SunithaUse the below mentioned FM
call function 'LAST_DAY_IN_PERIOD_GET'
exporting
i_gjahr = p_finyear
i_periv = 'X1'
i_poper = lv_popere
importing
e_date = p_edate
exceptions
input_false = 1
t009_notfound = 2
t009b_notfound = 3
others = 4.
if sy-subrc <> 0.
endif.
Supply the proper parameters, u will get the last date in the next month. -
Hi. How do i return date records of next month?
I am aware i may need sysdate.
At the moment i have been trying:
WHERE delivery_date = ADDMONTHS (sysdate, 1);
No avail.
Ideas?Hello
If you mean you want to set up a range from the start of next month to the end of next month. This shows what happens when you apply add_months to sysdate
SQL> select sysdate from dual;
20-NOV-05
SQL> select add_months(sysdate,1) from dual;
20-DEC-05
--Truncate sysdate to the first day of the month and then add 1 month
SQL> select add_months(trunc(sysdate,'MM'),1) from dual;
01-DEC-05
--do the same, but use LAST_DAY to get the date of the last day next month
SQL> select add_months(trunc(sysdate,'MM'),1),last_day(add_months(trunc(sysdate,'MM'),1)) from dual;
01-DEC-05 31-DEC-05So with that in mind, you probably need to do something like
WHERE
delivery_date BETWEEN add_months(trunc(sysdate,'MM'),1) AND last_day(add_months(trunc(sysdate,'MM'),1));If you just want to get rows for "this" day next month you may well need to set a date range up especially if the delivery_date has not been truncated to set the time portion to 00:00:00
WHERE
delivery_date = ADD_MONTHS(TRUNC(sysdate),1))
WHERE
delivery_date >= ADD_MONTHS(TRUNC(sysdate),1))
AND
delivery_date < ADD_MONTHS(TRUNC(sysdate),1)) + 1HTH
David
Message was edited by:
david_tyler
Maybe you are looking for
-
Windows Vista Installed, Can't Get Drivers, Won't Read 10.4.8 Install Disk
Hello. I've searched the forums and haven't found an answer yet. I installed Windows Vista 32-bit using Boot Camp on my Mac Pro. That part was fine but I cannot get the drivers to load from my install disk (10.4.8). This is a totally legit copy. The
-
Mini Display / Thunderbolt to Monitor
Hi, So I currently have a 2010 MacBook pro which I connect to my monitor with a NEET cables mini display - HDMI adapter. I am planning on getting a 2013 MacBook Air soon; will this cable still work or will I need a completely new thunderbolt - HDMI a
-
Scanned document but it doesn't show up anywhere...
Everything seems to connect and work but after the scanning is done both computer and scanner (Brother MFC 7820n) just sit there...nothing loaded Preview or anywhere else. Any suggestions???
-
Hi, Does anyone know of a remote-enabled function module (RFM) that would allow me to insert object directory entries into TADIR? I've found TR_TADIR_INTERFACE, which is perfect for what I need, but its not remote enabled. I could write my own ABAP R
-
Hi I am required to add batch splitting logic in below code. Any one tell me how to do this PERFORM get_invoice_data. PERFORM filter_invoice_data. FORM get_invoice_data. SELECT k~vkorg k~vbeln k~fkart k~vtweg k~fkdat "CHOYT CHG#1589121