Date format in CSV file not coming as required

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.

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

Similar Messages

  • Saving chosen date format in csv-file

    I format all cells in one column to a dateformat dd-mmm-yy
    i.e. 01-jan-06, works fine I have all the dates in the year by clicking on first cell.
    BUT I can not SAVE the file as csv keeping the format - it is saved as 01-01-2006, which I can not use.
    I do this in Excel all the time - do I have to do something special in Staroffice Calc 8.0 ?

    A similar issue faced here trying to save a worksheet (Staroffice Version 8) in .csv format. The worksheet had one column for date of birth formatted as "dd/mm/yyyy" and another one for age using formula "=TODAY()-B6", formatted as "yy". In the corresponding .csv file the age column showed up as "dd/mm/yyyy" as against the required "yy" format . On saving the data in text file with the space delimited option, the date of birth column showed up in the "mm/dd/yyy" format - the age column however was in the desired "yy" format.
    Here is a workaround though;
    On your existing staroffice worksheet format all the data just as would like it appear in the .csv file. The trick is to transfer the data into an intermediate application that does not understand the underlying formatting or formula, which in our case will be notepad. Copy the entire range of data from your staroffice worksheet into notepad. Minimise notepad after the data has been pasted. Save and exit the existing staroffice workbook. Open a new workbook, select the entire range that is going to hold the data and then format the cells as "text". Now, maximise notepad, select all the data using the edit menu and copy it into the new worksheet. The data should appear just as it was in the original worksheet, but without any formatting or formula. You can now proceed to save the data in a .csv file without having to worry about changed date formats.
    However, if you have come across some other method through which this issue has been resolved, please post here or drop me a a mail
    anandkumarvj [at] rediffmail.com

  • Date format in CSV file

    Hello,
    I am working on loading program which downloads the application server CSV file to internal table.
    In the CSV file there is a field date in the format (22/05/2008). When I move this to my internal table field date, it is truncating to '22/05/20'. How to solve this issue.
    Can I load into internal table with the same format?
    Please help me.
    Thanks,
    Shreekant

    Hi, Rangrej
    As all Suggested assign first this date to char type filed length 10 and using following way you can assign this to type date.
    Test Sample Code Bellow.
    TYPES: BEGIN OF ty_test,
      cdate(10),
      date LIKE sy-datum,
      END OF ty_test.
    DATA: it_test TYPE STANDARD TABLE OF ty_test WITH HEADER LINE.
    it_test-cdate = '22/05/2008'. APPEND it_test.
    it_test-cdate = '23/05/2008'. APPEND it_test.
    it_test-cdate = '24/05/2008'. APPEND it_test.
    it_test-cdate = '25/05/2008'. APPEND it_test.
    it_test-cdate = '26/05/2008'. APPEND it_test.
    LOOP AT it_test.
      it_test-date+0(4) = it_test-cdate+6(4).
      it_test-date+4(2) = it_test-cdate+3(2).
      it_test-date+6(2) = it_test-cdate+0(2).
      MODIFY it_test INDEX sy-tabix.
    ENDLOOP.
    Best Regards,
    Faisal

  • Need to Download Smartform Data from OTF format to CSV file

    Hi,
      I need to download smartform data from OTF format to CSV file. Is there any Function module to download Smartform data from
      OTF format to CSV file.
    Regards,
    Selvapriya S.

    Not that I know of.  There is a lot of data in the OTF file besides the field values you are printing (formats, headers. positions, fonts, etc).
    You might be able to use the CONVERT_OTF function module and take the default format of 'ASCII'.  Once it is converted to an ASCII data format, you might be able to write some ABAP code to strip off the extraneous data and parse the fields you need.

  • How can we export table data to a CSV file??

    Hi,
    I have the following requirement. Initially business agreed upon, exporting the table data to Excel file. But now, they would like to export the table data to a CSV file, which is not being supported by af:exportCollectionActionListener component.
    Because, when i opened the exported CSV file, i can see the exported data sorrounded with HTML tags. Hence the issue.
    Does someone has any solution for this ... Like, how can we export the table data to csv format. And it should work similar to exporting the data to excel sheet.
    For youre reference here is the code which i have used to export the table data..
    ><f:facet name="menus">
    ><af:menu text="Menu" id="m1">
    ><af:commandMenuItem text="Print" id="cmi1">
    ><af:exportCollectionActionListener exportedId="t1"
    >title="CommunicationDistributionList"
    >filename="CommunicationDistributionList"
    >type="excelHTML"/> ---- I tried with removing value for this attribute. With no value, it did not worked at all.
    ></af:commandMenuItem>
    ></af:menu>
    ></f:facet>
    Thanks & Regards,
    Kiran Konjeti

    Hi Alex,
    I have already visited that POST and it works only in 10g. Not in 11g.
    I got the solution for this. The solution is :
    Use the following code in jsff
    ==================
    <af:commandButton text="Export Data" id="ctb1">><af:fileDownloadActionListener contentType="text/csv; charset=utf-8"
    >filename="test.csv"
    >method="#{pageFlowScope.pageFlowScopeDemoAppMB.test}"/>
    ></af:commandButton>
    OR
    <af:commandButton text="Export Data" id="ctb1">><af:fileDownloadActionListener contentType="application/vnd.ms-excel; charset=utf-8"
    >filename="test.csv"
    >method="#{pageFlowScope.pageFlowScopeDemoAppMB.test}"/>
    ></af:commandButton>
    And place this code in ManagedBean
    ======================
    > public void test(FacesContext facesContext, OutputStream outputStream) throws IOException {
    > DCBindingContainer dcBindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    >DCIteratorBinding itrBinding = (DCIteratorBinding)dcBindings.get("fetchDataIterator");
    >tableRows = itrBinding.getAllRowsInRange();
    preparaing column headers
    >PrintWriter out = new PrintWriter(outputStream);
    >out.print(" ID");
    >out.print(",");
    >out.print("Name");
    >out.print(",");
    >out.print("Designation");
    >out.print(",");
    >out.print("Salary");
    >out.println();
    preparing column data
    > for(Row row : tableRows){
    >DCDataRow dataRow = (DCDataRow)row;
    > DataLoaderDTO dto = (DataLoaderDTO)dataRow.getDataProvider();
    >out.print(dto.getId());
    >out.print(",");
    >out.print(dto.getName());
    >out.print(",");
    >out.print(dto.getDesgntn());
    >out.print(",");
    >out.print(dto.getSalary());
    >out.println();
    >}
    >out.flush();
    >out.close();
    > }
    And do the following settings(*OPTIONAL*) for your browser - Only in case, if the file is being blocked by IE
    ==================================================================
    http://ais-ss.usc.edu/helpdoc/main/browser/bris004b.html
    This resolves implementation of exporting table data to CSV file in 11g.
    Thanks & Regards,
    Kiran Konjeti

  • Comparing SQL Data Results with CSV file contents

    I have the following scenario that I need to resolve and I'm unsure of how to approach it. Let me explain what I am needing and what I have currently done.
    I've created an application that automatically marks assessments that delegates complete by comparing SQL Data to CSV file data. I'm using C# to build the objects required that will load the data from SQL into a dataset which is then compared to the
    associated CSV file that contains the required results to mark against.
    Currently everything is working as expected but I've noticed that if there is a difference in the number of rows returned into the SQL-based dataset, then my application doesn't mark the items at all.
    Here is an example:
    ScenarioCSV contains 4 rows with 8 columns of information, however, let's say that the delegate was only able to insert 2 rows of data into the dataset. When this happens it marks everything wrong because row 1 in both CSV and dataset files were correct,
    however, row 2 in the dataset holds the results found in row 4 in the CSV file and because of this it is comparing it against row 2 in the CSV file.
    How can I check whether a row, regardless of its order, can be marked as it does exist but not in the same order, so I don't want the delegate to lose marks just because the row data in the dataset is not perfectly in the same order of the row data
    in the CSV file???
    I'm at a loss and any assistance will be of huge help to me. I have implemented a ORDER BY clause in the dataset and ensured that the same order is set in the CSV file. This has helped me for scenarios where there are the right number of rows in the dataset,
    but as soon as there is 1 row that is missing in the dataset, then the marking just doesn't allow for any marks for both rows even if the data is correct.
    I hope I've made sense!! If not, let me know and I will provide a better description and perhaps examples of the dataset data and the csv data that is being compared.
    Thanks in advance....

    I would read the CSV into a datatable using oledb. Below is code I wrote a few weeks ago to do this.
    Then you can compare two datatables by a common primary key (like ID number)
    Below is the webpage to compare two datatables
    http://stackoverflow.com/questions/10984453/compare-two-datatables-for-differences-in-c
    You can find lots of examples by perform following google search
    "c# linq compare two dattatable"
    //Creates a CSVReader Class
    public class CSVReader
    public DataSet ReadCSVFile(string fullPath, bool headerRow)
    string path = fullPath.Substring(0, fullPath.LastIndexOf("\\") + 1);
    string filename = fullPath.Substring(fullPath.LastIndexOf("\\") + 1);
    DataSet ds = new DataSet();
    try
    if (File.Exists(fullPath))
    string ConStr = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}" + ";Extended Properties=\"Text;HDR={1};FMT=Delimited\\\"", path, headerRow ? "Yes" : "No");
    string SQL = string.Format("SELECT * FROM {0}", filename);
    OleDbDataAdapter adapter = new OleDbDataAdapter(SQL, ConStr);
    adapter.Fill(ds, "TextFile");
    ds.Tables[0].TableName = "Table1";
    foreach (DataColumn col in ds.Tables["Table1"].Columns)
    col.ColumnName = col.ColumnName.Replace(" ", "_");
    catch (Exception ex)
    MessageBox.Show(ex.Message);
    return ds;
    jdweng

  • Data Migration from CSV file to Database Table.

    Hi,
    I have checked few answered threads on Data Migration Issues but didn't find the solution yet.
    I am reading data from an CSV file to internal table but the complete row is coming under one field of the internal table.
    How i can get values in different fields of the internal table from the CSV file ?
    Thanks & Regards.
    Raman Khurana.

    Hi,
    If you are using GUI_UPLOAD, you might have missed to make has_field_separator  as 'X'.
      EXPORTING
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
       filename                      = 'C:\File.csv'
       filetype                      = 'ASC'
       has_field_separator           = ' X'  "<= Set this as 'X'.
      TABLES
        data_tab                      = itab.
    Regards,
    Manoj Kumar P

  • How can I import data from a csv file into databse using utl_file?

    Hi,
    I have two machines (os is windows and database is oracle 10g) that are not connected to each other and both are having the same database schema but data is all different.
    Now on one machine, I want to take dump of all the tables into csv files. e.g. if my table name is test then the exported file is test.csv and if the table name is sample then csv file name is sample.csv and so on.
    Now I want to import the data from these csv files into the tables on second machine. if I've 50 such csv files, then data should be written to 50 tables.
    I am new to this. Could anyone please let me know how can I import data back into tables. i can't use sqlloader as I've to satisfy a few conditions while loading the data into tables. I am stuck and not able to proceed.
    Please let me know how can I do this.
    Thanks,
    Shilpi

    Why you want to export into .csv file.Why not export/import? What is your oracle version?
    Read http://www.oracle-base.com/articles/10g/oracle-data-pump-10g.php
    Regards
    Biju

  • Date format in flat file is MM/DD/YYYY

    I want to to change date format in flat file from MM/DD/YYYY to in info cube YYYYMMDD.
    What is the step by step procedure to do this.

    Hi,
    The date format should be YYYYMMDD in flat file.
    IF the date format is not the above mentioned way, then you can change setting.
    Going to System in Menu
    System->User Profile->Own data.
    Under Owndata you can change the date format to your requirement.
    Check the below link also for detain info of coding:
    Mandatory for Date field
    regards
    shoba

  • I need to import data from a CSV file to an Oracle table

    I need to import data from a CSV file to an Oracle table. I'd prefer to use either SQL Developer or SQL Plus code.
    As an example, my target database is HH910TS2, server is ADDb0001, my dB login is em/em, the Oracle table is AE1 and the CSV file is AECSV.
    Any ideas / help ?

    And just for clarity, it's good to get your head around some basic concepts...
    user635625 wrote:
    I need to import data from a CSV file to an Oracle table. I'd prefer to use either SQL Developer or SQL Plus code.SQL Developer is a GUI front end that submits code to the database and displays the results. It does not have any code of it's own (although it may have some "commands" that are SQL Developer specific)
    SQL*Plus is another front end (character based rather than GUI) that submits code to the database and displays the results. It also does not have code of it's own although there are SQL*Plus commands for use only in the SQL*Plus environment.
    The "code" that you are referring to is either SQL or PL/SQL, so you shouldn't limit yourself to thinking it has to be for SQL Developer or SQL*Plus. There are many front end tools that can all deal with the same SQL and/or PL/SQL code. Focus on the SQL and/or PL/SQL side of your coding and don't concern yourself with limitations of what tool you are using. We often see people on here who don't recognise these differences and then ask why their code isn't working when they've put SQL*Plus commands inside their PL/SQL code. ;)

  • Need help in loading data from a csv file to a table in Oracle DB

    Hi,
    I am using sqlplus as a client to connect to the server.
    I am trying to load data from a csv file from a client to a table in Oracle DB server.
    I am trying to use the below command
    " LOAD DATA INFILE 'test.csv' INTO TABLE testTable FIELDS TERMINATED BY ',' (test1,test2,testc3,testc4); "
    But, I am encountered with the following error
    "SP2-0042: unknown command "load data" - rest of line ignored."
    Thanks in advance.
    SB

    Hey Frostmann,
    That was a nice post....
    I changed my mind to use an 'Insert into' statement from a shell script.
    I created a DB table named test and I tried using the below shell script to insert a row in the table.
    sqlplus test/test@test <<ENDOFSQL
    INSERT INTO test VALUES('test1',123,'test2','test3');
    exit
    ENDOFSQL
    A row is succesfully inserted into the table when I run the script manually, but it does not insert rows when a cron job is scheduled.
    Could you please help me with this?
    Thanks in advance.
    SB

  • Data Filter on CSV file using Data Synchronization

    gOT error When i used Data Filter on CSV file in Data Synchronization task, Filter condition : BILLINGSTATE LIKE 'CA'
    TE_7002 Transformation stopped due to a fatal  error in the mapping. The expression [(BILLINGSTATE LIKE 'CA')] contains  the following errors [<<PM Parse Error>> missing operator  ... (BILLINGSTATE>>>> <<<<LIKE 'CA')].

    Hi,
    Yes,This can be done through BEx Broadcaster.
    Please follow the below stes...
    1.Open your query in BEx Analyzer
    2.Go to BEx Analysis Toolbar->Tools->BEx Broadcaster...
    3.Click "Create New Settings"->Select the "Distribution Type" as "Broadcast Email" and "Output Format"  as "CSV"
    4.Enter the Recipients Email Address under "Recipients" tab
    5.Enter the Subject and Body of the mail under "Texts" tab
    6.Save the Setting and Execute it.
    Now the Query data will be attached as a CSV file and sent to the recipents through Email.
    Hope this helps you.
    Rgds,
    Murali

  • HT2486 how can I export the contact book data to a csv file for editing?

    how can I export the contact book data to a csv file for editing?

    You can edit a card right in Contacts. No need to export and re-import.
    Select a name and on the right side, click the Edit button:

  • Format of CSV file generated through iBot

    What is the default format of csv file generated through iBot (UNICODE / UTF) ?
    How can we configure a single iBot to generate CSVs, for example, in UTF format instead of UNICODE (assuming UNICODE is default).
    -Jimit

    Use this
    https://support.oracle.com/epmos/faces/ui/km/SearchDocDisplay.jspx?_afrLoop=324436281886916&type=DOCUMENT&id=1459947.1&displayIndex=1&_afrWindowMode=0&_adf.ctrl-state=130oxyc5cv_71
    Content:
    Goal
    Currently the CSV format in Agents always delivers the report results in tab delimited CSV. Is there a setting that can make the report result in a comma delimited CSV format when the reports are setup via Agents/iBots?
    Fix
    There is no setting that would make CSV output from an iBot be comma delimited as opposed to the tab delimited output from the web UI.
    There is an enhancement request for this functionality. for more information, see bug 13802667 - COMMA DELIMITED CSV FORMAT FOR AGENTS/IBOTS has been logged to include this feature in future release.
    As a work-around, you can to run a custom script from an Agent to convert tabs to commas. See chapter 4 (http://docs.oracle.com/cd/E21764_01/doc.1111/e18562/schedjobscripts.htm#BABGFBBD) of Oracle® Fusion Middleware Scheduling Jobs Guide for Oracle Business Intelligence Enterprise Edition 11g Release 1 (11.1.1) Part Number E18562-01 for more information on writing custom scripts.
    If helps pls mark

  • Import data from excel/csv file in web dynpro

    Hi All,
    I need to populate a WD table by first importing a excel/CSV file thru web dynpro screen and then reading thru the file.Am using FileUpload element from NW04s.
    How can I read/import data from excel / csv file in web dynpro table context?
    Any help is appreciated.
    Thanks a lot
    Aakash

    Hi,
    Here are the basic steps needed to read data from excel spreadsheet using the Java Excel API(jExcel API).
    jExcel API can read a spreadsheet from a file stored on the local file system or from some input stream, ideally the following should be the steps while reading:
    Create a workbook from a file on the local file system, as illustrated in the following code fragment:
              import java.io.File;
              import java.util.Date;
              import jxl.*;
             Workbook workbook = Workbook.getWorkbook(new File("test.xls"));
    On getting access to the worksheet, once can use the following code piece to access  individual sheets. These are zero indexed - the first sheet being 0, the  second sheet being 1, and so on. (You can also use the API to retrieve a sheet by name).
              Sheet sheet = workbook.getSheet(0);
    After getting the sheet, you can retrieve the cell's contents as a string by using the convenience method getContents(). In the example code below, A1 is a text cell, B2 is numerical value and C2 is a date. The contents of these cells may be accessed as follows
    Cell a1 = sheet.getCell(0,0);
    Cell b2 = sheet.getCell(1,1);
    Cell c2 = sheet.getCell(2,1);
    String a1 = a1.getContents();
    String b2 = b2.getContents();
    String c2 = c2.getContents();
    // perform operations on strings
    However in case we need to access the cell's contents as the exact data type ie. as a numerical value or as a date, then the retrieved Cell must be cast to the correct type and the appropriate methods called. The code piece given below illustrates how JExcelApi may be used to retrieve a genuine java double and java.util.Date object from an Excel spreadsheet. For completeness the label is also cast to it's correct type. The code snippet also illustrates how to verify that cell is of the expected type - this can be useful when performing validations on the spreadsheet for presence of correct datatypes in the spreadsheet.
      String a1 = null;
      Double b2 = 0;
      Date c2 = null;
                        Cell a1 = sheet.getCell(0,0);
                        Cell b2 = sheet.getCell(1,1);
                        Cell c2 = sheet.getCell(2,1);
                        if (a1.getType() == CellType.LABEL)
                           LabelCell lc = (LabelCell) a1;
                           stringa1 = lc.getString();
                         if (b2.getType() == CellType.NUMBER)
                           NumberCell nc = (NumberCell) b2;
                           numberb2 = nc.getValue();
                          if (c2.getType() == CellType.DATE)
                            DateCell dc = (DateCell) c2;
                            datec2 = dc.getDate();
                           // operate on dates and doubles
    It is recommended to, use the close()  method (as in the code piece below)   when you are done with processing all the cells.This frees up any allocated memory used when reading spreadsheets and is particularly important when reading large spreadsheets.              
              // Finished - close the workbook and free up memory
              workbook.close();
    The API class files are availble in the 'jxl.jar', which is available for download.
    Regards
    Raghu

Maybe you are looking for

  • Final Cut Studio 2 installation

    Upon installing Final Cut Studio 2 upgrade my harddrive crashed. I thought I had more room than I actually did. I just got a new hard drive and I want to install final cut studio 2 again. Do I have to reinstall all of my final cut studio 1 discs and

  • Error while doing BDC

    Hi, I am doing a bdc program on t.code MIR4 (Display invoice screen).The problem is this screen has a SGA/GPA set so that whenever you into this transaction the last entered value is shown in the first screen. While doing BDC i deleted the old invoic

  • Restrict the value choice of a attribut in xml schema

    how can i restrict an attribute value to a list of value, instead of one value by "fixed" key word? something like "option" key word in html? thanks

  • Can I add characters in text mode?

    I want to add characters - Upper case and lower case (alphabetical) with say, an accent or umlaut. These are commonly available from Windows programs but I can't seem to add them to captions for my photos in Elements 11. I can't believe this would no

  • Could not load Internet Accounts preference, iCloud pane and Mail application

    Hello I have 3 problem. Could not load Internet Accounts preference pane. Could not load iCloud preference pane. I also can't open the Mail application. I already tried to log in as guest user, I can open everything in guest user. So guest user have