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

function Module

How to get week day in text while give input as date

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 02:10 PM

    Hi,

    Use this FM DATE_TO_DAY

    data : L_DAY(10).

    CALL FUNCTION 'DATE_TO_DAY'

    EXPORTING

    DATE = P_BUDAT

    IMPORTING

    WEEKDAY = L_DAY.

    I hope this will help you

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 02:13 PM

    you need to use two FM's

    This Function Module DATE_COMPUTE_DAY will give you the Day from a date . This will be a no 0,1,2,3 etc

    and then pass that value to

    DAY_NAMES_GET

    will give the name of the day

    Regards

    Santosh K

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      to get the date you can use DATE_COMPUTE_DAY fm.

      it takes date as >input.

      and gives integer representing day as <output.

      i am giving you the sample code.

      hope i will help you.

      DATA : DATE like SCAL-DATE,

      DAY LIKE SCAL-INDICATOR.

      DATE = '20050728'.

      CALL FUNCTION 'DATE_COMPUTE_DAY'

      EXPORTING

      DATE = DATE

      IMPORTING

      DAY = DAY.

      CASE DAY.

      WHEN 1.

      WRITE :/ 'MONDAY'.

      WHEN 2.

      WRITE :/ 'TUESDAY'.

      WHEN 3.

      WRITE :/ 'WEDNESDAY'.

      WHEN 4.

      WRITE :/ 'THURSDAY'.

      WHEN 5.

      WRITE :/ 'FRIDAY'.

      WHEN 6.

      WRITE :/ 'SATURDAY'.

      WHEN 7.

      WRITE :/ 'SUNDAY'.

      ENDCASE.

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2008 at 03:44 AM

    Hi,

    check these FM

    DATE_GET_WEEK,DATE_TO_DAY,DATE_COMPUTE_DAY

    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.