This website is not affiliated with, sponsored by, or approved by SAP AG.

date conversion

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

date conversion

Postby blur » Thu Feb 13, 2003 4:46 am

What is the abap code for previous 18 days? sy-datlo -18?
What will it be then in a weekly format?
blur
 

Postby Yorkie Abaper » Thu Feb 13, 2003 5:00 am

What are you trying to do?

Work out the date 18 days previous to today?

:?:
Yorkie Abaper
 
Posts: 878
Joined: Wed Jan 22, 2003 2:57 am
Location: N 53° 38.817 W 001° 50.118

Postby blur » Thu Feb 13, 2003 5:07 am

Yes, I was trying to work out what was the date 18 days ago. Same goes for the weeks. I was trying to work out what was the date eg 3 weeks ago?
blur
 

Postby Yorkie Abaper » Thu Feb 13, 2003 5:10 am

Just the generic date 18 days ago or do you want to exclude things
like weekends and bank holidays?

Andy
Yorkie Abaper
 
Posts: 878
Joined: Wed Jan 22, 2003 2:57 am
Location: N 53° 38.817 W 001° 50.118

Postby blur » Thu Feb 13, 2003 5:15 am

Juz excluding weekends will work out fine
blur
 

Postby Yorkie Abaper » Thu Feb 13, 2003 5:21 am

For 18 days ago just sy-datum - 18 is good.

To exclude weekends you will need to use

DATE_CONVERT_TO_FACTORYDATE
subtract 18 days from date returned

and then use

FACTORYDATE_CONVERT_TO_DATE

to convert the factory date back.

You will need to find a factory calendar that excludes weekends but not
bank holidays. (use FACTORY_CALENDAR_GET to get a list)

Hope this helps

Andy
Yorkie Abaper
 
Posts: 878
Joined: Wed Jan 22, 2003 2:57 am
Location: N 53° 38.817 W 001° 50.118

Postby blur » Thu Feb 13, 2003 5:34 am

Am i missing something here?

I had declared
SYDAT LIKE SY-DATUM.

SYDAT1 = SY-DATLO - 18.

However i do not get any return value for SYDAT1
blur
 

Postby ilya » Thu Feb 13, 2003 7:00 am

blur wrote:Am i missing something here?

I had declared
SYDAT LIKE SY-DATUM.

SYDAT1 = SY-DATLO - 18.

However i do not get any return value for SYDAT1


Do what was suggested above. Use the function if you want to skip weekends.
ilya
 
Posts: 2327
Joined: Thu Oct 31, 2002 4:49 am


Return to ABAP

Who is online

Users browsing this forum: No registered users and 6 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.