Skip to Content

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Dec 17, 2016 at 06:36 PM

    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);

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 16, 2016 at 07:41 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded