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

regarding function module

hi experts,

cud u plz tell me about the function module in which if i enter the start and enddate it will give me <b><u>number</u></b> of sundays in between the dates..thnx in advance...

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 30, 2007 at 04:04 AM

    Hi Ravi,

    Implement this.

    For No of Sundays & Saturdays

    date1 LIKE sy-datum DEFAULT '20060501',
    date2 LIKE sy-datum DEFAULT sy-datum.
    
    
    DATA z TYPE p DECIMALS 0.
    DATA cnt TYPE sy-dbcnt.
    
    
    WRITE: date1, date2.
    
    WHILE date1 LE date2.
    
    CALL FUNCTION 'DAY_IN_WEEK'
    EXPORTING
    datum = date1
    IMPORTING
    wotnr = z.
    
    ADD 1 TO date1.
    
    IF z = 7.
    ADD 1 TO cnt_su.
    ENDIF.
    
    
    ENDWHILE.
    
    WRITE: / 'Sun:', cnt_su.

    Reward if useful.

    Thanks

    Aneesh.

    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.