- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Getting day of the year from DD/MM/YYYY using function in SAP system
You can do this by following line of code:
DATA(l_day) = m_date - CONV d(m_date(4) && '0101' ) + 1.
Where m date is the date that needs to be input as type d. Note the format of type d is YYYYMMDD.
Example
If the above function is not present in your system, you can use the below code using simple date subtraction.
DATA: l_date TYPE d, l_jan_01 TYPE d, l_day TYPE i. l_date = “your input date in YYYYMMDD format” l_jan_01 = l_date. l_jan_01+4 = '0101'. ( sets the date to first day of year) l_day = l_date - l_jan_01 + 1.
- Related Articles
- How to parse Date from String in the format: dd/MM/yyyy to dd/MM/yyyy in java?
- Convert MySQL date format from yyyy-mm-ddThh:mm:ss.sssZ to yyyy-mm-dd hh:mm:ss ?
- How to convert MM/YY to YYYY-MM-DD with a specific day in MySQL?
- MySQL query to convert YYYY-MM-DD to DD Month, YYYY date format
- Accepting date strings (MM-dd-yyyy format) using Java regex?
- Program to reformat date in YYYY-MM-DD format using Python
- How to convert MM/YY to YYYY-MM-DD in MYSQL?
- MySQL date format DD/MM/YYYY select query?
- MySQL - Convert YYYY-MM-DD to UNIX timestamp
- Convert dd/mm/yyyy string to Unix timestamp in MySQL?
- How to insert mm/dd/yyyy format dates in MySQL?
- Converting date from 'dd/mm/yyyy' to 'yyyymmdd' in MySQL
- How to validate given date formats like MM-DD-YYYY using regex in java?
- How to format a string to date in as dd-MM-yyyy using java?
- Get date format DD/MM/YYYY with MySQL Select Query?

Advertisements