2006 Feb 16 8:36 AM
Hi,
I required to display the date in the format
yyyymmdd.
But my internal table is getting populated with the
date format dd.mm.yyyy.
Please let me know how to proceed.
Thanks in Advance
Irfan Hussain
Hi,
I required to display the date in the format
yyyymmdd.
But my internal table is getting populated with the
date format dd.mm.yyyy.
Please let me know how to proceed.
Thanks in Advance
Irfan Hussain
2006 Feb 16 8:41 AM
2006 Feb 16 8:41 AM
data w_date(8) type c.
Say the date is in sy-datum and that needs to be picked up...
w_date = sy-datum.
write w_date...
output will be in yyyymmdd.
2006 Feb 16 8:42 AM
Hi irfan,
1. We can apply logic also.
using OFFSET concept.
2. this logic (just copy paste in new program)
REPORT abc LINE-SIZE 1023..
DATA : s(10) TYPE c.
DATA : d TYPE sy-datum.
s = '10.05.2006'.
CONCATENATE s6(4) s3(2) s(2) INTO d.
WRITE 😕 d.
regards,
amit m.
2006 Feb 16 8:46 AM
Hi Irfan,
You pass your internal table date format dd.mm.yyyy to Function module CONVERT_DATE_TO_INTERNAL
to get the date format as yyyymmdd.
Hope this will help you.
Please award points, if you find my answer fruitful.
Regards,
Kapil
2006 Feb 16 8:58 AM
try using edit mask .
in the write statement to the internal table.
2006 Feb 16 9:12 AM
Hi Irfan,
U can wirte it by using "EDIT MASK" by using it in "WRITE TO" statement.
WRITE SY-DATUM TO TEMP USING EDIT MASK "__:__:____"
U can mention ur format in the double codes.
To change 20040924
to 24.09.2004 format.
Try FM 'CONVERT_DATE_TO_EXTERNAL'
Best Regards,
Anjali
2006 Feb 16 9:25 AM
irfan,
use this code okay ..
data: var(10).
write:/ sy-datum.
var = sy-datum.
write (10) var using edit mask '____:__:__'.
this will solve ur problem ,
u can try with fm also .
2006 Feb 16 9:45 AM
Hi,
Presntly I am doing a function module ,
This table has to be displayed to the user with the date form mm.dd.yyyy.
actualy during debugging i observd that the date is fetched from the database in the format yyyymmdd,
but in the output it is displayed as dd.mm.yyyy. due to system settigns.
But i want to make appear as dd.mm.yyyy.
Please help me out.
Thanks in Advance
Irfan Hussain
2006 Feb 16 9:50 AM
2006 Feb 16 9:51 AM
Hi
The output format depends on user default parameters: here the user can set the format date.
Max
2006 Feb 16 9:55 AM
HI
you can implement your own logic
data: dat(10) type c.
dat = '10.02.2006'.
concatenate dat3(3) dat0(3) dat+6(4) into dat.
write dat.
regards
kishore
2006 Feb 16 10:02 AM
Hi,
While pciking form the database it is picking as yyyyddmm, but while displaying it is displaying as
dd.mm.yyyy.
This is the system setting i do agree with it.
but the fields in the database are defined as dats,
so as per the system setting the output is reflected.
But I want to display as yyyymmdd in it's original format.
Thanks in Advance,
Irfan Hussain
2006 Feb 16 10:04 AM
let me re-phrase the question
you want the date in the internal table to be displayed as
dd.mm.yyyy?
if yes then declare one more field in your internal table as
date(10) type c.
now after selecting the data from the database into the internal table ( itab ), loop the internal table and
do this
write itab-databasedatefield(YYYYMMDD) to itab-date dd.mm.yyyy.
Now in the internal table itab , date field will have your date as dd.mm.yyyy.
if this is the solution, please close the topic.
2006 Feb 16 10:47 AM
Hi Irfan,
you can go to <b>System -> User profile -> Own Data.</b>there, when you click the defaults tab , you can see the various date options. From that , you can choose the desired formating option.
Formatting options for date fields are :
<b>DD/MM/YY</b>
<b>MM/DD/YY</b>
<b>DD/MM/YYYY</b>
<b>MM/DD/YYYY</b>
<b>DDMMYY</b>
<b>MMDDYY</b>
<b>YYMMDD</b>
Note : separtaors wherever mentioned are as in the user's master record.
<b>* Test program after making the change.
REPORT ZKUN_TEST .
WRITE: sy-datum. " sy-datum is the system field.
</b>
output :
02/06/2006
Hope it solves your problem.
In case of doubt , feel free to mail me.
thnaks and regards,
kunal
2006 Feb 16 9:43 AM
Mr Irfan, Would please take time to reward the points and close the topic;If your issue has been resolved.
You have 6 replies conveying the same solution.
2006 Feb 16 10:18 AM
Hello Irfan,
Check whether call functions help you in any way...
This link gives you some idea in Date and time section..
http://www.geocities.com/victorav15/sapr3/abapfun.html
Regards,
Srikanth
2006 Feb 16 11:12 AM
this is an exmple showing the date being displayed in *yyyymmdd format.
<b>REPORT ZKUN_TEST .
data : a type string.
a = sy-datum.
WRITE: sy-datum .
skip.
write : / a.</b>
<u><b>output:</b></u>
02/16/2006
20060216
if you feel its correct , do reward with points.
thanks and regards,
kunal.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |