How to upload CSV file w/o ,, for the last line

Hi Experts,
As part of one interface uploading the csv file (4coulmns) manually using the TCODE: CSCA_FILE_COPY.
After uploading when i see in the AL11 as it is csv file it is filling the , in each space.
But my issue while running the interface (because of logic in it) checking for the hash total in the last line where (record count, hash total) only 2 items should come but because of manual upload adding the (record count, hash total, , ,) another two spaces.
Where program not moving further becasue the it is alway comparing the amounts (1000.00 not matching with 1000.00, , ) it is not processing. In production files directly load in to unix server so no issues and i can't ask to change the program code...because iam not following the process. As part of testing i've to do manually only.
Please suggest the workaround for this.
Is it possible to change the contents directly in AL11 directly....then HOW ?
or
How to create a csv file w/o , , in the last line (may be it is not possible) ?
Thanks for your replies in advance.
Regards
VVR

I don't think you can edit from AL11, nor creating a CSV without those commas at the end because are created to state fields with empty value.
You have 6 columns filled with values but for the last line you only fill the first four. It is expected to appear , , for the last 2 columns on the last line.
I can only suggest keep doing it manually before uploading the CSV file... or... you are saying you can't change the program.
How about upload all CSV files... then writing another program to get those files from AL11 and delete the spare commas at the end line?
Cheers,
Andres.

Similar Messages

  • How to upload .CSV file from Application Server

    Hi Experts,
        How to upload .CSV file separated by ',' from Application server to an internal table.
    Invoice No,Cust No,Item Type,Invoice Date,days,Discount Amount,Gross Amount,Sales Amount,Customer Order No.,Group,Pay Terms
    546162,3233,1,9/4/2007,11,26.79,5358.75,5358.75,11264,HRS,11
    546163,2645,1,9/4/2007,11,3.07,305.25,305.25,10781,C,11
    Actually I read some already answered posts. But still I have some doubts.
    Can anybody please send me the code.
    Thanks in Advance.

    Hi Priya,
    Check this code
    Yhe logic used here is as follows,
    Get all the data into an internal table in the simple format ie: a row with one field contains an entire line
    After getting the data, we split each line of the table on every occurrence of the delimiter (comma in your case)
    Here, I have named the fields as field01, field02 etc, you could use your own names according to your requirement
    parameters: p_file(512).
      DATA : BEGIN OF ITAB OCCURS 0,
              COL1(1024) TYPE C,
             END OF ITAB,
             WA_ITAB LIKE LINE OF ITAB.
      DATA: BEGIN OF ITAB_2 OCCURS 0,
        FIELD01(256),
        FIELD02(256),
        FIELD03(256),
        FIELD04(256),
        FIELD05(256),
        FIELD06(256),
        FIELD07(256),
        FIELD08(256),
        FIELD09(256),
        FIELD10(256),
        FIELD11(256),
        FIELD12(256),
        FIELD13(256),
        FIELD14(256),
        FIELD15(256),
        FIELD16(256),
       END OF ITAB_2.
      DATA: WA_2 LIKE LINE OF ITAB_2.
        OPEN DATASET p_FILE FOR INPUT IN TEXT MODE ENCODING NON-UNICODE.
        IF SY-SUBRC = 8.
          WRITE:/ 'File' , p_FILE , 'cannot be opened'.
          LV_LEAVEPGM = 'X'.
          EXIT.
        ENDIF.
        WHILE SY-SUBRC <> 4.
          READ DATASET p_FILE INTO WA_ITAB.
          APPEND WA_ITAB TO ITAB.
        ENDWHILE.
        CLOSE DATASET p_FILE.
      LOOP AT ITAB INTO WA_ITAB.
        SPLIT WA_ITAB-COL1 AT ','    " where comma is ur demiliter
         INTO WA_2-FIELD01 WA_2-FIELD02 WA_2-FIELD03 WA_2-FIELD04
         WA_2-FIELD05 WA_2-FIELD06 WA_2-FIELD07 WA_2-FIELD08 WA_2-FIELD09
         WA_2-FIELD10 WA_2-FIELD11 WA_2-FIELD12 WA_2-FIELD13 WA_2-FIELD14
         WA_2-FIELD15 WA_2-FIELD16.
        APPEND WA_2 TO ITAB_2.
        CLEAR WA_2.
      ENDLOOP.
    Message was edited by:
            Kris Donald

  • How to upload a file which has more than 999 line item  through BDC ?

    Hello Techards
    Hi to all
    Can any body tell me how to upload a file which has more than 999 line item  through BDC for traction F-02 ?
    Thanks in advance.
    Shovan

    Hello Shovan,
    You split it up to post two accounting documents with the help of a "suspense" a/c.
    Say, you have to post the following line items below:
    line 1 - dr. - GL a/c X - $1000
    line 2 - cr. - GL a/c Y - $1
    line 3 - cr. - GL a/c Y - $1
    line 1001 - cr. - GL a/c Y - $1
    You cannot post the above as a single doc in SAP (because of technical reasons), so you need to break it up into 2 documents as below:
    Doc1
    line 1 - dr - GL a/c X - $1000
    line 2 - cr - GL a/c Y - $1
    line 3 - cr - GL a/c Y - $1
    line 998 - cr - GL a/c Y - $1
    line 999 - cr - SUSPENSE a/c - $3
    Doc2
    line 1 - dr - SUSPENSE a/c - $3
    line 2 - cr - GL a/c Y - $3
    Note that there is no incorrect impact on accounting as first we credit suspense a/c by $3 and next we debit the same suspense a/c by $3 as a result the effect is nil. Similarly, we credit $997 to GL a/c Y (which is less by $3) in the first doc which is compensated by the second doc by crediting the shortfall of $3.
    Hope this helps,
    Cheers,
    Sougata.

  • How user can get a Sales Text for the any Line Item in the Billing?

    Salute Masters ! !
    How user can get a Sales Text for the any Line Item in the Billing?
    It's coming for other Order (Line Item for Bought out Item at Project Site - Some Item they procure at project site & complete the task).
    Where I can configure in system for all.
    Rgds
    Srivastav
    09973504950

    Hi,
    Sales text can be copied from customer to order , order to delivery and delivery to billing .
    Check the T-code : VOTXN , do the customization as per your requirement.
    check the below link :
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/dd/55f993545a11d1a7020000e829fd11/content.htm

  • How to upload CSV file(Flat File) in SAP system.

    Hi All,
    Please guide me how to upload flat file into SAP system.
    Regards
    Avinav

    Use following syntax -
    DATA L_P_FILE TYPE STRING.
         L_P_FILE = P_FILE.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = L_P_FILE   <-------Your PC file name
        FILETYPE                      = u2018ASCu2019
        HAS_FIELD_SEPARATOR           = u2018Xu2019
      TABLES
        DATA_TAB                      = P_I_DATA[]   <-----Your internal table
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    Endif

  • How do I set a recurring event for the last day of the month on iphone 4s calendar?

    I want to set a recurring event for the last day of every month - regardless of the date/number of days in the month. I'd prefer not to have to use an app to do this.

    Hi,
    You can do this using the custom repeat in iCal. You'll need two events to cover the second and fourth Mondays.
    Create the event on the second Monday of the month. In Repeat select Custom... > Frequency: Monthly > On the: second Monday.
    Do the same for the Fourth Monday.
    Best wishes
    John M

  • Anyone know how to upload csv file to temp table of sybase DB from java?

    Dear All,
    I blindly need your help in achieving the following:
    I have the csv file which contains OrdId and BillId values. I just wanted to read these two values one by one from excel and loaded them into one temp table of Sybase SQL Anywhere.
    here is the sample query for your reference:
    begin tran
    create table tempdb..ordBill (ord_id int identity,bill_id int
    go
    load table tempdb..ordBill from 'c:\\test\\test.csv'Error:
    Incorrect syntax near the keyword 'table'.
    I am having only one tool Microsoft ISQL/W from which i connect to remote sybase DB and run some queries like sp_help , create etc.. from there.
    It would be great,if somebody knows the way of doing the above thru some java program. Otherwise, is there any tool like BCP required to do the above?
    Awaiting for your valuable reply
    thanks
    pannar

    Hi,
    I could connect to my Sybase DB thru java program. Can somebody help me how to upload the csv file into sybase temp table ?
    Here is the sample code:
    import java.sql.*;
    public class DBConn {
    public DBConn(){
    public static void main(String[] args) {
    try {
    //Class.forName("com.sybase.jdbc2.jdbc.SybDriver.class.getname()");
    //Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Class.forName("com.sybase.jdbc2.jdbc.SybDriver");
    String sourceURL = "jdbc:sybase:Tds:ldbd1.devo.ilx.com:5000";
    Connection conn = DriverManager.getConnection(sourceURL, "pannar", "pannar");
    //Connection conn = DriverManager.getConnection(sourceURL);
    System.out.println("Success");
    } catch (Exception e) {
    System.err.println("Got an excpetion! ");
    e.printStackTrace();
    }

  • How to upload .csv file with tab as delimiter.

    HI,
    I want to upload a .csv file with tab as delimiter to unix path in background.                                                                                                             
    I know there is function module 'GUI_UPLOAD', but in my case data is available in an internal table .
    upload the *.CSV :
    OPEN DATASET lv_filename
             FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
        IF sy-subrc = 0.
      *     Write  file records into file on application server
          LOOP AT gt_datatab INTO gs_datatab.
            TRANSFER gs_datatab TO lv_filename.
          ENDLOOP.
    CLOSE DATASET lv_filename.

    Bhanu,
    Define a local variable of type CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
    LV_TAB TYPE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB
    LOOP AT  GT_DATATAB INTO GS_DATATAB.
    CONCATENATE GS_DATATAB-FIELD1
                             GS_DATATAB-FIELD2
                             GS_DATATAB-FIELDN
                             INTO LV_STRING SEPARATED BY LV_TAB.
    TRANSFER LV_STRING TO lv_filename.
    ENDLOOP.
    Thanks,
    Vikram.M

  • How to use csv file to populate all the items in a form

    Our environment - Forms 6i/IAS 9i on Solaris/8.1.6 database on
    Solaris.
    In the web form I want the user to type in the name of an
    existing csv file(which contains 1 record). Then press a button
    and all the items on the form should be populated with the data
    in the csv file.
    One method is load the data in the csv file into the database
    using sqlloader and then execute a query to populate the form.
    Is there another way - instead of loading the file in the databas
    e? Thanks

    Hi Afroz,
    To be more specific, if the csv file doesn't has header, please refer to this script to add header:
    $csv = Import-Csv d:\haha.csv -Header "UserA","UserXYZ","EmailA"
    Then you can loop this csv file to run the "add-mailboxpermission" cmdlet, I recommend you can test this script before running against production environment, please also note I haven't tested this script:
    $csv = Import-Csv d:\users.csv -Header "UserA","UserXYZ","EmailA"
    foreach($each in $csv){
    write-host "assign fullaccess permission of user $($each.UserXYZ) on mailbox $($each.EmailA)"
    get-mailbox -identity $each.EmailA | add-mailboxpermission -user $each.UserXYZ -accessrights 'fullaccess'
    If there is anything else regarding this issue, please feel free to post back.
    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]

  • To Generate file with whitespaces for the last fields -Receiver file FCC

    Hi Experts,
    We need to create a file at receiver side having last field of 50 length.If value of last field is less than 50 length than we need to keep whitespaces on the right side.When we create file the whitespaces get trimmed and files are created without whitespaces.I am using fixed field length FCC.Please help me resolve this issue.
    Thanks & Regards
    Deepak Jaiswal

    If you like to have UDF ... here it is ..
    public String appendWhiteSpaces(String var1, Container container) throws StreamTransformationException{
      if(var1.length()< 50){
         for(int count=0;var1.length()<50;count++){
            var1 = var1 + " ";
      return var1;

  • I can't attach files on Gmail for the last week. Help!

    I've been trying to attach files in my Gmail account for over a week but every time I try to attach it comes back "failed". This wasn't an issue until about a week ago. I've uninstalled/reinstalled Firefox and nothing. I've had to go through IE in order to attach files. Help please!

    hello suzanne, firefox has introduced a new protocol named SPDY that should make pages load faster and is used on google pages. i've seen a report by another user who had the same problem uploading attachments to gmail as long as spdy was enabled.
    could you please try the following: enter '''about:config''' into the location bar & search for all preferences beginning with '''network.http.''' - in case any of them is shown in bold & therefore not on its default value please right click and reset those preferences. afterwards restart the browser and see if the problem is gone.
    when this did not resolve the issue or all entries were already set to their default values, please toggle '''network.http.spdy.enabled''' (again in about:config) to '''false''' by double-clicking it & restart the browser again.
    in case the latter resolved the issue, could you please provide information on how you are accessing the internet (provider/ the hardware model of your router) & which security software is running on your system - maybe this information will help firefox developers to fix the underlying issue... thank you very much!

  • How to upload a file in servlet ?

    hi i am new to this concept ..............
    i need upload a file in mysql database .........
    i created a form ...
    <html>
    <form method="post" action="http://localhost:8080/examples/servlet/UploadFile" enctype="multipart/form-data">
    File
    <input type="file" name="upload"/>
    <input type="submit" value="load" />
    </form>
    </html>
    what servlet receives from request ? how it will be stored in database ...
    i need a detail explanation ...
    Thanks

    The apache jakarta commons FileUpload project has sample code for how to upload a file.
    To store the file in the database you would use a preparedStatement. You can use anyone of the following methods ; setBlob, setBinaryStream, setBytes.
    The datatype of the column storing the document depend on the databse. SQL Server used image and postgres uses bytea

  • How to read the last line in a txt file?

    Dear all,
    I want to read the last line in a txt file. There are thousands of lines in this file. What I want is to move the file pointer directly to the last line of the file. But I did not know how do to it. Can anybody help me out?
    Thank you very much!

    If the file is coded as ASCII or one of the encodings that maps a single byte to a char then the following class will assist you
    import java.io.*;
    import java.util.*;
    public class GetLinesFromEndOfFile
        static public class BackwardsFileInputStream extends InputStream
            public BackwardsFileInputStream(File file) throws IOException
                assert (file != null) && file.exists() && file.isFile() && file.canRead();
                raf = new RandomAccessFile(file, "r");
                currentPositionInFile = raf.length();
                currentPositionInBuffer = 0;
            public int read() throws IOException
                if (currentPositionInFile <= 0)
                    return -1;
                if (--currentPositionInBuffer < 0)
                    currentPositionInBuffer = buffer.length;
                    long startOfBlock = currentPositionInFile - buffer.length;
                    if (startOfBlock < 0)
                        currentPositionInBuffer = buffer.length + (int)startOfBlock;
                        startOfBlock = 0;
                    raf.seek(startOfBlock);
                    raf.readFully(buffer, 0, currentPositionInBuffer);
                    return read();
                currentPositionInFile--;
                return buffer[currentPositionInBuffer];
            public void close() throws IOException
                raf.close();
            private final byte[] buffer = new byte[4096];
            private final RandomAccessFile raf;
            private long currentPositionInFile;
            private int currentPositionInBuffer;
        public static List<String> head(File file, int numberOfLinesToRead) throws IOException
            return head(file, "ISO-8859-1" , numberOfLinesToRead);
        public static List<String> head(File file, String encoding, int numberOfLinesToRead) throws IOException
            assert (file != null) && file.exists() && file.isFile() && file.canRead();
            assert numberOfLinesToRead > 0;
            assert encoding != null;
            LinkedList<String> lines = new LinkedList<String>();
            BufferedReader reader= new BufferedReader(new InputStreamReader(new FileInputStream(file), encoding));
            for (String line = null; (numberOfLinesToRead-- > 0) && (line = reader.readLine()) != null;)
                lines.addLast(line);
            reader.close();
            return lines;
        public static List<String> tail(File file, int numberOfLinesToRead) throws IOException
            return tail(file, "ISO-8859-1" , numberOfLinesToRead);
        public static List<String> tail(File file, String encoding, int numberOfLinesToRead) throws IOException
            assert (file != null) && file.exists() && file.isFile() && file.canRead();
            assert numberOfLinesToRead > 0;
            assert (encoding != null) && encoding.matches("(?i)(iso-8859|ascii|us-ascii).*");
            LinkedList<String> lines = new LinkedList<String>();
            BufferedReader reader= new BufferedReader(new InputStreamReader(new BackwardsFileInputStream(file), encoding));
            for (String line = null; (numberOfLinesToRead-- > 0) && (line = reader.readLine()) != null;)
                // Reverse the order of the characters in the string
                char[] chars = line.toCharArray();
                for (int j = 0, k = chars.length - 1; j < k ; j++, k--)
                    char temp = chars[j];
                    chars[j] = chars[k];
                    chars[k]= temp;
                lines.addFirst(new String(chars));
            reader.close();
            return lines;
        public static void main(String[] args)
            try
                File file = new File("/usr/share/dict/words");
                int n = 10;
                    System.out.println("Head of " + file);
                    int index = 0;
                    for (String line : head(file, n))
                        System.out.println(++index + "\t[" + line + "]");
                    System.out.println("Tail of " + file);
                    int index = 0;
                    for (String line : tail(file, "us-ascii", n))
                        System.out.println(++index + "\t[" + line + "]");
            catch (Exception e)
                e.printStackTrace();
    }Note, the EOL characters are treated as line separators so you will probably need to read the last two lines (think about it for a bit).

  • Help with pulling records for the last 24 hours

    Post Author: kbrinton
    CA Forum: Formula
    Hi,
    I don't know what is wrong with me but I can not figure out how to get Crystal to pull records for the last 24 hours.  I have a date field I can key off of but I can not figure out the formula or correct syntax to put in the Selection formula.  Any help would be great!!  Thanks

    Post Author: SKodidine
    CA Forum: Formula
    No need to create any formula.  In your record selection criteria type:
    {table.date} in dateadd("h",-24,currentdatetime) to currentdatetime
    If you just want the prior 24hrs and do not care about the time then replace 'currentdatetime' with 'currentdate'.
    (currentdatetime - 24) will give you 24 days before and not 24 hours.

  • 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

Maybe you are looking for

  • IPod Touch 4 headphone jack no longer working??

    So recently, my ipod touch 4's headphone jack stopped working. As in, I would plug in the headphones, and I would just hear the bass guitar in all the songs and the vocals, drums, beats etc. would be almost muted. And then, I would re-plug in the hea

  • Advise...what external hard drive to buy....ASAP!!

    I have an iMac and I have over 15,000 pictures that I want to store on an external hard drive in case something happens to my Mac. I want a hard drive that is already formatted for a Mac (snow Leopard) but I can't spend a fortune. Any advise would be

  • Settlement-Why local currency 3 did not be include in settlement by SAP?

    Dear All, Need your advice regarding issue bellow: I have post Accounting Document with zero amount in local currency(USD) and local currency2(USD), but no zero amount in local currency3(IDR). For better simulation, kindly find case bellow: Itm PK S

  • How to retrieve snapshot ( only image) of videos?

    How can i retrieve on client side, snapshots of each video stored in a particular application on flash media server. So that I can use that snapshot as image thumnail while listing the available videos.

  • Can't sync ipad calinder with imac 10.6.8

    I can't get the ipad calendar to sync with the calendar on my imac running 10.6.8. I put an event on the ipad, it never appears on the imac! it does appear on the icloud calendar. I've tried itunes sync plugged in to the imac too. What can I try?