2005 Aug 05 10:11 AM
the issues is that while entering in the screen, the data is in the format
mm/dd/yyyy
and when it gets displayed it changes to
yyyymmdd.
I want the same format as i am giving on the screen.
mm/dd/yyyy.
please help.
2005 Aug 05 10:19 AM
2005 Aug 05 10:24 AM
2005 Aug 05 10:33 AM
Here is the example for EDIT MASK
Formatted output of the DATE:
DATA DATE LIKE ....
WRITE (10) DATE USING EDIT MASK '__/__/____'.
Kindly reward points and close the thread if ur problem got solned.
Message was edited by: Judith Jessie Selvi
2005 Aug 05 10:27 AM
Hi,
U can change before Outputing.
Just try this
DATA: lv_date LIKE datewhich u want.
IF date = 20040318
<b>CONCATENATE date+4(2) '/' date+6(2) '/' date+0(4) into lv_date.</b>
If u want to change the value in the loop then
LOOP at i_output into w_output.
CONCATENATE date+4(2) '/' date+6(2) '/' date+0(4) into w_output-date .
Modify w_output into i_output.
ENDLOOP.
It will solve ur probelm.
Hope it helps.
2005 Aug 05 10:34 AM
Try this :
WRITE w_date TO w_date_formatted MM/DD/YYYY.
Hope this helps,
Erwan.
2005 Aug 05 10:34 AM
2005 Aug 05 10:34 AM
2005 Aug 05 10:37 AM
2005 Aug 05 11:18 AM
Hi,
Use the FM: CONVERT_DATE_TO_EXTERNAL to change 20050805
to 05.08.2005 format.
WRITE SY-DATUM TO TEMP USING EDIT MASK "__/__/____"
Specify ur required format in the double codes
Regards,
Anjali
2005 Aug 05 11:46 AM
svetlin answers is correct u can try for that i dont know ther remaining user answers.
2005 Aug 05 6:48 PM
Hi,
Well, In case if input ( i guess you are talking about selection screen input ) is coming as mm/dd/yyyy then output shopuld also come as mm/dd/yyyy without any special formatting as it is handled in user setting.
Are you assigning the date to another variable using '='. like date1 = date. and write date1.
In that case try to use WRITE DATE TO DATE1. Instead of directly assigning the date to var.
WRITE DATE1.
ex :
REPORT test.
Data :
date1(10),
date2(10).
parameters : date like sy-datum.
date1 = date.
write date to date2.
write date1.
write date.
write date2.
In above example if i/p date = 08/05/2005
date1 will be written as 20050805
and date as 08/05/2005
and date2 as 08/05/2005
regards,
Gagan
2005 Aug 05 7:16 PM
Seems like everyone has given you a valid answer. But what really is the question. How are you entering your data, in what kind of screen, selection-screen or dynpro. How are you displaying this date, selection-screen or dynpro. How is your field typed, TYPE SY-DATUM? Need more infomation to give you an answer.
Regards,
Rich Heilman
2005 Aug 05 7:20 PM
For example, take the following program. Notice that the first date field is of type sy-datum which has conversion routine against it. Inside the program it is really in YYYYMMDD format. If you would move this data from that field into a character 10 field, the data in that field would be YYYYMMDD. If you change the P_DAT field to be of TYPE SY-DATUM. Then the conversion routine is in effect and hence will be displayed as MM/DD/YYYY.
report zrich_0002 .
parameters: p_datum type sy-datum,
p_dat(10) type c.
at selection-screen output.
p_dat = p_datum.
So lets say that this is your problem, I would suggest to take advantage of the conversion routine provide when using the TYPE sy-datum.
Regards,
Rich Heilman