Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8533

Re: DATE_WEEKDAY ISSUE

$
0
0

Hi Gaurav,

 

I have written the code, now its working fine thanks for your help

DATA: date1 TYPE sy-datum.

DATA: weekday_text TYPE LANGT.


**data declare for DATE_COMPUTE_DAY
DATA: day type  CIND.
* data declare for WEEKDAY_GET
DATA: return_code type  sy-subrc,
      weekday TYPE STANDARD TABLE OF t246,
      s_weekday type t246.

* compute day text -
* call this one first and only one time to get all texts
    s_weekday-sprsl = sy-langu.
    APPEND s_weekday TO weekday.
    CALL FUNCTION 'WEEKDAY_GET'
      EXPORTING
        language          = sy-langu
      IMPORTING
        return_code       = return_code
      TABLES
        weekday           = weekday
      EXCEPTIONS
        weekday_not_found = 1
        OTHERS            = 2.
    IF sy-subrc <> 0.
* Implement suitable error handling here
    ENDIF.
date1 = SOURCE_FIELDS-DATE.
IF date1 NE ' '.
** compute day
  CALL FUNCTION 'DATE_COMPUTE_DAY'
    EXPORTING
      date = date1
    IMPORTING
      day  = day.
  IF day NE ' '.
    CLEAR: s_weekday.
READ TABLE weekday INTO s_weekday WITH KEY WOTNR = day.
IF sy-subrc EQ 0.
weekday_text = s_weekday-LANGT.
ENDIF.
  ENDIF.
ENDIF.
RESULT = weekday_text.

 

Thanks,

Naveen


Viewing all articles
Browse latest Browse all 8533

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>