10-16-2007 10:27 AM
Dear All,
I want to convert my date 01.01.2007 into 01-Jan-2007.
The exact reverse process of FM 'CONVERSION_EXIT_SDATE_INPUT'.
Please Help!
Thanks!
10-16-2007 10:29 AM
Hi Dev,
Check this Sample code,
DATA V_MONTH(11).
CALL FUNCTION 'CONVERSION_EXIT_LDATE_OUTPUT'
EXPORTING
INPUT = SY-DATUM
IMPORTING
OUTPUT = V_MONTH.
WRITE:/ 'CURRENT MONTH IN WORDS:', V_MONTH+3(8).
Thanks,
Reward If Helpful.
10-16-2007 10:29 AM
Hi,
Refer to the following code:
FORM set_text_date.
DATA: month(9),
year(4),
date(2).
CASE p_frd+4(2).
WHEN '01'.
month = 'January'.
WHEN '02'.
month = 'February'.
WHEN '03'.
month = 'March'.
WHEN '04'.
month = 'April'.
WHEN '05'.
month = 'May'.
WHEN '06'.
month = 'June'.
WHEN '07'.
month = 'July'.
WHEN '08'.
month = 'August'.
WHEN '09'.
month = 'September'.
WHEN '10'.
month = 'October'.
WHEN '11'.
month = 'November'.
WHEN '12'.
month = 'December'.
WHEN OTHERS.
ENDCASE.
WRITE p_frd+0(4) TO year.
WRITE p_frd+6(2) TO date.
CONCATENATE month date ',' year INTO return_date SEPARATED BY space.
CONDENSE return_date.
ENDFORM.
Hope this helps.
Reward if helpful.
Regards,
Sipra
10-16-2007 10:29 AM
10-16-2007 10:30 AM
case date+3(02).
when '01'. month = '-JAN'.
when....
endcase.
concatenate date0(02) month date6(04) into date in character mode.
10-16-2007 10:31 AM
10-16-2007 10:31 AM
10-16-2007 10:32 AM
10-16-2007 10:32 AM
Look at the Function modules CONVERT_DATE_TO_INTERNAL or CONVERT_DATE_TO_EXTERNAL.
If the aboe are not useful, then you need to do it manually. just take date, Month and year in 3 fields and concatenate the same into another date field with the correct format.
Eg2:
data: v_date(8) type c.
call function 'CONVERT_DATE_TO_INTERNAL'
exporting
date_external = '12.12.2006'
importing
date_internal = v_date.
write:/ v_date.
Reward points..
10-16-2007 10:42 AM
10-16-2007 10:33 AM
hi dev,
use this conversion exit......
<b>CONVERSION_EXIT_IDATE_OUTPUT</b>
Example
DATA: INT_DATUM LIKE SY-DATUM VALUE '19940102',
EXT_DATUM(11) TYPE C.
...
<b>CALL FUNCTION 'CONVERSION_EXIT_IDATE_OUTPUT'
EXPORTING
INPUT = INT_DATUM
IMPORTING
OUTPUT = EXT_DATUM.</b>
Result:
<b>
EXT_DATUM = 02JAN1994</b>
i hope this is what u required........
reward me if useful....
Harimanjesh AN
10-16-2007 10:35 AM
please see the function modules
CONVERSION_EXIT_IDATE_INPUT
CONVERSION_EXIT_IDATE_OUTPUT
10-16-2007 10:39 AM
hi,
Use the fun module
DATE_TO_DAY to get the description of the DAY for that date
Use the fun Module
IDWT_READ_MONTH_TEXT to get the MONTH Text
regards
siva