Skip to Content
0

How to get last working day of the month on SAP BODS script?

Dec 15, 2016 at 05:48 PM

92

avatar image

HI Gurus,

Could you please address my below query:

How to get last working day of the month on SAP BODS script?

Thanks in advance!

Regards,

Faisal

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Titto Antony Dec 17, 2016 at 06:36 PM
2

You can you use above approach or this one:
$L_DATE=last_date( sysdate( ));
while ( isweekend( $L_DATE)=1 )
begin
$L_DATE=$L_DATE-1;
end
Print($L_DATE);

Share
10 |10000 characters needed characters left characters exceeded
Devilal Rajappan Dec 16, 2016 at 07:41 PM
0

Hi Faisal,

Try below steps in script.

$LV_LAST_DAY = last_date(sysdate());

$LV_DAY_IN_WEEK =day_in_week($LV_LAST_DAY);

print(' Last working date : '|| decode( $LV_DAY_IN_WEEK=7,$LV_LAST_DAY-2, $LV_DAY_IN_WEEK=6,$LV_LAST_DAY-1, $LV_LAST_DAY));

$LV_LAST_DAY ---> date.
$LV_DAY_IN_WEEK --> Integer.

To consider holidays we should have a calendar table with required details.

Share
10 |10000 characters needed characters left characters exceeded