To find out the Previous Saturday
for a given date
REPORT ZPREVIOUS.
* To find out the Previous Saturday
for a given date
DATA: L_DATE LIKE SY-DATUM.
PARAMETERS: PREVDAY(2) TYPE N DEFAULT 7.
L_DATE = SY-DATUM.
L_DATE = L_DATE - ( ( ( L_DATE MOD 7 ) + PREVDAY ) MOD
7 ).
CASE PREVDAY.
WHEN 7. WRITE:/ 'Previous Saturday
', L_DATE.
WHEN 6. WRITE:/ 'Previous Sunday
', L_DATE.
WHEN 5. WRITE:/ 'Previous Monday
', L_DATE.
WHEN 4. WRITE:/ 'Previous Tuesday
', L_DATE.
WHEN 3. WRITE:/ 'Previous Wednesday',
L_DATE.
WHEN 2. WRITE:/ 'Previous Thursday
', L_DATE.
WHEN 1. WRITE:/ 'Previous Friday
', L_DATE.
ENDCASE.
More Function Module
Functions / SAP
Script / ALV
Tables
Database Table
ABAP Books List
ABAP/4 Certification,
Programming, Smartforms, Sapscripts and Object Oriented Programming Books
Smart Forms
SAP Smartforms
ABAP Menu:
ABAP Example Hints
and Tips
Return to Index:-
SAP ABAP/4 Programming,
Basis Administration, Configuration Hints and Tips
(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.
Information used on this site is at your own risk.
All product names are trademarks of their respective
companies. The site www.gotothings.com is in no way affiliated with
SAP AG.
Any unauthorised copying or mirroring is prohibited.
|