Finding a text in a flat file

Hello experts,
I have a file that contains lots of data for particular retailers
My file has the following format. i have to import that in a table.
My question is as follows: Is it possible to identy a word in a text file and then take the number after that word ( eg i need to retreive the retailer number and save it in a retailer number column in my table)
Any help or guide will be really appreciated. Thanks in advance :)
CDC:00374 / Sat Jan-09-2010 Daily Sales Detail Sat Jan-09-2010 22:06:22
Retailer Number: 200116 Terminal Number: 20011600 Retailer Name: Aman Snack
Refunds-- Free Prize Issued ------Free Promo----- ----Promo Credits---- ---Returns--- -----Net----- ----Sales---- -----Cash---- -------Net------
Product Cnt Amount Cnt Cash Value Cnt Cash Value Cnt Amount ---Commiss--- Discounts ---Commiss--- ---Commiss--- -------Due------
=============== ================ ============= ======= ============== ======= ================= =======
X 26,160.00 0.00 0 0.00 8 -910.00 0 0.00 0 0.00 0 0.00 0 0.00 0 0.00 0 0.00 0 0.00 0 0.00 0.00 0.00 -1,308.00 -9.00 23,933.00
Y 14,000.00 0.00 0 0.00 123 -10,840.00 0 0.00 0.00 0 0.00 0 0.00 0 0.00 0 0.00 0 0.00 0 0.00 0.00 0.00 -700.00 -72.00 2,388.00
Retailer Number: 200117 Terminal Number: 20011700 Retailer Name: Best For Less Company Ltd
Refunds-- Free Prize Issued ------Free Promo----- ----Promo Credits---- ---Returns--- -----Net----- ----Sales---- -----Cash---- -------Net------
Product Cnt Amount Cnt Cash Value Cnt Cash Value Cnt Amount ---Commiss--- Discounts ---Commiss--- ---Commiss--- -------Due------
=============== ================ ============= ======= ============== ======= ================= =======
X 26,160.00 0.00 0 0.00 8 -910.00 0 0.00 0 0.00 0 0.00 0 0.00 0 0.00 0 0.00 0 0.00 0 0.00 0.00 0.00 -1,308.00 -9.00 23,933.00
Y 14,000.00 0.00 0 0.00 123 -10,840.00 0 0.00 0.00 0 0.00 0 0.00 0 0.00 0 0.00 0 0.00 0 0.00 0.00 0.00 -700.00 -72.00 2,388.00

lol yeah yeah sorry abt that,
The file is on the server, so i dont think it is needy to download it
here is my code
create table cdc_file (line varchar2(4000))
  ORGANIZATION EXTERNAL
    TYPE oracle_loader
    DEFAULT DIRECTORY GTECHFILES
    ACCESS PARAMETERS (
                          RECORDS DELIMITED BY NEWLINE
                          BADFILE 'csd_file.bad'
                          DISCARDFILE 'cdc_file.dis'
                          LOGFILE 'cdc_file.log'
                          FIELDS TERMINATED BY ',' RTRIM
                          MISSING FIELD VALUES ARE NULL
                          REJECT ROWS WITH ALL NULL FIELDS
                                                             line char(4000)
    LOCATION ('agent_dump_csv.rep')
PARALLEL
REJECT LIMIT UNLIMITEDThe table is created ok but when i do a simple select thats what i am getting
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04063: unable to open log file cdc_file.log
OS error Permission denied
ORA-06512: at "SYS.ORACLE_LOADER", line 19
file format is as follows:
#include "$XKIT/public/xrtitle130_english"
! 1 2 3 4 5 6 >< 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7
! 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
DARetailer Number: <99999999 Terminal Number: <9999999999 Retailer Name: <ttttttttttttttttttttttttttttttttttt
D
D -------Net------ -----Net----- --------Cancels------- ----------Cashes--------- ----------Claims--------- ---------Returns--------- ------Ticket Charges----- ------Ticket Refunds----- Ticket Charge Refunds Free Prize Issued ------Free Promo----- ----Promo Credits---- ---Returns--- -----Net----- ----Sales---- -----Cash---- -------Net------
D Product ------Sales----- Adjustment-     Cnt         Amount     Cnt            Amount     Cnt            Amount     Cnt            Amount     Cnt            Amount     Cnt            Amount     Cnt            Amount     Cnt    Cash Value     Cnt    Cash Value     Cnt        Amount -Commiss--- Discounts ---Commiss--- ---Commiss--- -------Due------
D =============== ================ ============= ======= ============== ======= ================= ======= ================= ======= ================= ======= ================= ======= ================= ======= ================= ======= ============= ======= ============= ======= ============= ============= ============= ============= ============= ================
* ~ ~ # ~ # ~ # ~ # ~ # ~ # ~ # ~ # ~ # ~ # ~ ~ ~ ~ ~ ~
D <tttttttttttttt 9,999,999,990.09 99,999,990.09 999,999 999,999,990.09 999,999 99,999,999,990.09 999,999 99,999,999,990.09 999,999 99,999,999,990.09 999,999 99,999,999,990.09 999,999 99,999,999,990.09 999,999 99,999,999,990.09 999,999 99,999,990.09 999,999 99,999,990.09 999,999 99,999,990.09 99,999,990.09 99,999,990.09 99,999,990.09 99,999,990.09 9,999,999,990.09
D
* ~ ~ # ~ # ~ # ~ # ~ # ~ # ~ # ~ # ~ # ~ # ~ ~ ~ ~ ~ ~
D Totals 9,999,999,990.09 99,999,990.09 999,999 999,999,990.09 999,999 99,999,999,990.09 999,999 99,999,999,990.09 999,999 99,999,999,990.09 999,999 99,999,999,990.09 999,999 99,999,999,990.09 999,999 99,999,999,990.09 999,999 99,999,990.09 999,999 99,999,990.09 999,999 99,999,990.09 99,999,990.09 99,999,990.09 99,999,990.09 99,999,990.09 9,999,999,990.09
D
DB Total records: #9,999,999
D
DC |ttttttttttttttttttttttttttttttttt~9,999,999,999,999,990.09
D
D TOTAL GROSS SALES AMOUNT.........~9,999,999,999,999,990.09
so like u said i dont think it is more than 4000 characters in a line
now running the select statement u have me give me the following error:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04063: unable to open log file cdc_file.log
OS error Permission denied
ORA-06512: at "SYS.ORACLE_LOADER", line 19
i am really new at pl/sql and its giving me grief to even try to understand but what u said previously made sense.
Edited by: Kevin CK on 21-Jan-2010 01:46
Edited by: Kevin CK on 22-Jan-2010 03:59

Similar Messages

  • Copying TEXT column from flat file into SQL results in empty fields....

    I'm copying TEXT column from SQL to Flat file (ragged right fixed width) - DT_TEXT. It copies fine and I''ve checked the output file. Now, while trying to copy the flat file to sql server in another system. I find all the fields are empty.
    When I preview the source from flatfile, I see all the entries there. But it copies other fields but the field with DT_TEXT  is empty.
    This is when I preview
    SQL Table output
    Any help will be helpful!!!

    Hi, I'm not sure If I'm understanding what you're saying. The data got copied from SQL to Flat file. I've double checked the flat file and I see the DT_TEXT data there. The size of file also gives an indication that there's existence of TEXT Data
    But, when I copy that data back to sql again (which I can also preview before the load), The DT_TEXT values goes missing. Same when I copy to Excel as CSV or as a Flat file. I don't see text data.
    The TEXT data resides on the first output. But when I try to extract to other format from that output, it doesn't come out.

  • How to to load data from a flat file in selection screen in portal .

    Dear All,
    I have a question to share : In BEX analyzer i know how i can upload multiple data in selection screen through a flat file , for example if i have to load 200 materials at one go in the selection screen, i can do that in BEX Analyzer . But if i run the same report through portal i am not able to find the upload option through flat file ..... Am i missing some option here ?
    Thanks & Regards,
    Ashutosh Singh

    You will not be able to load through the portal directly. it is possible to load if you can create Visual composer model. that also you will not be able to upload in bulk.

  • Full text search of .pdf files in a file table.

    I have installed the Adobe iFilter 11 64 bit and set the path to the bin folder. I still cannot find any text from the pdf files. I suspect I am missing something trivial because I don't find much when I Bing for this so it must not be a common problem.
    Here is the code.
    -- Adobe iFilter 11 64 bit is installed
    -- The Path variable is set to the bin folder for the Adobe iFilter.
    -- SQL Developer version 64 bit on both Windows 7 and Windows 8.
    USE master;
    GO
    DROP DATABASE FileTableStudy;
    GO
    CREATE DATABASE FileTableStudy
    ON PRIMARY
    ( NAME = N'FileTableStudy'
    ,FILENAME = N'E:\SQLServerData\SQL2012\Engine\FileTableStudy.mdf'
    ,SIZE = 4096KB
    ,FILEGROWTH = 1024KB
    ,FILEGROUP FileTableStudyFileTable CONTAINS FILESTREAM
    ( NAME = FileTableStudyFileTable
    ,FILENAME = 'E:\SQLServerData\FileTableStudy'
    LOG ON
    ( NAME = N'FileTableStudy_log'
    ,FILENAME = N'D:\SQLServerLogs\SQL2012\FileTableStudy_log.ldf'
    WITH FILESTREAM
    ( NON_TRANSACTED_ACCESS = FULL
    ,DIRECTORY_NAME = N'FileTableStudyFiles'
    GO
    USE FileTableStudy;
    GO
    DROP TABLE dbo.Magazine;
    GO
    CREATE TABLE dbo.Magazine AS FILETABLE
    WITH ( FileTable_Directory = 'MagazineStore'
    ,FileTable_Collate_Filename = database_default
    GO
    CREATE FULLTEXT CATALOG MagazineFullTextCatablog AS DEFAULT;
    GO
    --EXEC sp_fulltext_service 'load_os_resources', 1;
    --EXEC sp_fulltext_service 'verify_signature', 0;
    --EXEC sp_fulltext_service 'restart_all_fdhosts';
    --EXEC sp_fulltext_service 'update_languages';
    --EXEC sp_help_fulltext_system_components 'filter';
    --RECONFIGURE WITH OVERRIDE;
    SELECT document_type
    ,path
    FROM sys.fulltext_document_types
    WHERE document_type = '.pdf';
    SELECT *
    FROM sys.fulltext_document_types
    ORDER BY document_type;
    DROP FULLTEXT INDEX ON dbo.Magazine;
    GO
    SELECT TOP 1 indexes.name IndexName
    FROM sys.indexes
    JOIN sys.tables ON indexes.object_id = tables.object_id
    AND tables.name = 'Magazine'
    JOIN sys.schemas ON tables.schema_id = schemas.schema_id
    AND schemas.name = 'dbo'
    WHERE indexes.is_unique = 1
    AND indexes.name LIKE 'PK__%';
    GO
    -- Drag documents to folder.
    CREATE FULLTEXT INDEX ON dbo.Magazine
    ( file_stream TYPE COLUMN file_type)
    KEY INDEX [PK__Magazine__5A5B77D541728F3E];
    GO
    -- Wait for index to build
    SELECT DATEDIFF(ss, crawl_start_date, crawl_end_date) IndexBuildSeconds
    FROM sys.fulltext_indexes
    --ALTER FULLTEXT INDEX ON dbo.Magazine START UPDATE POPULATION;
    SELECT *
    FROM dbo.Magazine
    WHERE file_type = 'pdf';
    SELECT *
    FROM dbo.Magazine
    WHERE FREETEXT(*,'new core licensing')
    AND file_type = 'pdf';
    SELECT *
    FROM dbo.Magazine
    WHERE CONTAINS(*, N'"Microsoft"')
    AND file_type = 'pdf';
    SELECT *
    FROM sys.fulltext_catalogs;
    SELECT *
    FROM sys.fulltext_indexes;
    SELECT *
    FROM sys.fulltext_index_columns;
    SELECT *
    FROM sys.fulltext_index_catalog_usages;
    Thanks for any help.
    Tom G.

    Hello,
    We believe we have figured this out.  It looks like it has to do with the length of the default folder location for the Adobe iFilter.
    I was able to reproduce the issue and the following resolved it for me.  See if this resolves it for you all as well.
    Here is how to get Adobe Version 11 PDF filter to work.
     1 . If you haven’t already, run the following in SQL Server:
    Sp_fulltext_service ‘Load_os_resources’, 1
    Go
    --you might also need to run:  sp_fulltext_service ‘Verify_signature’,0  --This is used to validate trusted iFilters. 0 disables it. So use with caution.
    --go
    2. Stop SQL Server.  (Make sure FDHost.exe stops)
    3.  
    Uninstall the Adobe ifilter (because it defaulted to having spaces or the folder name is too long).
    4.  
    Reinstall the Adobe iFilter and when it prompts for where to install it, change it to: C:\Program Files\Adobe\PDFiFilter
    5.  Once the installation finishes, go the computer’s Environment variables. Add the following to the PATH.
    C:\Program Files\Adobe\PDFiFilter\BIN
    NOTE: it must include the BIN folder
    NOTE: If you had the OLD location that included spaces, remove it from the path environment variable.
    6. Start SQL Server
    7.  IF you had an existing Full-text index on PDFs, drop the full-text index and recreate it.
    8. You should now get results when you run sys.dm_fts_index_keywords('db','tblname')  --Note: Change db to be the actual database name and tblname to be the actual table name.
     Give this a try and see if this fixes yours. 
    Sincerely,
    Rob Beene, MSFT

  • Classes for converting a flat file to XML

    I've been asked to convert text in a flat file to an XML document. The XML document must conform to an XML schema. Currenlty, there is no requirement to store the resulting xml in the database.
    Therefore my approach will be:
    1. parse the flat file and store the contents in an array (the flat file and target xml is fairly simple in structure)
    2. Transfer the contents of the array to the xml structure
    3. validate the xml against the schema
    I'm new to Java. Therefore, what classes should I be using to assist in step 2. Obvoiusly, I dont want to have to write my own implementation from scratch (i.e. a method to build an element, method to escape reserved characters etc).
    Could you please suggest classes that cover both DOM and SAX API's.
    I'm working with a 9.2.0.4 database and XDK.
    Thanks

    The Stylus Studio may be used to convert text file to XML.
    http://www.stylusstudio.com/text_file_to_xml.html
    Another reference:
    http://www.devx.com/getHelpOn/10MinuteSolution/20356

  • SRC Folder Flat files

    Hi
    I am looking for a column named Commodity Code from the EBS data base. After a lot of investigation, and in one stage we decided to do some customization for the column. But we find that column in the flat file named 'FILE_UNSPSC' in the src files folder. Now If at all I want some column name 'xyz' from EBS, If at all that column is in FLAT FILES format in SRC folder, Is there any process that we can check directly in what flat file this column is in, And I think Data Lineage is not 100 % accurate , Is there any other process.
    Thanks in Advance

    Now If at all I want some column name 'xyz' from EBS.If the column is source from eBS table then pull it from table no need to look at the src folder, make sure you are not using Universal folder.
    And I think Data Lineage is not 100 % accurate 100% agree with you, to make 100% development suppose to be more accurate as per Informatica standards
    Is there any other process.Not clear with Q but Manual process is the best (in general)
    If helps mark

  • Oracle OWB integrator for Flat Files 3.0

    Hi,
    I have installed owb 11g r2 in my machine, but while creating flat files module for file import it is showing that
    it does not find *"Oracle OWB integrator for Flat Files 3.0"*. so i cannot use "import metadata using flat file wizard".
    do i need to install the owb again or the Oracle OWB integrator for Flat Files 3.0 alone..or how do i integrate it with owb....... please help if anyone can,,
    Thanks..

    Here is the certification matrix
    https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=5&ved=0CFEQFjAE&url=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fmiddleware%2Fdata-integration%2Fodi-11gr1certmatrix-ps6-1928216.xls&ei=mtmUUcX7DoiJrQek04DwAg&usg=AFQjCNGoOUFQHdK7Ti2DLb6vz_3s-miP3A&sig2=q3rf2foe9bl4_WbsLPwWng&bvm=bv.46471029,d.bmk

  • Loading MD from Flat File.

    Hi all:
    I am in NW2004s. I am trying to load MD from a flat file DS. The problem is that I can't see data in "Maintain Master Data" under the InfoObject in InfoProviders.
    The InfoObject is SalDiv which was created with texts. The flat file has two fields: SalesDivID, SalesDivName. Example: "1; Mall Center"
    My question is: Should a create 2 Transformations? (one for texts and one for attributes?) or one is enough....in that case, which one?
    Thanks.

    Hi
    Do yo see any record picked by DTP?
    was attributes pertaining to IO loaded?
    i hope..you have done following steps
    create the flat file sourcesytem
    then creaet datasource for text
    create IP(check preview before loading)
    once all the records have come to PSA(by scheduling IP)
    create a transformation (map the fileds)
    create DTP
    check the data in corresponding text table
    cheers,
    Swapna.G

  • How to find out duplicate record contained in a flat file

    Hi Experts,
    For my project I have written a program for flat file upload.
    Requirement 1
    In the flat file there may be some duplicate record like:
    Field1   Field2
    11        test1
    11        test2
    12        test3
    13        test4
    Field1 is primary key.
    Can you please let me know how I can find out the duplicate record.
    Requirement 2
    The flat file contains the header row as shown above
    Field1   Field2
    How our program can skip this record and start reading / inserting records from row no 2 ie
    11        test1
    onwards.
    Thanks
    S
    FORM upload1.
    DATA : wf_title TYPE string,
    lt_filetab TYPE filetable,
    l_separator TYPE char01,
    l_action TYPE i,
    l_count TYPE i,
    ls_filetab TYPE file_table,
    wf_delemt TYPE rollname,
    wa_fieldcat TYPE lvc_s_fcat,
    tb_fieldcat TYPE lvc_t_fcat,
    rows_read TYPE i,
    p_error TYPE char01,
    l_file TYPE string.
    DATA: wf_object(30) TYPE c,
    wf_tablnm TYPE rsdchkview.
    wf_object = 'myprogram'.
    DATA i TYPE i.
    DATA:
    lr_mdmt TYPE REF TO cl_rsdmd_mdmt,
    lr_mdmtr TYPE REF TO cl_rsdmd_mdmtr,
    lt_idocstate TYPE rsarr_t_idocstate,
    lv_subrc TYPE sysubrc.
    TYPES : BEGIN OF test_struc,
    /bic/myprogram TYPE /bic/oimyprogram,
    txtmd TYPE rstxtmd,
    END OF test_struc.
    DATA : tb_assum TYPE TABLE OF /bic/pmyprogram.
    DATA: wa_ztext TYPE /bic/tmyprogram,
    myprogram_temp TYPE ziott_assum,
    wa_myprogram TYPE /bic/pmyprogram.
    DATA : test_upload TYPE STANDARD TABLE OF test_struc,
    wa2 TYPE test_struc.
    DATA : wa_test_upload TYPE test_struc,
    ztable_data TYPE TABLE OF /bic/pmyprogram,
    ztable_text TYPE TABLE OF /bic/tmyprogram,
    wa_upld_text TYPE /bic/tmyprogram,
    wa_upld_data TYPE /bic/pmyprogram,
    t_assum TYPE ziott_assum.
    DATA : wa1 LIKE test_upload.
    wf_title = text-026.
    CALL METHOD cl_gui_frontend_services=>file_open_dialog
    EXPORTING
    window_title = wf_title
    default_extension = 'txt'
    file_filter = 'Tab delimited Text Files (*.txt)'
    CHANGING
    file_table = lt_filetab
    rc = l_count
    user_action = l_action
    EXCEPTIONS
    file_open_dialog_failed = 1
    cntl_error = 2
    OTHERS = 3. "#EC NOTEXT
    IF sy-subrc 0.
    EXIT.
    ENDIF.
    LOOP AT lt_filetab INTO ls_filetab.
    l_file = ls_filetab.
    ENDLOOP.
    CHECK l_action = 0.
    IF l_file IS INITIAL.
    EXIT.
    ENDIF.
    l_separator = 'X'.
    wa_fieldcat-fieldname = 'test'.
    wa_fieldcat-dd_roll = wf_delemt.
    APPEND wa_fieldcat TO tb_fieldcat.
    CALL FUNCTION 'MESSAGES_INITIALIZE'.
    CLEAR wa_test_upload.
    Upload file from front-end (PC)
    File format is tab-delimited ASCII
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = l_file
    has_field_separator = l_separator
    TABLES
    data_tab = i_mara
    data_tab = test_upload
    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.
    EXIT.
    ELSE.
    CALL FUNCTION 'MESSAGES_INITIALIZE'.
    IF test_upload IS NOT INITIAL.
    DESCRIBE TABLE test_upload LINES rows_read.
    CLEAR : wa_test_upload,wa_upld_data.
    LOOP AT test_upload INTO wa_test_upload.
    CLEAR : p_error.
    rows_read = sy-tabix.
    IF wa_test_upload-/bic/myprogram IS INITIAL.
    p_error = 'X'.
    MESSAGE s153 WITH wa_test_upload-/bic/myprogram sy-tabix.
    CONTINUE.
    ELSE.
    TRANSLATE wa_test_upload-/bic/myprogram TO UPPER CASE.
    wa_upld_text-txtmd = wa_test_upload-txtmd.
    wa_upld_text-txtsh = wa_test_upload-txtmd.
    wa_upld_text-langu = sy-langu.
    wa_upld_data-chrt_accts = 'xyz1'.
    wa_upld_data-co_area = '12'.
    wa_upld_data-/bic/zxyzbcsg = 'Iy'.
    wa_upld_data-objvers = 'A'.
    wa_upld_data-changed = 'I'.
    wa_upld_data-/bic/zass_mdl = 'rrr'.
    wa_upld_data-/bic/zass_typ = 'I'.
    wa_upld_data-/bic/zdriver = 'yyy'.
    wa_upld_text-langu = sy-langu.
    MOVE-CORRESPONDING wa_test_upload TO wa_upld_data.
    MOVE-CORRESPONDING wa_test_upload TO wa_upld_text.
    APPEND wa_upld_data TO ztable_data.
    APPEND wa_upld_text TO ztable_text.
    ENDIF.
    ENDLOOP.
    DELETE ADJACENT DUPLICATES FROM ztable_data.
    DELETE ADJACENT DUPLICATES FROM ztable_text.
    IF ztable_data IS NOT INITIAL.
    CALL METHOD cl_rsdmd_mdmt=>factory
    EXPORTING
    i_chabasnm = 'myprogram'
    IMPORTING
    e_r_mdmt = lr_mdmt
    EXCEPTIONS
    invalid_iobjnm = 1
    OTHERS = 2.
    CALL FUNCTION 'MESSAGES_INITIALIZE'.
    **Lock the Infoobject to update
    CALL FUNCTION 'RSDG_IOBJ_ENQUEUE'
    EXPORTING
    i_objnm = wf_object
    i_scope = '1'
    i_msgty = rs_c_error
    EXCEPTIONS
    foreign_lock = 1
    sys_failure = 2.
    IF sy-subrc = 1.
    MESSAGE i107(zddd_rr) WITH wf_object sy-msgv2.
    EXIT.
    ELSEIF sy-subrc = 2.
    MESSAGE i108(zddd_rr) WITH wf_object.
    EXIT.
    ENDIF.
    *****Update Master Table
    IF ztable_data IS NOT INITIAL.
    CALL FUNCTION 'RSDMD_WRITE_ATTRIBUTES_TEXTS'
    EXPORTING
    i_iobjnm = 'myprogram'
    i_tabclass = 'M'
    I_T_ATTR = lt_attr
    TABLES
    i_t_table = ztable_data
    EXCEPTIONS
    attribute_name_error = 1
    iobj_not_found = 2
    generate_program_error = 3
    OTHERS = 4.
    IF sy-subrc 0.
    CALL FUNCTION 'MESSAGE_STORE'
    EXPORTING
    arbgb = 'zddd_rr'
    msgty = 'E'
    txtnr = '054'
    msgv1 = text-033
    EXCEPTIONS
    OTHERS = 3.
    MESSAGE e054(zddd_rr) WITH 'myprogram'.
    ELSE.
    CALL FUNCTION 'MESSAGE_STORE'
    EXPORTING
    arbgb = 'zddd_rr'
    msgty = 'S'
    txtnr = '053'
    msgv1 = text-033
    EXCEPTIONS
    OTHERS = 3.
    ENDIF.
    *endif.
    *****update Text Table
    IF ztable_text IS NOT INITIAL.
    CALL FUNCTION 'RSDMD_WRITE_ATTRIBUTES_TEXTS'
    EXPORTING
    i_iobjnm = 'myprogram'
    i_tabclass = 'T'
    TABLES
    i_t_table = ztable_text
    EXCEPTIONS
    attribute_name_error = 1
    iobj_not_found = 2
    generate_program_error = 3
    OTHERS = 4.
    IF sy-subrc 0.
    CALL FUNCTION 'MESSAGE_STORE'
    EXPORTING
    arbgb = 'zddd_rr'
    msgty = 'E'
    txtnr = '055'
    msgv1 = text-033
    EXCEPTIONS
    OTHERS = 3.
    ENDIF.
    ENDIF.
    ELSE.
    MESSAGE s178(zddd_rr).
    ENDIF.
    ENDIF.
    COMMIT WORK.
    CALL FUNCTION 'RSD_CHKTAB_GET_FOR_CHA_BAS'
    EXPORTING
    i_chabasnm = 'myprogram'
    IMPORTING
    e_chktab = wf_tablnm
    EXCEPTIONS
    name_error = 1.
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ****Release locks on Infoobject
    CALL FUNCTION 'RSDG_IOBJ_DEQUEUE'
    EXPORTING
    i_objnm = 'myprogram'
    i_scope = '1'.
    ENDIF.
    ENDIF.
    PERFORM data_selection .
    PERFORM update_alv_grid_display.
    CALL FUNCTION 'MESSAGES_SHOW'.
    ENDFORM.

    Can you please let me know how I can find out the duplicate record.
    you need to split the records from flat file structure into your internal table ans use a delete ADJACENT duplicates comparing fields
    split flat_str into wa_f1 wa_f2 wa_f2 at tab_space.

  • Generate a text (flat) file

    i use oracle8
    my OS is DGUX (data general UNIX)
    i want to generate a text (or flat) file from columns in oracle tables by using a method other than using the command 'SPOOL'
    thanks

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Gints Plivna ([email protected]):
    you may use package utl_file<HR></BLOCKQUOTE>
    May i asking you? How to use this?
    I think we must adding in init.ora file
    and share our directory first. May you describe this more detail and give me example?
    null

  • Find out duplicate rows in a flat file before using sqlldr

    Hello i want to import via sqlldr from a flat file to a table inside my data base. My flat file has unfortunately some duplicate copies inside. So, i defined my upload table with two primary keys- date and time(and sometimes there are more than one row with the same time and date inside the flat file). These primaries are important to me because i want to use them for later tables and i can't use the direct path and parallel method by using primaries.
    Is there any tool which can find duplicate copies before i use sqlldr. But, the special case here is, that the rows not really duplicated but date and time rows twice. And for my interest it isn't necessary whether there are different values in the second row of the same date and time. The file contains data which is monitored every second and that's enough.
    It would be nice if someone could help me
    cheers

    I simply upload from sqlldr to staging tables first.
    The staging tables allow duplicates then I do what I need to do in regards to duplicates or missing data during the transfer from the staging tables to the real tables.
    The staging tables are also global temporary tables so I don't have to worry about cleaning them up or multiple sessions trampling each other.
    I have also used an external table on the datafile instead of sqlldr, this allows me to get rid of the staging table. But that is only good for very small datasets in the file being loaded.

  • How to prepare the Format of Flat file(Excel or Text file) for sales order

    Hi All,
    My requirement is to prepare the Flat File formats(Excel or Text file) for sales order Conversion using BAPI by COB.
    Needed Sample Excel or Text flat file .
    Thanks for all.
    Regards,
    Chowdary
    Moderator message : Search for available information. Thread locked. 
    Your similiar question [Flat files formats|Flat files formats] has been already locked for similiar reason.  Read forum rules before posting.
    Edited by: Vinod Kumar on Jul 8, 2011 9:36 AM

    Hi,
    You can use something like this:
    switch(cell.getCellType()) {
      case Cell.CELL_TYPE_STRING:
        System.out.println(cell.getRichStringCellValue().getString());
        break;
      case Cell.CELL_TYPE_NUMERIC:
        if(DateUtil.isCellDateFormatted(cell)) {
          System.out.println(cell.getDateCellValue());
        else {
          System.out.println(cell.getNumericCellValue());
        break;
        case Cell.CELL_TYPE_BOOLEAN:
          System.out.println(cell.getBooleanCellValue());
          break;
        case Cell.CELL_TYPE_FORMULA:
          System.out.println(cell.getCellFormula());
          break;
        default:
          System.out.println();
    Hope it helps,
    Daniel

  • How to load Cell Text (~8000 bytes) in HFM from a Flat File using FDMEE?

    Hi,
    There are numerous posts on OTN describing how to load cell text using the Create Memo API. However, we are struggling to know how do we use FDMEE to load Cell text which is about 8000 bytes from a flat file?
    Basically HFM gives us the flexibility to enter a Free-Form Cell Text with default size of 8000 bytes (which may be increased). However, when we try to manupilate FDMEE and load this to HFM, there is no place-holder/column in FDMEE Staging tables that has sufficient size to place such a long text. All the ATTR are not more than 20 bytes and UDx columns are only 75 bytes.
    Has anyone faced a similar issue and built a workaround for this problem?
    Thanks!

    Did you consider External Tables ?

  • How to find that which flat file is belongs to which application server?

    How to find that which flat file is belongs to which application server?

    Hi,
    Search im www.sap-img.com, you will get most of answers.
    Jogdand M B

  • Could not find the fields in Flat file, But able to see the fields in receiver Communcication channel

    Hi All,
    My scenario is Proxy to file, After testing my scenario the flatfile is getting generated without any errors.
    I can able to see all the fields in receiver communication channel payload. But some fields are missing in flatfile which is generated after conversion.
    This is my structure below
    Record
    ---Header
          a
          b
          e
          g
    ---Trailer
          c
          d
    ---Details
          e
          f
    And here is my content  conversion below
    Header.fieldFixedLengths   2,4,6,7
    Header.endSeparator         'nl'
    Trailer.fieldFixedLengths     3,5
    Trailer.endSeparator           'nl'
    Details.fieldFixedLengths    6,7
    Details.endSeparator          'nl'
    Actually in header there are nearly 34 fields, I can able to see all the 34 fields in reciever CC, But in generated flat file I can able to see only first 30 fields remaing 4 are missing in flat file.
    it is like in the above structure In Header there are a,b,e,g fields.I am getting a, b fields e and f are missing in flatfile.
    Thanks in advance.
    Please suggest me the solution.
    Thanks & Regards,
    Satish

    Hi Satish
    As you said 4 fields values are missing out of 34. Are those fields values are coming as blank in the file or not at all coming.
    Ex:
    you have 4 fields a,b,e,g and in channels you have defined length as 2,4,6,7
    If values for fields a,b,e,g are coming as 1,22,33,44444 respectively then the flat file is generated as
    1-22--33----4444--- (Consider - as space here)
    Now if you say e and g value then is the flat file generated as
    1-22---------------
    or
    1-22--
    Regards
    Osman

Maybe you are looking for