Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Function module for date

Former Member
0 Likes
855

Hi ,

i want to know the function module for date.

I.e when i enter the two digits of a month then i shuld get the

text for the month.

ex: If i enter '02' then i should get FEB.

REGARDS,

SATYA

7 REPLIES 7
Read only

Former Member
0 Likes
804

Hi,


DATA: I_DATE TYPE  SY-DATUM,
     MONTHNAME  TYPE  T247-LTX.

CALL FUNCTION 'MONTH_NAMES_GET'
    EXPORTING
      language    = sy-langu
    IMPORTING
      return_code = return
    TABLES
      month_names = month_names
  exceptions
    month_names_not_found       = 1
    others                      = 2.


 if sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

loop at month_names.
   if month_names-mnr = i_date+4(2).
     monthname = month_names-ltx.
   endif.
 endloop.

thanx.

Edited by: Dhanashri Pawar on Sep 23, 2008 1:54 PM

Read only

Former Member
0 Likes
804

Try Fm: MONTH_NAMES_GET

Eliram.

Read only

Former Member
0 Likes
804

write select statement this way...

select KTX into t247-ktx

from T247

where spras = 'EN'

and mnr = '02". <Here you need to specify the month value>

Read only

RemiKaimal
Active Contributor
0 Likes
804

Hi,

Check :


DATA month TYPE  fcktx.
SELECT SINGLE ktx FROM t247
              INTO month
              WHERE spras = sy-langu
              AND   mnr   = '02'.

Also check the FM : MONTH_NAMES_GET to get the List of months

Cheers,

Remi

Read only

Former Member
0 Likes
804

hi

this will solve your problem.

DATA:
  w_date like T247-KTX.

CALL FUNCTION 'ISP_GET_MONTH_NAME'
  EXPORTING
    language           = sy-langu
   MONTH_NUMBER       = '02'
 IMPORTING
   SHORTTEXT          = w_date.
   
WRITE: w_date.

Regards

Adil

Read only

Former Member
0 Likes
804

Hi ,

use this fM CONVERSION_EXIT_SDATE_OUTPUT.

Just goto se37 and execute this function Module. Here give the input as 20080923 and the output will be 23.SEP.2008

Regards,

Srinivas

Read only

Former Member
0 Likes
804

This message was moderated.