The first line in a file is supressed

hi all,
i have a really weird problem.
i have a file with a lot of data and i am using a file adapter with file content conversion to parse it.
the file adapter is a sender one.
the problem come when i do read the file and then it ignore the first line of the file.
all the lines from the second one forward is shown in SXMB_MONI but the first line of the file isn't.
i can't seem to figure out what the problem is, i tryed looking for some kind of attribute in the file adpater but had no luck.
could you please help me?
btw,
the file structure is: header,1,body1,<wildcard>,body2,<wildcard>
Edited by: Roi Grossfeld on Oct 29, 2008 4:24 PM

Recordset Structure: H1,1,B1,<wildcard>,B2,<wildcard>
Key Field Name: RecordType
H1.fieldFixedLengths 6,2,8,1,1,3,30,5
H1.fieldNames FileNo,RecordType,TransmissionDate,Car_Truck,BU,MD,FileName,Count
H1.keyFieldValue H1
B1.fieldFixedLengths 6,2,10,27,8,8,4,5,3,11,9,9,11,11,9,9,7,9,11
B1.fieldNames FileNo,RecordType,InvoiceNumber,VesselName,MMSEShipmentDate,PlanArrivalDate,DeliveryPlace,Units,Currency,ModelPriceAmount,OptionPriceAmount,ColourPriceAmount,REPriceAmount,TotalPriceAmount,FreightChargeAmount,InsuranceFeeAmount,MiscellaneousAmount,VATAmount,GrandTotalAmount
B1.keyFieldValue B1
B2.fieldFixedLengths 6,2,10,12,12,12,5,6,12,3,3,3,4,17,7,7,12,8,5,3,9,7,7,9,9,7,9,4,20
B2.fieldNames FileNo,RecordType,InvoiceNumber,MDOrderNumber,MMSEOrderNumber,MMSECaseNumber,ModelYear,BodyType,Model,ExteriorColourCode,InteriorTrimColourCode,OptionCode,RearEquipment,VehicleIdentificationNumber,ChassisModel,CSequenceNumber,EngineModel,ESequenceNumber,KeyNumber,Currency,UnitModelPrice,UnitOptionPrice,UnitColourPrice,UnitRearEquipmentPrice,UnitTotalPrice,UnitVATAmount,UnitTotalVAT,VATRate,VATNumber
B2.keyFieldValue B2
ignoreRecordsetName true
Edited by: Roi Grossfeld on Oct 29, 2008 4:39 PM

Similar Messages

  • Need help with java File IO ( Removing the first line from a file )

    Hi guys ,
    I am currently doing a project in which I need to extract out the values from the second line of a file to the end. The question is how do I ignore the first line ??
    I thought of two possible answers myself. One is to use randomaccessfile to read and rewrite. But the file may be HUGE so storing the whole file in memory is not a very good idea.
    Second is to jump to second line before doing while ((str = in.readLine()) != EOL) ... or just delete the first line from the file. Can anyone suggest a better solution or show me some sample codes ? Thanks.
    regards
    billyam

    Just skip the first line (bufferedReader.readLine()), add a comment, and then handle the rest of your file

  • Trying to omit first line of CSV file (the header)

    Hello everybody,
    Newbie here havin a lil problem. I have this program below that reads in a CSV file. My test CSV file has the follow structure:
    ID, LastName, FirstName, Phone, Email,
    2345, Yez, Wei do, 456-789-0123, [email protected],
    2744, Avanto, Aldo, 562-593-6500, [email protected],
    1212, Dewy, Cheatem, 123-456-7890, [email protected],
    1234, No, Wei Foo, 123-456-7890, [email protected],
    The first line is my header. (here is the heart of my problem)
    I have the program reading in the file and the it sorts it. The problem i have is that the first line, my header gets sorted with everything else. Here is my feable attempt with resulting error:
    import java.io.*;
    import java.util.*;
    public class File2Array {
        public static void main(String[] args)
            File file = new File("person_test1.csv"); //File to read in
            ArrayList persons = (ArrayList) getPersons(file); //call to arraylist
            Collections.sort(persons);
            for (Iterator i = persons.iterator(); i.hasNext(); )
                System.out.println(i.next());
        public static List getPersons(File file)
    //NEW PIECE OF CODE        boolean first = true;
            ArrayList persons = new ArrayList();
            try {
                BufferedReader buf = new BufferedReader(new FileReader(file));
                while (buf.ready()) {
                    String line = buf.readLine();
    //NEW PIECE OF CODE
         while( ( line = buf.readLine() ) != null )
              if( first )
                   first = false;    continue;
    //ORIGINAL IF
         //   if (!line.equals("") )
    //NEW IF
                    if (line != null && !line.equals("") )
    //END OF NEW CODE
                         StringTokenizer tk = new StringTokenizer(line, ",");
                         ArrayList params = new ArrayList();
                         while (tk.hasMoreElements())
                             params.add(tk.nextToken());
                         Person p = new Person(
                                 (String) params.get(0),
                                 (String) params.get(1),
                                 (String) params.get(2),
                                 (String) params.get(3),
                                 (String) params.get(4));
                         persons.add(p);
            } catch (IOException ioe)
                System.err.println(ioe);
            return persons;
    class Person implements Comparable
        private String ID;
        private String LastName;
        private String FirstName;
        private String Phone;
        private String Email;
        public Person(
            String ID,
            String LastName,
            String FirstName,
            String Phone,
            String Email)
            if (FirstName==null || LastName==null)
                throw new NullPointerException();
            this.ID = ID;
            this.LastName = LastName;
            this.FirstName = FirstName;
            this.Phone = Phone;
            this.Email = Email;
        public String toString()
            StringBuffer sb = new StringBuffer ();
            sb.append( ID );
            sb.append(" ");
            sb.append( LastName );
            sb.append(" ");
            sb.append( FirstName );
            sb.append(" ");
            sb.append( Phone );
            sb.append(" ");
            sb.append( Email );
            sb.append(" ");
            return sb.toString();
        public boolean equals(Object o)
            if (!(o instanceof Person))
                return false;
            Person p = (Person)o;
            return p.FirstName.equals(FirstName) &&
                   p.LastName.equals(LastName);
        public int hashCode()
            return 31*FirstName.hashCode() + LastName.hashCode();
        public int compareTo(Object o)
            Person p = (Person)o;
            int lastCmp = LastName.compareTo(p.LastName);
            return (lastCmp!=0 ? lastCmp :
                    FirstName.compareTo(p.FirstName));
    this code compiles and runs but does not produce any output and I don't understand why.
    Question: What is the proper way to have the code omit the first line of a CSV file??
    By the way I do have another file called person.java that goes with this but I didn't think I had to post it.
    Also am I posting correctly? Am I putting in too much code??
    Than you!!

    Hot diggity! jverd,
    I got it to work!! here's what I did all thanks to you :-)
    ArrayList persons = new ArrayList();
            try {
                BufferedReader buf = new BufferedReader(new FileReader(file));
                //read through file and populate array
                //while (buf.ready()) {
                    String firstline = buf.readLine();  //gets header, renamed line to firstline
                    String line;                  //added this line     
                    System.out.println(firstline);     //added this to print out firstline     
         //try this
              while( ( line = buf.readLine() ) != null )
              /*{                    //commented out this portion
              if( first )
                   first = false;    continue;
              //end try this                
                    //if (line != null && !line.equals("") )     //down to here
                    if (!line.equals("") )          //added this
                         StringTokenizer tk = new StringTokenizer(line, ",");
                         ArrayList params = new ArrayList();
                         while (tk.hasMoreElements())
                             params.add(tk.nextToken());
                         Person p = new Person(
                                 (String) params.get(0),
                                 (String) params.get(1),
                                 (String) params.get(2),
                                 (String) params.get(3),
                                 (String) params.get(4));
                         persons.add(p);
                      }                       

  • File Sender adapter not reading the first line

    Hi,
    I have a scenario configured from file to jdbc adapter.
    However, I found a problem in my file sender adapter. My file adpater always not picking up the first line from my text even I have set the 'Document Offset' to 0.
    Any Ideas? Thanks.
    Regards,
    Pua

    Hi Latika Sethi,
    My complete input text file is as below, it contains only 2 testing records:-
    H1|DIZ1                          |A0016507    |10000020|09/2007
    H2|ABC0001
    D|P|0001|Gaji Pokok       |   1,000.09
    D|D|0002|Denda              |   1,000.00
    D|P|0003|Elaun               |   1,000.00
    H1|PUA1                        |A0016508    |10000021|09/2007
    H2|ABC0002
    D|P|0001|Gaji Pokok       |   2,744.09
    D|D|0002|Denda              |   2,000.00
    D|P|0003|Elaun               |   2,000.00
    After the message mapping, I found the pipeline existed in sxmb_moni as below:-
    <?xml version="1.0" encoding="utf-8"?>
    <ns:mt_rmp03B_filejdbc_sender xmlns:ns="urn:rmp03:pdrm:ips:jdbcjdbc">
    <PaySlip>
    ..<Header2>
    .... <IC>ABC0001</IC>
    .. </Header2>
    .. <Details>
    .... <Jenis>P</Jenis>
    .... <No>0001</No>
    .... <Deskripsi>Gaji Pokok</Deskripsi>
    .... <Jumlah>1,000.09</Jumlah>
    .. </Details>
    </PaySlip>
    <PaySlip>
    .. <Header1>
    .... <Nama>PUA1</Nama>
    .... <KWSP>A0016508</KWSP>
    .... <NoGaji>10000021</NoGaji>
    .... <Bulan>09/2007</Bulan>
    .. </Header1>
    .. <Header2>
    .... <IC>ABC0002</IC>
    .. </Header2>
    .. <Details>
    .... <Jenis>P</Jenis>
    .... <No>0001</No>
    .... <Deskripsi>Gaji Pokok</Deskripsi>
    .... <Jumlah>2,744.09</Jumlah>
    .. </Details>
    </Payslip>
    There are 2 payslips as for the top payslip node...Header1 tag is missing. It means that during the file sender step....the first line of my record which is :-
    "H1|DIZ1                          |A0016507    |10000020|09/2007"
    is not read into the xi pipeline. Basically this is the problem i faced.
    Has somebody facing the same problem before? Currently I have no choice but moved the First line of the text into Second line and left the first line of the text become null/ empty line. As such both records can be successfully read by the XI.
    However what I wondered is sometimes clients will do insert the records into the first line and this might made some data loss.
    Thanks...

  • Could not parse the file contents as a data set. There were too many variable names in the first line of the text file.

    Could not parse the file contents as a data set. There were too many variable names in the first line of the text file.

    What are the Variables settings, what is the text file’s content, …?

  • Removing first line in text file... Memory and HD concern

    Hello all,
    I want to remove the first line of a text file. This is easy... One way
    to do it, is to find the first "end of line" caracter, strip the string
    and re-write the sting in file with the "strip to sreadsheet" VI.
    Since the file can be quite large (about 120000 lines), is this a good
    way to do it. Will it re-write all the line or just moving the "begin
    of file" pointer to the second line? If it re-write the whole file,
    this option is not very good since I could have to do this operation
    quite often. (I want the file to be a kind of circular buffer / backup).
    What do you think is the best way to do this?
    Thanks!
    Vincent

    I think you would have to read in all the data and write it to a new file, you could either keep the data in RAM or simply write to another file then delete the original, and then rename the temp one.  So obviously that is a lot of data and memory.
    My main question is are you trying to use a text file as a circular buffer?  If so can you tell us more about the data, ie is it strings of a constant length?  Does a user ever need to read the file or could we head binary?
    A solution would be to truly make the file a binary file, so you could actually seek through the file easier, and maybe make the first data chunk the location of the most recent write.  The obvious danger is then writing over existing data.  This solution is still risky because of the data writes.
    You may want to look at some of the other file formats like HWS which maintains a hierarchy of data for you so you can simply add and remove data from it.  However, a user will not be able to easily read it.

  • How to ignore the first row  in sender file

    I would like to ignore the first row in each file in the sender channel - how can i do it?

    Hi
    Check this,
    As he said give Document Offset = 1
    http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
    Also check this forum
    Re: Supress Column Heading - File Content Conversion in Sender Adapter
    Thanks,
    Prakash

  • Summary field printing on the first line when it supposed to prin last page

    i have created manual report. in the end of the report i have summay columns. wheni run in oracle reports it perfectly shows the grand totle. when i generate to file (PDF) thegrand total print on the first line. can some one tell me wht is it printig on the first line when it supposed to print on the last page. i tried print object on Last Page. it is still same.

    You may have hit this side effect of page protect (all copied from the Help):
    Description The Page Protect property indicates whether to try to keep the entire object and its contents on the same logical page. Setting Page Protect to Yes means that if the contents of the object cannot fit on the current logical page, the object and all of its contents will be moved to the next logical page.
    Note: Using Page Protect may cause objects below the page protected object(s) to appear above the page protected object(s).
    Solution:
    If Page Protect causes an object to be moved to the next logical page when formatting, an object alongside the page protected object may or may not be moved as well. If the object alongside the page protected object is not anchored (implicitly or explicitly) to the page protected object, and that object can fit in the space where the page protected object could not fit, the object will print on that logical page. Otherwise, the object will be moved along with the page protected object to the next logical page.
    (To say it simply: anchor the summary field explicitly).

  • Help with how to count the number of tokens from the first line

    Hi
    I want to count the number of tokens from the first line of text, from my incoming file and print it out.
    For example i have 12 tokens in the first line, so i want it to print out the number 12
    my code is below
    thanks
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    import java.util.StringTokenizer.*;
    import java.sql.*;
    public class Data {
         public static void main(String[] args) {
                        String token = null;          
                        String currentToken = "";
                        Hashtable hh = new Hashtable();     
              try {
                   Vector v2 = new Vector(100);
                   Vector v = new Vector(100);
                   FileReader file = new FileReader("words.txt");
                   BufferedReader buff = new BufferedReader(file);
                   String line = buff.readLine();
                   StringTokenizer s = null;
                   boolean eof = false;
                   while  (!eof){
                        s = new StringTokenizer(line.trim(),",",true);
                        boolean lastToken = true;
                   while (s.hasMoreTokens()) {
                              token = s.nextToken();
                                  if (lastToken){
                                   if (token.equals(",")) {
                                        v.add("");
                                               lastToken = false;
                                      if (! token.equals(",")) {
                                   v.add(token);
                                  else { if (currentToken.equals(",")) {
                                        v.add("");
                                  currentToken = token;
                        if (token.equals(",")) {
                               v.add("");
                   line = buff.readLine();
                        if (line == null){     
                             eof = true;}
                   buff.close();
              }catch (FileNotFoundException fe) {     
                        System.out.println("Error - - " + fe.toString());
              }catch (NumberFormatException ne) {
                        System.out.println("Error - - " + ne.toString());
              } catch (IOException e) {
                   System.out.println("Error - - " + e.toString());
    }     2.

    I can print out the amount of tokens from each line,
    But i only want the first line to be counted, And i
    also do not want the delimeters to be counted.
    could you please give me some ideas?
    Thanks
    try
       BufferedReader br = new BufferedReader(new FileReader("item.kr"));
       while((str=br.readLine())!= null)
          itemslist.add(str);
    catch(IOException ioe)
       System.out.println("Exception Occurred!!!");
    }This snippet gets one Line from the item.kr file.
    Then i would count (By useing a diffrent String Tokenizer) to count only this line!!!

  • Excel upload with header in the first line

    Hi ,
    I have to upload a Excel sheet with data where the first line will be the Header .
    I am using the FM
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
          I_LINE_HEADER        = 'X'
          I_TAB_RAW_DATA       = IT_TAB_RAW_DATA
          I_FILENAME           = P_FILE
        TABLES
          I_TAB_CONVERTED_DATA = IT_FS00_C
        EXCEPTIONS
          CONVERSION_FAILED    = 1
          OTHERS               = 2.
    But the data is not getting uploaded in the IT_FS00_c table.
    is there any other way to do it.
    thanks and regards,
    Vikki.

    Use the folllowing coding.....
        CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
             EXPORTING
                  filename                = p_file
                  i_begin_col             = 1
                  i_begin_row             = 2
                  i_end_col               = 7
                  i_end_row               = 9999
             TABLES
                  intern                  = t_alsm_tab
             EXCEPTIONS
                  inconsistent_parameters = 1
                  upload_ole              = 2
                  OTHERS                  = 3.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        SORT t_alsm_tab BY row col.
        LOOP AT t_alsm_tab INTO r_alsm_tab.
          AT END OF row.
            l_append = 'X'.
          ENDAT.
          IF r_alsm_tab-col = 1.
            r_input_tab-kokrs = r_alsm_tab-value.
          ELSEIF r_alsm_tab-col = 2.
            r_input_tab-bukrs = r_alsm_tab-value.
          ELSEIF r_alsm_tab-col = 3.
            r_input_tab-rprctr = r_alsm_tab-value.
          ELSEIF r_alsm_tab-col = 4.
            r_input_tab-pline = r_alsm_tab-value.
          ELSEIF r_alsm_tab-col = 5.
            r_input_tab-sdatst = r_alsm_tab-value.
          ELSEIF r_alsm_tab-col = 6.
            r_input_tab-sdated = r_alsm_tab-value.
          ELSEIF r_alsm_tab-col = 7.
            r_input_tab-kostl = r_alsm_tab-value.
          ENDIF.
          IF l_append = 'X'.
            APPEND r_input_tab TO t_input_tab.
            CLEAR : l_append , r_input_tab.
          ENDIF.
        ENDLOOP.
      ENDIF.

  • Adding extension "line-size 255" to a standard report on the first line

    Hi Experts,
    i want to modify the statment  from Report ztest1 message-id zm to Report ztest1 message-id zm and line-size 255.
    I am going to add the extension line-size 255 to the report statement in a standard report. There are no enhancement points near the first line. I have access key available, so i can make the changes to core mod.
    The problem is that if i run the report in background, out of the 8 fields, i only see the first 6 columns in the spool. remaining 2 fields are truncated.
    The reason for truncation is bcoz the line-size extension is not given to the report. What procedure do i have to follow to add the extension line-size 255?

    HI,
    You do not need any enhancement for it.
    If you have the access key then just add the additon line-size 255 to the repport statement.
    Regards,
    Ankur Parab

  • Total of numeric fields in the first line of ALV output

    Hi All,
    i have a problem it is like i have created ALV list display and total is dipalyed of numeric column  for each page. my requirement is total should be diaplyed at the end of page plus toal should be diaplyed on the first line of second page also .
    please suggest me some solution .
    thanks
    praveen

    Hi
    one thing you can do is capture the totals into variables and display then in each top-of-page except first page.
    it will work as SORT and all dont have effect on top-of-page data. If you append that to internal table once we hit SORT data will chnage and it will give errorneous effects.

  • Regarding the first level navigation par file customization

    Hi
    i require the help on the first level navigation par file customization.
    i downloaded the rthe required par file from the server for changes.
    the name of the par file is <b>com.sap.portal.navigation.toplevelsingle.</b>.
    my requirement on this par file is i want to add an image file (.gif) to the first level navigaton at the end of the header.
    can u guide me how to do the chages to add an image in the top level navigation
    header file for this in the par file.
    reply ASAP
    Regards
    sunil

    Hi Sunil,
    Do you really want to place the image at the right side of the TLN - or at the header (which is different)?
    In the first case, there is a mixture of JavaScript and JSPs (containing JS) which build up the TLN, and this is quite complicated to understand (at least too complicate for a SDN thread). You would have to work through the code and try to modify it carefully.
    In the secondd case, you are touching the wrong PAR, but you would know the right one (as you opened a different thread about such a modification).
    Alternatively, you could try to use the light framework page, using the navigation tag library. This way, it is more easy to design your own UI, including the nav functionality.
    Hope it helps
    Detlev

  • Only showing the first line.

    When I compile and run this program, it only prints out the first line of text. Any idea's why it might be doing this?
    public class app {
         public static void main(String[] args)
              int years;
                   years = 1000;
                        System.out.println("Millenium = " +years);
              int days;
                   days = 365;
                        System.out.println("Year = " +days);
              int hours;
                   hours = 24;
                        System.out.println("Hours = " +hours);
    }

    What are you expecting it to do? Do you want an applet instead?
    public class Test extends JApplet
       String message;
       public void init()
          message = "Hello World!";
       public void paint(Graphics g)
          g.drawString(message, 5, 5);
    }

  • D110 only prints the first line.

    If I send an item to the printer, it only prints the title. I have tried to copy to notepad and pasted to an email. Then sent it to the printer thru an email. It only prints the first line. How do I get it to print the whole item?

    You can use one of our diagnostic tool and can this can help you resolve the issue automatically and you can use it in future as well.
    http://h10025.www1.hp.com/ewfrf/wc/softwareCategory?os=4132&lc=en&cc=sg&dlc=en&sw_lang=&product=5169...
    Check if the issue gets resolved.
    Say "Thanks" by clicking the Kudos Star in the post that helped you.
    Please mark the post that solves your problem as "Accepted Solution"
    (Although I am employed by HP, I am speaking for myself and not for HP)

Maybe you are looking for