2006 Jul 24 8:23 AM
Hi,
I had character variable which gets date from the system field SY-DATUM. I am using this variable to insert into a mail body. But when I insert into a mail body it is displaying as '20060722'. But I want it in MM/DD/YYYY format. How can I format it? Please help me out.
Thanking you in advance.
Regards,
Eswar
2006 Jul 24 8:25 AM
Hi eswar,
1. define a character variable of 10 length
2. use like this
3. write sy-datum to myvar.
(it will write date in the proper format
in side the variable myvar.)
4. now use this MYVAR variable.
regards,
amit m.
Hello,
Whenever you pass the value from the sy-datum to 10 char field do like this,
data: l_date(10).
write : sy-datum to l_date dd/mm/yyyy.
regards,
Naimesh
2006 Jul 24 8:25 AM
Hi eswar,
1. define a character variable of 10 length
2. use like this
3. write sy-datum to myvar.
(it will write date in the proper format
in side the variable myvar.)
4. now use this MYVAR variable.
regards,
amit m.
2006 Jul 24 8:26 AM
hi,
do manually.
data: str(12).
concatenate sy-datum(4)
'/' sy-datum+4(2)
'/' sy-datum+6(2) into str.
and put str into your string email body.
<u><b>addition:</b></u> or using function
CALL FUNCTION 'CONVERSION_EXIT_PDATE_OUTPUT'
EXPORTING
INPUT = sy-datum
IMPORTING
OUTPUT = str.
regards,
sandi
Message was edited by: Sandi Wijaya
2006 Jul 24 8:28 AM
Hi Eswar,
Use Offset to Split the Date into Year Month and Date in seperate Variable and then you can Concatenate into the Target Variable as you require.
MM/DD/YYYY or DD/MM/YYYY etc.,
Hope this might help you.
Cheers,
Prashanth
2006 Jul 24 8:30 AM
Hello,
Whenever you pass the value from the sy-datum to 10 char field do like this,
data: l_date(10).
write : sy-datum to l_date dd/mm/yyyy.
regards,
Naimesh
2006 Jul 24 8:57 AM
<b>1)
HRGPBS_HESA_DATE_FORMAT</b>
Format a date valid for HESA: DD/MM/YYYY
data:date_form type CHAR10.
call function 'HRGPBS_HESA_DATE_FORMAT'
exporting
P_DATE = sy-datum
importing
DATESTRING = date_form
exceptions
others = 1.
write : date_form.
<b>2)</b>Say suppose your date is date1(of the format yyyyymmdd) and date2(of the format mm/dd/yyyy)
declare variables w_year(4) type c
w_month(2) type c
w_date(2) type c
date2(10) type c.
w_year = date1+1(4).
w_month = date1+4(2).
w_date = date1+6(2).
concatenate w_month w_date w_year into w_date2 separated by '/'.
2006 Jul 24 9:05 AM
Hi Eswar,
Please try this :-
<b>
*Declare a variable of type C and length 10.</b>
DATA : v_date(10) TYPE c.
<b>
*Write the system date to it using add. 'MM/DD/YYYY'</b>
WRITE sy-datum TO v_date MM/DD/YYYY.
WRITE v_date.
Hope this helps you.
Regards,
Anirban.
2006 Jul 24 9:08 AM
Hi,
Use this Function Module!!!
CONVERT_DATE_TO_EXTERNAL
Hope this helps u.
Regards,
Seema.
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |