Problem with flat file upload with ASCII file

Hi All,
I am trying to load data into an ODS object via PSA using a text file (tab delimited). I have the following settings in my InfoPackage
External Data tab: ASCII File
Seperator for thousands:
Character for decimal point:
Currency Conversion:
Number of Header rows to be ignored: 1
Processing tab: Only PSA and Update into data targets subsequently
When I do a preview the data is not showing up in the right format....the tab seperation does not work and data is garbled with extra hexadecimal characters too.
The same file contents in .csv format is loading the data in the right format and preview is fine too.
I need help trying to convert this csv file to .txt format.
Any clues are highly appreciated
Thank you

Hi,
If in the infopackage you click on a File Type ASCII-file (CR delimiter) radiobutton and then F1, you’ll see the help:
“With an ASCII file as a data source, the data has to be available as a string in the format of the transfer structure. There are no data separators, empty characters are not ignored.”
This means that:
-     you shouldn’t use any delimiters among the record fields
-     all fields should have the length the system expects (length of the appropriate infoobject in transfer structure)
-     each record should be separated from the next by carriage return CR.
Since I think the program that converts file from Excel format into CR-delimited would be very useful, I created such program in VBA.
So, open your Excel file (if you have csv-file you can open it using Excel).
The program assumes that the first row of the file contain field names. Data itself begin from the 2nd row. Insert as the 1st and 2nd rows the new, blank rows.
Into A1 cell insert number of the last row with data, into B1 – number of the last column. Certainly, it may be determined in the program, but I have not done it – if someone wants it, s/he can try it.
Into fields of the 2nd row insert expected length of the field.
Make sure that “Visual Bacis” toolbar is seen. (If not – tick in menu path: View/Toolbars/Visual Basic).
In this toolbar click on a ‘Design Node’ icon.
Drag from the toolbar and drop into worksheet a ‘Command button’ element.
Double click on the button. In the open window for “Private Sub CommandButton1_Click()” subroutine insert the following code:
Dim ws1 As Worksheet
Dim J As Long, I As Long, L As Long
Dim FileName As String, Out As String, formatOut As String
Dim LenCell As Long
Set ws1 = ThisWorkbook.Worksheets("SHEET1")
FileName = ThisWorkbook.Path & "\" & Left(ThisWorkbook.Name, Len(ThisWorkbook.Name) - 3) & "txt"
Open FileName For Output As #1
For J = 4 To ws1.Cells(1, 1)
    Out = ""
    For I = 1 To ws1.Cells(1, 2)
        formatOut = (ws1.Cells(J, I))
        L = Len(formatOut)
        LenCell = Val(ws1.Cells(2, I))
        If L > LenCell Then
            formatOut = Left(formatOut, LenCell)
        Else
            Do While L < LenCell
                formatOut = formatOut & " "
                L = L + 1
            Loop
        End If
        Out = Out & formatOut
    Next
        Print #1, Out
Next
Close #1
Set ws1 = Nothing
MsgBox "File transformation finished!", vbOKOnly
Now return to Excel sheet, click again ‘Design Node’ icon switching into run mode.
When you press on this button now, the ASCII program will be created. It will have the same name as an input file (and in the same directory), but with TXT extention.
Remarks:
-     The program works with the current worksheet named as “SHEET1”.
-     Fields that are shorter than those expected by the system are padded by spaces from the right. It should not be the problem, since in transfer structure you can check symbols only flag.
-     Longer fields are truncated to the length expected.
Best regards,
Eugene
Message was edited by: Eugene Khusainov

Similar Messages

  • Problem in Flat File Uploading

    Hi everyone
    During a flat file uploading, I get a message for each record of my SKU (Stock Keeping Unit), for eg for SKU 1017023, I got a message
    <b>Value '1017023 ' for characteristic PISKU is in external format     RRSV     9</b>
    PISKU is the field name.
    The whole extraction is failing.
    Kindly provide me some suggestions as soon as poosible!!
    If possible mail me at
    [email protected]
    Regards
    Gajendra Singh

    Hi,
    It seems there is a space in the value '1017023 '.You have to edit in PSA and then send it again else delete the request and change the flat file entry and reload the data.
    Hope this helps
    Assign points if useful
    Regards,
    venkat

  • Problem in Flat file transaction data loading to BI7

    Hi Experts,
    I am new to BI7, got problem in activating data source for transaction data and create transfer routine to calculate sales revenue which is not there in flat file but flat file has got price per unit and quantity sold.
    Flat file fields are:
    Cust id   SrepID  Mat ID  Price per unit  Unit measure  Quantity   TR. Date
    cu100    dr01      mat01         50                 CS              5     19991001       
    created info objects are
    IO_CUID
    IO_SRID
    IO_MATID
    IO_PRC
    IO_QTY
    IO_REV
    0CALDAY
    When i created IO_QTY, unit/curency was given as 0UNIT. In creation of DS, under fields tab, extra field CS was shown I did confuse to which object should i map it. and at the same time when i enter IO_QTY its prompting one dailogbox with 0UNIT, so i said ok. Now i can't map CS to unit as system created automatic ally 0UNIT when i enter IO_QTY. Could you please give me solution for this and procedure to enter formulae for calculating Sales revenue at this level instead of query level. Your solutions will be more appreciated with points.
    Await for ur solutions
    Thanks
    Shrinu

    Hi Sunil,
    Thanks for your quick response. I tried to assign the infoobjects under the fields tab in creation of DS. I have not reached to data target yet.
    Could you please answer to my total question.
    Will you be able to send some screen shots to my email id [email protected]
    Thanks
    Shri

  • Encountering problem in Flat File Extraction

    Flat file extraction: the settings which I maintain in the data source u201Cfield tabu201D are conversion routine "ALPHA", format "External". But when I load the data, the record which is maintained in lower case (in the Flat File) is not getting converted into upper case. But if I try with out ALPHA conversion, the lower case data is getting converted into the SAP format (Upper case). Could you please help me to fix the problem
    When I use both ALPH & External together?

    Hai did you enable the lower case enable option check box in the infoobject level .For the objects which you want lower case values .Check the help.sap site as well.
    Goodday

  • Getting Problem in Flat File to IDoc Scenario.

    Hi,
    I am facing problem which is as follows.
    Test Flat File Contain Data As Follow
    Field1,Field2,Field3
    Field4,Field5,Field6
    Field1,Field2,Field3
    Field4,Field5,Field6
    Field1,Field2,Field3
    Field4,Field5,Field6
    Source structure has only one segment with all six fields and is repeating.
    What will be the file content conversion parameters so that it will pick first 2 lines and convert it into segment in this away.(I cant create two segments)
    Thanks in advance.

    Hi,
    I agree with Vijay.. so try to create the Data type like this..
    Recoredset 0...1
    -----Line1 0.... unbound
    --------Field1 0...1
    --------Field2 0...1
    --------Field3 0...1
    -----Line2 0.... unbound
    --------Field4 0...1
    --------Field5 0...1
    --------Field6 0...1
    Now do your FCC
    Recordset Structure ---- Line1,*,Line2,*
    Recordset per Message ---- 1
    Line1.fieldNames ----- Field1,Field2,Field3
    Line1.fieldSeparator ---- ,
    Line1.endSeparator ----- 'nl'
    Line2.fieldNames ----- Field4,Field5,Field6
    Line2.fieldSeparator ---- ,
    Line2.endSeparator ----- 'nl'
    now map the fields as per your requirement.
    Regards,
    Sarvesh

  • Problem in flat file loading(bulk data)

    Hi,
    I am populating a flat file with 3lac records. I am getting error due to buffer space problem.
    "Error during target file write "
    around 2 lac records are getting inserted after that the above error is coming..
    Now temporarily I am populating 1.5 lac and 1.5 lac in two times.
    Could anyone please tell me how to solve this issue .
    Thanks in Advance.

    I am using owb 10.2 version.
    In the map source is a Oracle table, Target is a flat file.
    Source table contains 3lac records.
    I executed the map. During execution it is throwing the following error .
    "Error during target file write "
    But it has inserted 2lac records in the target file.

  • Problem performing flat file reconciliation in 11gR2

    Hello,
    In R1, I had configured a simple GTC flat file connector that worked well. I've now updated to R2 (well actually, I've done a clean install), recreated the same connector configuration and tested with a text file that worked in R1, but this time, it doesn't work. I've added the following lines in my oim server logs config to have a better idea of what's going on :
    <logger name="oracle.iam.identity.scheduledtasks"/>
    <logger name="oracle.iam.scheduler"/>
    <logger name="oracle.iam.platform.scheduler"/>
    <logger name="Xellerate.Scheduler"/>
    <logger name="Xellerate.Scheduler.Task"/>
    <logger name="oracle.iam.reconciliation"/>
    However, the problem seems to happen before any reconciliation task is executed because I don't see any information about the data being read from the file. Here are the errors I'm getting :
    oracle.iam.reconciliation.exception.ReconciliationException: Invalid Profile - GTCCSVTEST1_GTC
    at oracle.iam.reconciliation.impl.ReconOperationsServiceImpl.getProfile(ReconOperationsServiceImpl.java:2121)
    at oracle.iam.reconciliation.impl.ReconOperationsServiceImpl.ignoreEvent(ReconOperationsServiceImpl.java:544)
    at oracle.iam.reconciliation.impl.ReconOperationsServiceImpl.ignoreEvent(ReconOperationsServiceImpl.java:535)
    Caused by: oracle.iam.reconciliation.exception.ConfigNotFoundException: Invalid Profile - GTCCSVTEST1_GTC
    at oracle.iam.reconciliation.impl.config.CoreProfileManagerImpl$ProfileMarshaller.unMarshal(CoreProfileManagerImpl.java:521)
    at oracle.iam.reconciliation.impl.config.CoreProfileManagerImpl$ProfileMarshaller.unMarshal(CoreProfileManagerImpl.java:504)
    [org.xml.sax.SAXParseException: cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type 'matchingRuleType'.]
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:315)
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(UnmarshallerImpl.java:522)
    Caused by: org.xml.sax.SAXParseException: cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type 'matchingRuleType'.
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
    It looks like something is wrong with my reconciliation profile, so I've gone to the Design Console and created a default reconciliation profile for my GTCCSVTEST1_GTC Resource Object, but it did not help.
    Any ideas?
    Thanks,
    --jtellier                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    That's it. I've just learned that a Reconciliation Rule is created automatically when a field is set as "Matching Only" when configuring the connector. I had such a field in the initial configuration, but skipped this step when configuring the connector in R2.
    Thanks,
    --jtellier                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • A problem about flat file,help me plz!

    hi all:
    i have met a question while working with owb.
    in my case i have two flat files as the data source.
    at first i use one of the files as data source .And everything was gone through smoothly,including deploy and execute.
    But when i use the other file as data source,error came up when the connectors were being deployed.it reported "Could not find location XXXX ".
    i wonder if there is any limitation while using flat file as data sourse.if not ,how can i deal with such a problem.
    best regards!
    thanks a lot!

    when i deploy with source as flat files i use sqlldr which even OWB uses. and there is no problem with multiple sources in sqlldr. check in the script after generating mapping. If INFILE option in sqlldr script every path of source is mentioned properly.
    regards
    roopa

  • Problem Reading Flat File from Application server

    Hi All,
    I want to upload a Flat File which is having a Line Length of 3000.
    While uploading it to Application server , only upto 555 length it is getting uploaded .
    i am using the code :
    DATA: BEGIN OF TB_DATA OCCURS 0,
            LINE(3000),
          END OF TB_DATA.
    *----Uploading the flat file from the Local drive using FM "UPLOAD".
    OPEN DATASET TB_FILENAM-DATA FOR OUTPUT IN TEXT MODE." ENCODING DEFAULT.
    IF SY-SUBRC NE 0.
      WRITE:/ 'Unable to open file:', TB_FILENAM-DATA.
    ELSE.
      LOOP AT TB_DATA.
        TRANSFER TB_DATA TO TB_FILENAM-DATA.
      ENDLOOP.
    ENDIF.
    CLOSE DATASET TB_FILENAM-DATA.
    What could be the problem?
    Could it be due to any Configuration Problem?
    Waiting for your replies.
    Thanks and Regards.
    Suki

    Your code looks OK, but you may have touble displaying the full width. Try:
    WRITE: /001 TB_FILENAM-DATA+555.
    (And don't forget to append your ITAB after each read.)
    Rob

  • Problem converting flat file to XML using JMS Adapter

    I need to take an MQSeries message in a flat file format and convert it to XML before processing.  I have configured the modules as described by the screenshot located here:
    http://www.radesix.com/JMSConfig.jpg
    The message is received however it isn't converting to XML.  When I view the payload I get the message indicated by the screenshot located here:
    http://www.radesix.com/JMSError.jpg
    I am new to XI.  Any ideas?

    For simple plain conversion here is a config, which works in our system:
    (left parameter key, right parameter value, module key always the same)
    Transform.Class com.sap.aii.messaging.adapter.Conversion
    TransformContentType text/xml;charset=utf-8
    xml.conversionType SimplePlain2XML
    xml.addHeaderLine 0
    xml.processFieldNames fromConfiguration
    xml.documentName SA02_Identnummer
    xml.documentNamespace urn:mycompany-com:logistics:DFT:HWL
    xml.structureTitle SA02_Identnummer_Satz
    xml.fieldNames Satzart,Identnummer,Status
    xml.fieldFixedLengths 2,10,3
    Be aware, that you must delete all spaces in the config, especially when you copy and paste values.
    For struct. conversion the entries are a little bit more complex.
    Regards
    Stefan

  • Date format problem in Flat file extraction

    My flat file is send date like this  DD/MM/YYYY  HH:MM:SS  how can i extract date and time to my ODS. i need date if posible time in seperate object
    how can i create my info object and how to map it.
    Thanks
    Babu

    Hi,
    create a routine and use the statement convert timestamp. Check out the F1-help for details of the statement.
    Siggi

  • Problem with ASCII char (127-'\u0080') while printing

    Hello,
    I am working with socket and want to send some data over the network. I am using Strings for sending data over the socket. In few characters ('\u007F' to '\u009F') I am getting error. Whenever I try to execute this line, I got an error
    System.out.println ( '\u0080') -> It is printed as '?' = '\u003F'.
    I try to send this character (String) over the network through Client Socket\
    Socket ClientSocket = new Socket("192.168.243.10", "6010");out = new PrintWriter(ClientSocket.getOutputStream(), true);
    out.println('\u0080') ;
    out.close() ;
    ClientSocket.close();It is received with same '\u003F' ='?' at the receiving end (192.168.243.10). While rest all characterset is receiving & printing accurately. Any Comments on it?
    Shozi

    You are using a Writer to send those chars, which
    means it will attempt to encode them into bytes. But
    since those bytes you mentioned are not defined in
    ASCII (or in UTF-8859-1 for that matter) then the
    charset converter encodes them as "?".
    Can you explain why you are using Strings when it
    appears you need to send untranslated bytes?I am following a pattern of bits to identify data elements present in message string.
    I am writing a chat Client & Server. While sending message to chat clients, I need to tell whether private window request, or main channel request or notification (will display in both private window & main window). In this way, I have 32 combination of options that can be present in my message, so I am using 4 chars (32 bits) to figure out which option is present or which message element is present in the received message. So, I am using bitmap pattern to identify data elements in my message. For this I am using bits of a char (lower 8 bits). This will help me in identifying the characters present in the message. I have specific range of characters that aren't interpreted correctly. '\u007F' to '\u009F' while rest are working absolutely fine with me. Why these characters aren't working? This is what I am trying to figure out.
    Hope I clarifies the situation.

  • Problem with java, ASCII and Linux

    Hi Friends,
    I has a Linux RedHat 9.0 with a jre1.5.0_04 (rpm package of Sun).
    I has a problem with ASCII , for example :
    import java.io.*;
    public class HolaMundo
    public static void main (String[] args)
    System.out.println("Hol� M�ndo");
    this programs runs ok on my windows jdk so it prints "Hol� M�ndo", but when i run the same HolaMundo.class program on my linux redhat it prints "Hol�� M��ndo"
    I think the problem is with the ASCII table that uses the linux version of jre, but i dont know how to solve this problem. I need a Spanish-European ASCII table on my application but i think it is working with a US-ASCII table.
    Then i has installed a kaffe 1.0 (rpm) java machie on this linux and this solve the problem but i has another problems of compatibility with this old version of java kaffe.
    Do you know whats happening?
    Thanks in advance.

    The problem doesn't have to do anything with Java or Linux as far as i can see. It's more likely a problem with Windows XP and IE. Be assured that normally downloading the Linux JDK in windows is not a problem.

  • [Flat File Destination [220]] Error: Failed to write out column name for column "Column 2"

    I am using SSIS to extract fixed width data into a flat file destination and I keep getting below error. I have tried almost everything in this forum but still no solution. can anyone help me out to solve this problem.
    [Flat File Destination [220]] Error: Failed to write out column name for column "Column 2".
    [SSIS.Pipeline] Error: component "Flat File Destination" (220) failed the pre-execute phase and returned error code 0xC0202095
    Thanks

    Hi Giss68,
    Could you check the Advanced tab of the Flat File Connection Manager to see whether the InputColumnWidth and the OutputColumnWidth properties of the Column2 has the same value? Please refer to the following link about the same topic:
    http://stackoverflow.com/questions/10292091/how-do-i-fix-failed-to-write-error-while-exporting-data-to-ragged-right-flat-fil 
    If it doesn’t work, please post the sample data and the advanced settings of Column2 for further analysis.
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • Bdc upload file data into internal table problem with gui_upload fm

    Hello experts,
    my coding is like this ..
    data : begin of itab occurs 0 .
    field1 like mara-matnr,
    field2......
    etc,
    end of itab.
    data: file1 type string.
    parameter :file like rlgrap-filename.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR file.
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
    static = 'X'
    mask = space
    field_name = 'FILE'
    CHANGING
    file_name = file.
    START-OF-SELECTION.
    FILE1 = FILE . "HERE I AM PASSING INTO STRING
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = FILE1
    FILETYPE = 'ASC'
    has_field_separator = 'X'
    TABLES
    data_tab = itab. " here the data is not populating from the file , it is giving the error like speified table not found.
    HERE i am getting the message like "specified table name not recgonised" . the data is not populating into the itab from the file.
    file structure is same as the internal table.
    I stored the file as .txt( ie in notepad).
    my file is like this..
    10000 200 323 sunndarrr.......
    i had a problem with this bdc , i am getting like "specified table name not recgonised" in the fm gui_upload while debugging.
    when i am using the ws_upload it is working fine.
    please guide me where i have done the mistake.
    thank you so much for all the replies.

    Hi,
    Have a look on the following code.
    TABLES: kna1.
    DATA: BEGIN OF itab1 OCCURS 0,
          str(255),
          END OF itab1.
    DATA: itab2 TYPE kna1 OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'WS_UPLOAD'
      EXPORTING
        filename                = 'D:\ABAP EVE\ffile1.txt'
        filetype                = 'ASC'
      TABLES
        data_tab                = itab1
      EXCEPTIONS
        conversion_error        = 1
        file_open_error         = 2
        file_read_error         = 3
        invalid_type            = 4
        no_batch                = 5
        unknown_error           = 6
        invalid_table_width     = 7
        gui_refuse_filetransfer = 8
        customer_error          = 9
        no_authority            = 10
        OTHERS                  = 11.
    IF sy-subrc <> 0.
      WRITE:/ 'sorry'.
    ELSE.
      LOOP AT itab1.
        SPLIT itab1-str AT ',' INTO itab2-kunnr itab2-name1.
        APPEND itab2.
      ENDLOOP.
      IF sy-subrc = 0.
        LOOP AT itab2.
          WRITE:/ itab2-kunnr,itab2-name1.
          INSERT INTO kna1 VALUES itab2.
        ENDLOOP.
        IF sy-subrc = 0.
          WRITE:/ 'inserted'.
        ELSE.
          WRITE:/ 'not inserted'.
        ENDIF.
      ELSE.
        WRITE:/ 'fail'.
      ENDIF.
    ENDIF.
    Flat file:
    10001,Sadney
    10003,Yogesh
    20005,Madan
    1.U need to define internal table with one field of max size
    2.upload the flat file data into that internal table
    3.split that internal table data into another internal table(having fields)
    <REMOVED BY MODERATOR>
    thanks,
    Chandu
    Edited by: Alvaro Tejada Galindo on Apr 30, 2008 12:17 PM

  • Upload table with a flat file Once - without program

    Hello,
    I know that it is possible to upload a Z table from a flat file. (without program)
    I do not have a problem with this table. I manage a  maintenance view (SM30) and I can thus enter one by one a recording in this table and to put it in an transport request(R3TR-TABU)
    I would like to enter all the recordings only one (with a file.)
    I know that it is possible... but how???
    Thank you to help me.
    Servane

    The only other way I know how to put table entries in is thru SE11   Utitlties>Table Contents->create entries.  But this does not allow to be uploaded via file.
    Regards,
    Rich Heilman

Maybe you are looking for

  • WIFI "gets confused" and times out (Mac Mini late 2014)

    My WIFI on my late 2014 Mac Mini is having connection problems.  It does drop network every once in a while and I have to reboot, which is irritating.  However, the seriously problematic  behavior is that it seems to get into a confused state where i

  • Interface Objects missing in ESR

    Hello, I have created a whole bunch of interface objects under my namespace in the ESR. During message mapping, when I try to do a u201CFind design objectu201D in the message mapping definition under my namespace, I canu2019t find any of the objects

  • Meta Data Naming Conventions

    Hi, Can any one pls explain me on "Meta Data Naming Conventions". Thanks in advance.

  • InDesign CS5 Server SDK

    Hi, I notice that InDesign CS5 Server is available from the partner download area.  However, I haven't been able to find the InDesign CS5 Server SDK; I've looked in the partner download area and also on http://www.adobe.com/devnet/indesign/sdk/index.

  • Change Schedule Lines values for Each Item for a Scheduling Agreement ?

    Hii     I want to change the Schedule Line Schedule Qty for Each Line item for a Scheduling Agreement . I cannot use BAPI_PO_CHANGE as this is for PO only and gives error for a scheduling agreement. I am on 4.6c so i SAP does not have BAPI_AGREEMENT_