CSV file issue

i need to write internal table data into a CSV file and then put CSV file into application server and then my infopackage will read from the application server. Now i have my data in the internal table i have to write those records to a CSV file in the application server. I checked if there are any Function modules to convert internal table to .CSV file. The function module "sap_convert_to_csv_format" is not available in SAP BI server any other alternatives available.
The code that i used to create the file in application server is given below, please let me know if its fine.
REPORT Z_SAP_CONVERT_TO_CSV_FORMAT.
DATA : BEGIN OF XX,
NODE_ID TYPE N LENGTH 8,
INFOOBJECT TYPE C LENGTH 30,
NODENAME TYPE C LENGTH 60,
PARENT_ID TYPE N LENGTH 8,
END OF XX.
DATA : I_TAB LIKE STANDARD TABLE OF XX.
DATA: FILE_NAME TYPE RLGRAP-FILENAME.
FILE_NAME = './temp.CSV'.
OPEN DATASET FILE_NAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = '5'
IMPORTING
OUTPUT = XX-NODE_ID.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = 'ZEMP_H'
IMPORTING
OUTPUT = XX-INFOOBJECT.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = '5'
IMPORTING
OUTPUT = XX-NODENAME.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = '1'
IMPORTING
OUTPUT = XX-PARENT_ID.
APPEND XX TO I_TAB.
CLEAR XX.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = '6'
IMPORTING
OUTPUT = XX-NODE_ID.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = 'ZEMP_H'
IMPORTING
OUTPUT = XX-INFOOBJECT.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = '6'
IMPORTING
OUTPUT = XX-NODENAME.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = '1'
IMPORTING
OUTPUT = XX-PARENT_ID.
APPEND XX TO I_TAB.
LOOP AT I_TAB INTO XX.
TRANSFER XX TO FILE_NAME.
ENDLOOP.
CLOSE DATASET FILE_NAME.
Do i need to put any character for "data separtor" and "escape sign"?
Moderator message : Duplicate post locked.
Warning : Non-adherence of forum rules will lead to deletion of user-id.
Edited by: Vinod Kumar on Sep 8, 2011 4:07 PM

Hi,
CSV file means file having comma seperated values.  You dont have to convert anything.  Just open a .CSV file and transfer comma seperated values into it.
Keep semicolon ( as seperator for each field in same row.  And then transfer this to the file opened.  This will solve the problem.
In your case
LOOP AT I_TAB INTO XX.
CONCATENATE xx-field1 xx-field2........ INTO wa_data SEPERATED BY ';'.
TRANSFER wa_data TO FILE_NAME.
ENDLOOP.

Similar Messages

  • ODI reading csv file issue

    Hi,
    I am in ODI 11.1.1, which is our ELT tool for metedata load for all Planning App.
    One issue i am facing is , one data extract coming from an essbase cube using a Calc Script as .csv file.
    when i am trying to read that in ODI , it is unable to read. Opening the file and saving it manually . After that step ODI is able to read the file.
    in the datastore under the Model , i have defined the file type Delimited as comma and header 2, record separator Ms-Dos.
    anyone has come accross this issue ?
    Thanks,
    KP

    Hi,
    Most probalby it is due to difference between file creation platform and file read platform.
    Say you created a file in Unix and then try to read the file in MS_Dos , ODI will not be able to file , unless you set
    record separator as Unix.
    Thanks,
    Sutirtha

  • Importing users into WGM from csv file issues/crash

    Hi,
    i've been importing user information from csv files into WGM via the +server >  import+ function .
    It worked the first few times but now when i try the import progress bar pops up and promptly disappears without any thing importing.
    i've tried restarts, new admin account, reinstalled  WGM.
    I've also trashed some pref but i don't really know which ones i should be losing.
    The servers an OD master.
    any help would be appreciated.
    as a last resort what do i need to backup/save if i were to format/reinstall osx server? keeping my settings etc.....
    thanks
    paul

    What I did was:
    Exported the user list, to create an XML file in the correct format.
    Using this format, I created a spreadsheet in Excel (sorry Apple), and in the final column I created a field that concatenated the information I wanted in the ':' deliminated format of the previously export XML.
    Then just copy and past via pico into a pure text file and imported that.
    You have to be careful with comments in Passenger, using special characters (';!@#$%^ and others can cause the WGM to fail and crash.

  • Interactive Report Download CSV file Issue (output includes separator BR)

    Hi,
    I have a Interactive Report and displaying the column values (multiple values in same ROW) as mentioned below.
    SQL Query
      select deptno,
           function1(empno) empno
      from emp
    IR Output
    Dept       Employee No
    10         AAA,BBB,CCC, ...    // -  Row 1
    20         XXX,YYY,ZZZ, ...    // -  Row 2 Now I want to display each employee in a new Line, so modified the SQL Query
    Modified SQL Query
      select deptno,
           REPLACE(function1(empno),',','<br>') empno
      from emp
    New IR Output
    Dept       Employee No
    10         AAA
               BBB
               CCC
               ...    // -  Row 1
    20         XXX
               YYY
               ZZZ
                ...    // -  Row 2 SO, Interactive Report Out put looks fine and that's the way we want.
    But the problem is when I download the Report in CSV or in PDF using the Action Menu -> Download..
    I am getting break line B R in the output, and also I have two different output in CSV for two different column. [Logic is same for both the columns.]
    CSV output1
    Employee No
      AAA<br>BBB<br>CCC
      XXX<br>YYY<br>ZZZI have other columns also with multiple values...for that column, I am getting the following CSV output
    CSV output2
    City List
      1111<br>
      2222<br>
      3333<br>So, in CSV for one column, I am getting all the values in same line with the seperator B R (Output1)
    for other column, I am getting values in new line with the separator B R. (Output2)
    Is there a way to FIX this CSV or PDF output for Interactive Report.
    I DON'T WANT THE SEPARATOR BR in CSV and also the values should always be in New Line.
    I want to have the following Output in CSV
    Employee No
      AAA
      BBB
      CCCThanks,
    Deepak
    Edited by: Deepak_J on Feb 24, 2010 11:45 AM
    Edited by: Deepak_J on Feb 24, 2010 11:46 AM
    Edited by: Deepak_J on Feb 24, 2010 11:48 AM

    Thanks.. Jari.. for the quick response.
    I updated my SQL query with Chr(10) and added the code in Page HTML header.
    Now the CSV & PDF output are fine..getting each individual value in seperate line (no BR tag)
    BUT in the Interactive Report Output, I am now getting first 2 values in 1 line, then next value in next line, and so on..
    IR Output
    Employee
      AAA BBB
      CCCCCCC
      DDDDDI have few more issues with CSV & PDF output
    1. In PDF is there a way to increase the column width, as for some of the columns, the values are getting truncated.
    2. For some of the columns in IR Report, I have user BR tag in Column Heading and this also come in CSV output (column heading with BR tag), is there a way to fix this. In PDF Column headings are fine (no BR tag)
    and by the way..what exactly this does.
    <style type="text/css">
    .apexir_WORKSHEET_DATA td{white-space:pre;word-wrap: break-word}
    </style>Thanks,
    Deepak
    Edited by: Deepak_J on Feb 24, 2010 12:20 PM
    Edited by: Deepak_J on Feb 24, 2010 12:21 PM

  • OBIEE 11g - issue when export to a csv file

    Hello,
    I have an issue when I try to export to a csv file a report having numeric feild, when I export and open the file in notepad the trailing zeros to the right of decimal points do not show up. When export to another formats (such as excel, pdf) the trailing zeros appears correctly. e..g, 100.00 appears as 100, 100.50 appears as 100.5.
    Do you know what can be done in order to have trailing zeros to the right of decimal points to appear in a csv?
    Thanks

    This is a bug see below.
    Bug 13083479 : EXPORT DATA TO CSV FORMAT DOES NOT DOWNLOAD EXPANDED HIERARCHICAL COLUMNS
    Proposed workaround : OBIEE 11.1.1.5: Pivot Table Report Export To Csv Does Not Include Hierarchical Data [ID 1382184.1]
    Mark if answered.!
    Thanks,
    SVS

  • Issue when creating a CSV file

    Stupid issue but I've tried to fix it all day and it's not working...
    I need to create a CSV file made up of 3 columns, 2 number and 1 char. The char column is a company name that has spaces in it. When I run the query in SQL Developer, the char column looks fine. When I run in in BiPub as a CSV, I get double-quotes around the char column. It looks fine if I would look at it as DATA or any other format.
    I can't use the REPLACE function because there's nothing wrong with the data.
    We're using BI Pub v.10.1.3.4.
    Any thoughts?
    Thanks!!
    Kris

    First I tried using a basic rtf file and just selected CSV as the type. Then I tried using the 'e-text template' and selecting CSV, same result. Now I'm trying to use an .xsl file instead of a .rtf to see if that works.
    Kris

  • File upload - issue with European .csv file format

    All,
    when uploading the .csv file for "Due List for Planned Receipts" in the File Transfer Upload center I receive an error.  It appears that it is due to the european .csv file format that is delimited by semicolon rather than comma. The only way I could solve this issue is to change Regional and Language options to English. However, I don't think this is a great solution as I can't ask all our suppliers to change their settings.  Has anyone come across this issue and another way of solving it?
    Thank you!
    Have a good day,
    Johanna

    Igor thank you for your suggestion. 
    I found this SAP note:
    +If you download a file, and the formatting of the CSV file is faulty, it is possible that your column separator does not match the standard settings of the SAP system. In the standard SAP system, the separator is ,.
    To ensure that the formatting is correct, set your global default for column separation in your system, so that it matches that of the SAP system you are using.+
    To do that Microsoft suggests to change the "List separator" in the Regional and Language Options Customize view. Though like you suggest that does not seem to do the trick. Am I missing something?
    However, if I change the whole setting from say German to English (UK) the .csv files are comma delimited and can be easily uploaded.  Was hoping there would be another way of solving this without need for custom development.

  • Excel 2007 csv file formatting issue

    Our users create .csv files for upload to SAP. Their habit is to include a number of blank lines in excel to make it more readable.
    In Excel 2003, blank lines were handled as, literally, blank lines, and opening in a text editor shows exactly that, a blank line (with a CR-LF character to terminate the row).
    In Excel 2007 however, the blank line consists of a number of commas equal to the no. of columns, followed by the CR-LF termination. Hope that makes sense.
    While the 2003-generated .CSVs are fine, the 2007 versions cause SAP to throw an exception  ("Session never created from RFBIBL00") and the upload fails. The question therefore is, has anyone ever come across anything similar, or is anyone aware of any remediation that might be possible? Haven't been able to find any documentation on this Excel 2003-2007 change sonot able to address the issue through Excel config.
    Thanks!
    Duncan

    Hello
    Please refer to the consulting note 76016 which will provide information on the performance of the standard program
    RFBIBL00.
    Regards.

  • Issue when I upload CSV file for insert contact list on Cisco Attendant Console Advanced

    Hi Friends,
    I have error "Provided file is not valid CSV File" when I upload CSV file to Cisco Attendant Console Advanced system. I'm not sure what happen about my CSV. My purpose is insert contact list to system and create CSV base on documentation.
    Anyone have idea to solve this issue please kindly help me.
    Thanks

    You are right, whenever Cisco device boots, the IOS files gets loaded on the DRAM.
    But in this process, some temporary files are also generated which gets saved in the flash/Disk, that’s the only reason you got these error messages. It’s not recommended at all to have less space in the Flash than what is recommended on Cisco.com. I would say please remove some files from Disk and have minimum 256 MB flash otherwise your router may drop into rommon mode at the time of next reload.
    Well, it’s good to upgrade the bootstarp image too. Currently you are running 15.X IOS code, I would say run 15.X bootstarp image on the box.
    You may download bootstarp image for 7206VRX NPEG2 from the link below:-
    http://software.cisco.com/download/release.html?mdfid=282188585&flowid=1380&softwareid=280805685&release=15.2.4S4&relind=AVAILABLE&rellifecycle=ED&reltype=latest
    If you want to know the procedure of the upgrade, click the link mentioned below:-
    http://www.cisco.com/en/US/docs/ios/12_2/configfun/command/reference/frf010.html#wp1017654
    -Amant

  • Facing issue in Bulk Load Post Process in case of blank fields in csv file

    Hi,
    I ran command line bulk utility to create users in OIM through CSV file. I left few columns as blank which were not mandatory. After executing the bulk utility, user got successfully created in OIM but after that when i ran "Bulk Load Post Process" for LDAP sync then it changed the user's organisation to default organisation "Xellerate User" which is a major issue. It is happening only when i am leaving some column blank. Any idea why it is happening and how to resolve this problem? Need some urgent help!!

    Hi ,
    Thanks for your reply, the issue was we can not use DOD=Y due to the dependency of the Standard Version where other program fetches data from the same XML structure,
    Any way we resolved this issue by re doing below post installation steps. And used a new schema with updated DTD and point that with the same logical schema.
    1) Created a new schema for XML external database
    2) Change the DTD file, keep it in the same location
    3) Change properties file with new schema name
    4) Test with the new schema for XML connection
    5) Reverse engineer the BaseModel ITEMBRANCH only (Where we added additional XML Tags)
    6) Bounce back ODI agent and Client
    Thanks,
    Pc

  • Set-ADUser based on .csv file - empty attributes issue

    Hi, after a few months without working with PowerShell my knowledge is slowly fading away but fortunately every time this happened before, I was able to rebuild my knowledge again and now it is the same story. However I want to optimize my simple
    code which populates three AD user object attributes: manager, officephone and fax with values stored in .csv file. Everything works well, but my code looks not so good in my opinion. Is there any more elegant solution?
    $AddressBook = Import-CSV -Path D:\AddressBookFinal.csv
    foreach($Employee in $AddressBook)
         if([string]::IsNullOrEmpty($Employee.ManagerUserName)) {
                  Set-ADUser -Identity $Employee.EmployeeUserName -Manager $null
        } else {
                  Set-ADUser -Identity $Employee.EmployeeUserName -Manager $Employee.ManagerUserName
        <#similar code here for checking value of OfficePhone and Fax attributes and populating             AD attributes depending on if attribute value in .csv file is empty or not#> 

    Hi BoxiKG,
    If there is any other question regarding this issue, please feel free to reply this post directly so we will be notified to follow it up.
    If you have any feedback on our support, please click here.
    Best Regards,
    Anna Wang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • BEA 9.2 Portal issue: downloaded CSV file contains embedded html code

    We have J2EE application using BEA 9.2 Portal framework, and one of the page has feature to generate report( in pop up window) in CSV file format. As per the history from previous developer, BEA 8.1 didn't have this issue but, after mirgration to 9.2, they started having file download error( incomplete contents ..). To overcome this issue they commented out setting content length to HttpServletResponse as attached below, but this, now, causes html page source code of the parent page( where submit button is clicked to generate csv file report) being rendered along with actual report in the downloaded CSV file. Has anyone have this sort of issue? If so, can you please share your thoughts? or any thoughts in general?
    BEA 9.2 with Portal framework, JDK 15, JSP, Beehive NetUI, Sun Microsystem Solaris server
    Here is the source code that avoids setting content length and reasoning behind it..
    private static void setResponseHeadersForCSVFile(HttpServletResponse response, String filename, int contentLength)
    String mimeType = mimeTypes.getContentType(filename);
    response.reset();
    response.setContentType(mimeType);
    // DON'T explicitly set the content length, since the length of the String or StringBuffer that contains
    // the contents of the CSV file will be character encoded when it is actually written to the output stream, based
    // upon the character encoding of this JVM App Server's settings. So let the JVM App Server framework apply the character
    // encoding AND set the final and truly correct content length header at the time the contents of the String or StringBuffer are truly
    // streamed back to the user.
    //response.setContentLength(contentLength);
    response.addHeader("Content-Disposition", "attachment; filename=\"" + filename + "\"; size=" + contentLength);
    }

    1) Yes, the old content.tld is available as part of a web library module as a taglib.tld file. The module is: wlp-services-web-lib.war, which can be found in your bea/weblogic92/portal/lib/modules directory.
    2) The new API is accessible from the ContentManagerFactory class. This provides access to INodeManager, ITypeManager, ISearchManager, etc. The new API is contained within the com.bea.content.federated package. The 8.1.x API in the com.bea.content.manager package including RepositoryManager, NodeOps, SearchOps, etc. has been deprecated with 9.2.
    3) Yes, via the new I*Manager implementations. The entitlement support is for application-scoped visitor roles. Make sure you're using the ISearchManager when performing search operations. This will ensure secure results are returned.

  • Ssrs 2008 export to csv file display issue

    In a new SSRS 2008 report, I would like to know if there is a way to automatically expand the width of some of the rows when the data is exported to a CSV file so the data is displayed correctly. Here are examples that I am referring to:
    1. In one column where there is suppose to be a date that looks like 12/11/2014, the value of ########## is displayed. The value of 12/11/2014 is what is setup in the SSRS formatting option.
    2. In a number field that is suppose to look like 6039267049 the value that is displayed is 6E+09.
    Basically if I manually expand the width of the columns that I am referring to above, the data is displayed correctly. Thus can you tell me what I can do so that the data is disaplayed correctly in the CSV file and ther user does not need to manually expand
    the column to see the data?

    Hi wendy,
    After testing the issue in my local environment, I can reproduce it when use Excel to open the csv file. As per my understanding, there is no width when we export the report to csv, Excel is just using the default cell sizes when we open the csv. So when
    a date value is wider than the default cell size, it would be displayed as ##########. When a number value is wider than the default cell size, it would use Scientific format.
    As to the date value, we can use the expression =cstr(Fields!Date.Value) to replace the former one =Fields!Date.Value. In this way, the width of the value is narrower than the default cell size, so that the date value can be displayed correctly. For the
    number value, it already narrow down the width with Scientific format. Or we can Select all the cells in the csv file, then click Format| AutoFit Column Width to change all the cells width to fit its corresponding values in Excel level.
    Besides, we can try to export to excel instead of csv. Excel format can inherit the column width in the report. So in this way, we can directly change the width to fit the values in Reporting Services level.
    Hope this helps.
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • SSIS CSV FILE READING ISSUE

    hi can u reply me for the below post
    Actually iam using a FF connection manger to read the csv file .. with the row delimiter to {CR}{LF}.
    Suddenly in looping through the files package got failed because it cant able to read the csv file 
    Again i changed  the row delimiter to {LF} then it worked for the file which i faced issue with the {CR}{LF} delimiter.
    Now i want to know why the package is failing for the row delimiter issue..
    can any one help me on this.
    Please share me what actually the difference between those

    Please share me what actually the difference between those
    CR = Carriage Return = CHAR(13) in SQL
    This character is used in Mac OS as new line.
    When this character is used, cursor goes to first position of the line
    LF = Line Feed = CHAR(10) in SQL
    This character is used in Unix as new line.
    When this character is used, cursor goes to next line of the line (Old days typewritter when paper moves up)
    CR LF
    New line in Windows system. Combination of CR and LF.
    Best thing is to open the test flat file in Notepadd++ and enable show symbols - show chars and see what exactly you have as row delimiter
    Cheers,
    Vaibhav Chaudhari
    [MCTS],
    [MCP]

  • CSV file generation issue

    Hello All,
    We are facing below issue during CSV file generation :
    Generated file shows field value as 8.73E+11 in output and when we are clicking inside this column result shown is approximate of the correct value like 873684000000. We wish to view the correct value 872684000013.
    Values passes from report program during this file generation are correct.
    Please advice to resolve this issue.
    Thanks in Advance.

    There is nothing wrong in your program, it is the property of excel that if the value in the cell is larger than
    default size it shows in output of that format.

Maybe you are looking for

  • Cancelamento de NF-e parado (batch status 05, process status 02)

    Bom dia pessoal, Ontem tivemos um problema no GRC/PI de um cliente, onde por alguma razão o certificado estava sendo rejeitado. Depois de vários problemas causados por isso, foi resetado o j2ee e o sistema voltou a operar normalmente. As sequelas dis

  • How do I back up my iPhone to iCloud without using wi-fi?

    I am currently out of wi-fi range.  However, I have my iPhone  connected to my PC.  I bring up iTunes and selct my phone, then go to Summary page.  Select iCloud as the Automaticly Backup and then select Back Up Now.  It will back it up to the comput

  • Nav Bar disappears in live view and in all browsers

    Hello all, I have an issue I haven't had before. I created a navigation bar right under the header.  After adding my text for the links, I checked in all browsers and each time, the nav bar disappeared, leaving me with just the words. Also the font c

  • Help setting up my hosting.

    How in the world do I set up web hosting? I have a friend that sells hosting packages but doesn't know if iWeb will work with it.

  • Cisco ASA 8.2 55xx connect 2 inside interfaces together

    Hi all, I have some problem with my Cisco ASA 8.2 5510. I have to know how shoud i connect 2 inside interfaces together. I am writing what i have. I have 5 network connection on Cisco ASA. 1. Interface Ethernet 0/0 - outside 200.200.200.200 255.255.2