Skip to Content
author's profile photo Former Member
Former Member

How 2 Run the Report Monda- Friday...logic

Hi Experts,

My Report having 2 Perform Statements, in that 1 should run on Monday-Friday but not in Sat & sundays and Public holiays.

and 2 Perform should Run in 1st of every month.

how to write the code for this.

HOLIDAY_GET

exporting

HOLIDAY_CALENDAR = 'x' " will get you list of public holidays

FACTORY_CALENDAR = 'x' " will get you list weekly offs like sat, sun

by using the above FM can i get Public holidays & sat, sundays...

Could anyone help how to put the logic .....

thanks in Advance....

sudeer.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 11, 2008 at 07:49 PM

    Hi,

    FM for Dates

    DATE_GET_WEEK Returns week for a date

    WEEK_GET_FIRST_DAY Returns first day for a week

    RP_LAST_DAY_OF_MONTHS Returns last day of month

    FIRST_DAY_IN_PERIOD_GET Get first day of a period

    LAST_DAY_IN_PERIOD_GET Get last day of a period

    RP_LAST_DAY_OF_MONTHS Determine last day of month

    FM for Holidays

    HOLIDAY_GET Provides a table of all the holidays based upon a Factory Calendar &/ Holiday Calendar.

    HOLIDAY_CHECK_AND_GET_INFO Useful for determining whether or not a date is a holiday. Give the function a date, and a holiday calendar, and you can determine if the

    date is a holiday by checking the parameter HOLIDAY_FOUND.

    Example: HOLIDAY_CHECK_AND_GET_INFO

    data: ld_date like scal-datum default sy-datum,

    lc_holiday_cal_id like scal-hcalid default 'CA',

    ltab_holiday_attributes like thol occurs 0 with header line,

    lc_holiday_found like scal-indicator.

    CALL FUNCTION 'HOLIDAY_CHECK_AND_GET_INFO'

    EXPORTING

    date = ld_date

    holiday_calendar_id = lc_holiday_cal_id

    WITH_HOLIDAY_ATTRIBUTES = 'X'

    IMPORTING

    HOLIDAY_FOUND = lc_holiday_found

    tables

    holiday_attributes = ltab_holiday_attributes

    EXCEPTIONS

    CALENDAR_BUFFER_NOT_LOADABLE = 1

    DATE_AFTER_RANGE = 2

    DATE_BEFORE_RANGE = 3

    DATE_INVALID = 4

    HOLIDAY_CALENDAR_ID_MISSING = 5

    HOLIDAY_CALENDAR_NOT_FOUND = 6

    OTHERS = 7.

    if sy-subrc = 0 and

    lc_holiday_found = 'X'.

    write: / ld_date, 'is a holiday'.

    else.

    write: / ld_date, 'is not a holiday, or there was an error calling the function'.

    endif.

    This May also Help

    help.sap.com/printdocu/core/print46b/en/data/en/pdf/BCCICALENDAR/SAP_KALENDER.pdf -

    Else

    You can use this FM:

    get the attributes for the specified day

    CALL FUNCTION 'DAY_ATTRIBUTES_GET'

    EXPORTING

    factory_calendar = fact_cal " default 'GR'

    holiday_calendar = holiday_cal " default 'GR'

    date_from = a_date

    date_to = a_date

    language = sy-langu

    • IMPORTING

    • YEAR_OF_VALID_FROM =

    • YEAR_OF_VALID_TO =

    • RETURNCODE =

    TABLES

    day_attributes = days_attr_tbl

    EXCEPTIONS

    factory_calendar_not_found = 1

    holiday_calendar_not_found = 2

    date_has_invalid_format = 3

    date_inconsistency = 4

    OTHERS = 5.

    IF sy-subrc <> 0.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

    ENDIF.

    READ TABLE days_attr_tbl INDEX 1 ASSIGNING <day_attr>.

    IF NOT <day_attr>-holiday_id IS INITIAL.

    MESSAGE w888(sabapdocu) WITH a_date text-e05 <day_attr>-txt_long.

    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 12, 2008 at 03:37 AM

    Use this fm RH_GET_DATE_DAYNAME.you must provide Language, Date.

    You will get day name for date depending on it you can write case statement to decide which perform statement you must execute

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.