|
How to use function DATE_GET_WEEK
A sample using function DATE_GET_WEEK
Report try05.
DATA: xweek(6) TYPE n,
xdt TYPE d.
xdt = '20050101'.
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
DATE
= xdt
IMPORTING
WEEK
= xweek
EXCEPTIONS
DATE_INVALID = 1
* OTHERS
= 2
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2
SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE:/ xdt.
WRITE:/ xweek.
ABAP Tips by :
Rajiv Ranjan Singh
Fast Links:
Functions to Get the Day of a Date
FM
to Get the Day for a Particular Date
Get help for your ABAP problems
Do you have a ABAP Question?
SAP Books
SAP Certification, Functional,
Basis Administration and ABAP Programming Reference Books
ABAP Tips
ABAP Forum for Discussion and Samples
Program Codes for Abapers
Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.sap-img.com
All the site contents are Copyright © www.sap-img.com
and the content authors. All rights reserved.
All product names are trademarks of their respective
companies.
The site www.sap-img.com is in no way affiliated with SAP AG.
Every effort is made to ensure the content integrity.
Information used on this site is at your own risk.
The content on this site may not be reproduced
or redistributed without the express written permission of
www.sap-img.com or the content authors.
|