Abap how many days in a month
An employee new joinee or exiting employee , whose monthly gross pay is Rs 30,, works for 10 days in the month of July day month. Hence, the company would pay the employee Rs 10, as salary for 10 days in July.
If the company were to follow the calendar day logic, the per-day salary in July shall be Rs There are more day months 7 than day months 4 in a calendar year. Arguments in favor of the fixed-days method are fallacious. A typical argument we hear in favour of the fixed-days method is as follows. Let us maintain consistency across 30 and 31 day months. Whether an employee joins on September 21 or October 22 and hence works for 10 days they should be paid the same salary.
Given the Gregorian calendar system, organizations which make monthly salary payments have chosen to pay the same amount as salary whether it is a 28 or 30 or 31 day month. What about consistency there? We wonder how organizations that follow the fixed days logic resolve the problem inherent in the method.
As a tech lead of a similar payroll project, I was faced with exact same question and the only solution that I could come out was to have a configuration section that defines which basis is to considered. As a generic payroll app, we may be required to take different approaches to different group of employees within a single company! Another very important aspect that is ignored by most payroll accountants is to look at the employment contract and see how the salary was structured and on which frequency a pay-head offered is based on.
So, if the employee is offered that you will be paid per month, then fixed number should be considered but if it was annual CTC, then it should be actual calendar days. This is also important for entitlements typically reimbursements which are allotted on annual basis.
He did duty for 14 days in that period and there is two days weekly rest. May 1, is Sunday. That would depend on the leave rules your organization follows. However, please ensure that your organization provides for the paid weekly-off as per statutes e.
Hi, can you please guide me, if i have joined an org on 9th and worked on 9th and then went on leave and joined back on 19th.
In that case, how is the LOP calculation? If any relevant section or rule. Pls quote. I ve a small dought. I my company salary statement calculation date is 2oth of previous month to 21st of present month. If employee join on 23rd how many days of salary we ve to pay counting 20st of previous month to 21st of present month.
You could calculate salary on the basis of the total number of days between 21 and 20 similar to the calendar day logic. Ex: Employee who draws salary of 31k , was on leave for 1 day in March , as well 1 day in Apr , let us see the deduction now. So for 1 day leave of April would cost employees more than of Mar , situation would be worst on February more. There is nothing wrong in having a different per-day salary across months.
Please note that we pay the same salary to an employee across months with different calendar days. I've tried googling but I couldn't find any functions which did this. It is absolutely unnecessary to rely on any function module that may or may not be present in your system. Just use basic built-in language elements:. You have to pass an initial date and an end date, and it will return the number of days in between this is what you want :. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. How do I get day number from a date in abap? Ask Question. Asked 6 years, 3 months ago. Active 10 months ago. Viewed 5k times. Improve this question. And the easy way they find is put up the query on SDN I have done most of my date calculation in similar fashion. And i have surely done that last day of month.. Good to find someone who really thinks about simple solution then looking at complex problems.
All the best. In that case if you add 31 days it will directly move to March skipping the Feb. The code snippet will work correctly for any date, as the first line of it converts our given date to the start of the month. Try it yourself in your program.
Enjoy your answers, thanks! Like 0 Share Right click and copy the link to share this comment Suresh Radhakrishnan January 4, at pm Your blog is simple but thoughtful. However, finally you suggest to have this wrapped in a macro or something like that But if we take the basic concept of understanding date data-type and its in-built attributes and behaviour For simple date calculations I prefer macros, not FMs, as macros have zero calling cost actually it is not a call, macros are resolved during program source compilation.
Regards, Sergey Like 0 Share Right click and copy the link to share this comment Carsten Kasper February 11, at am Found this blog a while ago and bookmarked it. Today was the day where I could put it to use. I really like the lean and mean style of date calculations. Why waste time on overhead if writing it directly saves not only time but also lines of code.
Glad to know it was useful. Skip to Content. Sergei Korolev. December 28, 1 minute read. And what about elegance? Alert Moderator. Alerting is not available for unauthorized users. Assigned tags. Similar Blog Posts. Related Questions.
0コメント