Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Date format in CSV file not coming as required

Former Member
0 Kudos

Hi,

I have a problem in date format after it is downloaded as a CSV file. In CSV file it is coming as 2/6/2009

but the format i required is 2009/02/06. Im using GUI_UPLOAD FM for file download. In the internal table im having the date in this format YYYY/MM/DD only.

How can i bring the date in CSV file in required format?

Thanks in advance,

Srilakshmi.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hai Frnd,

I got same previously.

I changed the settings -


> control panel -


> regional settings . In Regional settings ---> click customize. in customize ---> changes date settings as u like in dates tab. If worked inform me.

Kiran..

5 REPLIES 5

Former Member
0 Kudos

hi,

from program goto system>user profile> own data you will be taken to the maintain user profile screen in there goto default tab and give the date format. if this wont work then change the data type of your date to text and convert it to the format your reqired.

thanks,

anupama.

Former Member
0 Kudos

take a final internal table itb_final similar to your internal table(which needs to down load ) but in the new internal table you need to give the reference to the date field as char10

and transfer your itab data into final internal table

and pass final internal table to gui_down load

0 Kudos

The length of date in my internal table is 10. i have tried changing the user settings also. it is not working. any other solutions please ?

Former Member
0 Kudos

Hai Frnd,

I got same previously.

I changed the settings -


> control panel -


> regional settings . In Regional settings ---> click customize. in customize ---> changes date settings as u like in dates tab. If worked inform me.

Kiran..

Former Member
0 Kudos

Hi Srilashmi,

You question really made me wear thinking cap.

When you populate date in SAP system, it's taken in internal format i.e YYYYMMDD, though you declare date field as DATE, D or SY-DATUM, the issue comes into light, when you got to display it.

1. Import date in internal format i.e. YYYYMMDD,

DATA:

w_date type d.

2. Declare another variable w_date1(10) like C.

3. Goto System-> User Profile -> Own Data -> Defaults -> Date Format. Now, whatever date you have set, it's gonna take the same format.

4. WRITE W_DATE TO W_DATE1, transport imported date to char type w_date1, this makes date appear in format you want it to .

And regarding, saving in CSV format, not always GUI_UPLOAD or GUI_DOWNLOAD works,

TEXT _ CONVERT _ XLS_TO_SAP -> From program to excel sheet

ALSM_EXCEL_TO_INTERNAL_TABLE -> Excel sheet to Program

Hope this helps you.

Thanks: Zahack