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

Re: Function Module to Get Week, Month and Year from Mch1-hsdat

$
0
0

Hi Richard,

 

I have gone through your requirement, SAP has provided a text table T247 where the month name and short text for all the months have been maintained, So please make sure entries are present in that table. Then the exception will not be raised.

 

DATA : day     TYPE  char2,

           month  TYPE  char2,

           year     TYPE  char4,

           stext    TYPE t247-ktx,

            ltext    TYPE t247-ltx.

 

   CALLFUNCTION'HR_IN_GET_DATE_COMPONENTS'

     EXPORTING

       idate                               = p_hsdat

    IMPORTING

      day                                 = day

      month                               = month

      year                                = year

      stext                               = stext

      ltext                               = ltext

*     USERDATE                            =

    EXCEPTIONS

      input_date_is_initial               = 1

      text_for_month_not_maintained       = 2

      OTHERS                              = 3

             .

   IF sy-subrc <> 0.

     MESSAGEID sy-msgid TYPE sy-msgty NUMBER sy-msgno

             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

   ENDIF.

 

refer the above code it did not raise any exception.


Viewing all articles
Browse latest Browse all 3177

Trending Articles



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