Skip to Content

Table Control

Hi all,

Give me an Idea that I want to populate the day(like for 23 nov as Friday 24 of nov as Saturday) dynamically for every month in table control for time sheet program.Could you suggest me what is the best way to achieve this?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Nov 23, 2007 at 05:02 AM

    Use this FM to get the day from date

    DATE_TO_DAY

    Regards,

    Naimesh Patel

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member suresh Ganesan

      There's a couple of questions in there... firstly, it's pretty easy to loop around 31 times to build up an array of dates and day names - see example code below. Secondly, yes you can have buttons in a TC, and also set individual cells to be output so that you can use them as labels. Thirdly, you might find function modules DATE_COMPUTE_DAY & DAY_NAMES_GET give you better results.

      Jonathan

      report zlocal_jc_sdn_date_loop.
      
      parameters:
        p_start               type sy-datum obligatory default sy-datum,
        p_loop                type sy-loopc obligatory default 31.
      
      start-of-selection.
        perform build_date_list.
      
      
      *&---------------------------------------------------------------------*
      *&      Form  build_date_list
      *&---------------------------------------------------------------------*
      form build_date_list.
      
        data:
          begin of ls_date_day,
            date            type sy-datum,
            day             type dtresr-weekday,
          end of ls_date_day,
          lt_date_day       like ls_date_day occurs 0.
      
        ls_date_day-date = p_start.
      
        do p_loop times.
      
          call function 'DATE_TO_DAY'
            exporting
              date    = ls_date_day-date
            importing
              weekday = ls_date_day-day.
      
          append ls_date_day to lt_date_day.
      
          add 1 to ls_date_day-date.  "increment date
      
        enddo.
      
        format reset.
        format color col_normal.
        loop at lt_date_day into ls_date_day.
          write: / ls_date_day-date, ls_date_day-day, at sy-linsz space.
        endloop.
      
      endform.                    "build_date_list

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.