2013 Oct 07 7:27 AM
I want to convert date format
Example : 01.01.2000 convert it into 01.Jan.00
How i can get this?
2013 Oct 07 7:39 AM
Hello Jaya,
you can try converting it by using
SET DATE MASK = 'DD.MMMM.YY'
2013 Oct 07 7:58 AM
2013 Oct 07 8:00 AM
Hi Jaya,
You can use the SET DATE MASK to change the date format in the Smartform output as indicated by Nicolas Glänzer.
Create code lines (before the node where you print the date) in the Smart Form and write the command to change the date format.
For printing the date as "01.Jan.00", you can use the below command.
SET DATE MASK = "DD.MMM.YY".
For reference you can see the documentation in the following link.
http://help.sap.com/saphelp_nw73ehp1/helpdata/en/4e/3663165fff02c9e10000000a15822b/content.htm
Regards,
Narayana Reddy A V L.
2013 Oct 07 8:10 AM
Deara jaya Reddy,
please use the following code or make a funciton module and use it in command lines before the text in smart form you will get your result.
PARAMETERS: dat type sy-datum.
data : e_month type c LENGTH 2,
e_year type c LENGTH 4.
data: day type c LENGTH 2.
data: date TYPE c LENGTH 25.
data: MONTH_NAMES LIKE T247 OCCURS 0.
data: wa_month like LINE OF month_names.
day = dat+0(2).
CALL FUNCTION 'CACS_DATE_GET_YEAR_MONTH'
EXPORTING
I_DATE = dat
IMPORTING
E_MONTH = e_month
E_YEAR = e_year.
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
LANGUAGE = SY-LANGU
* IMPORTING
* RETURN_CODE =
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.
delete month_names where mnr ne e_month.
READ TABLE month_names into wa_month index 1.
CONCATENATE day '-' wa_month-ltx '-' e_year into date.
CONDENSE date.
write: date.
2013 Oct 07 10:25 AM
Hi Jaya Reddy,
Please check the below link. You can find a similar discussion here.
http://scn.sap.com/thread/394228
Regards,
Riju Thomas.
2013 Oct 07 11:01 AM
Hi Jaya,
Hi Jaya,
You can achieve your object using table T247.
Algo for code will be:
let DATE = 07.10.2013
You can use table T247 Pass Spras = EN and MNR = '10' and fetch KTX field value.
This will give you Month name as OCT.
CONCATENATE '07.' KTX '.' date+8(2) into date1 RESPECTING BLANKS.
This will give you date as required.
Regards,
Jeetendra
2013 Oct 08 10:22 AM
Hi Jaya,
You can also use FM 'CONVERSION_EXIT_SDATE_OUTPUT'.
EXAMPLE
DATA: INT_DATUM TYPE SY-DATUM VALUE '19940102',
EXT_DATUM(11) TYPE C.
CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'
EXPORTING
INPUT = INT_DATUM
IMPORTING
OUTPUT = EXT_DATUM.
Regards,
Anoop