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

Fn mod for date

xperts,

any fn mod available for getting dates like;

if i am exec on Mon;

Sun Mon Tue Wed Thu Fri Sat

Sun Mon Tue Wed Thu Fri Sat (10 days)

if i am executing it on Wed.

Sun Mon Tue Wed Thu Fri Sat

Sun Mon Tue Wed Thu Fri Sat (8 days)

wat i need is the date.

and the passing parameter is sy-datum

eq:if sy-datum = 20081023

dates i hav to gt : 23 24 27 28 29 30 31

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 23, 2008 at 01:25 PM

    Hi

    PARAMETERS: p_datum TYPE sy-datum.
    
    data: day type sy-datum,
          last_day_of_month TYPE sy-datum.
    
    START-OF-selection.
    
      CALL FUNCTION 'LAST_DAY_OF_MONTHS'
        EXPORTING
          DAY_IN            = p_datum
        IMPORTING
          LAST_DAY_OF_MONTH = last_day_of_month.
    
      day = p_datum.
      do.
        write: / day.
        if day = last_day_of_month.
          exit.
        endif.
        day = day + 1.
      enddo.

    Max

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      I dont think he needs last days in months, if I got him correctly what he is looking for is all the days except sat / sun upto next friday

      #1 - I dont think there is a FM for that, you need to code for that finding the day for your date, then adding the days accordingly.

  • author's profile photo Former Member
    Former Member
    Posted on Nov 12, 2008 at 08:01 AM

    Developed logic for that,

    lv_dat_tmp = sy-datum.

    do 14 times.

    call function 'RH_GET_DATE_DAYNAME'

    exporting

    langu = sy-langu

    date = lv_dat_tmp

    importing

    daynr = lv_daynr.

    if lv_daynr eq 6.

    lv_dat_tmp = lv_dat_tmp + 2.

    elseif lv_daynr eq 7.

    lv_dat_tmp = lv_dat_tmp + 1.

    else.

    lx_date-pedtr = lv_dat_tmp.

    append lx_date to lt_date.

    if lv_daynr eq 5 and lv_status ne 6.

    lv_status = 1.

    endif.

    lv_dat_tmp = lv_dat_tmp + 1.

    lv_status = ( lv_status * 1 ) + 1.

    endif.

    if lv_status eq 7.

    exit.

    endif.

    enddo.

    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.