Validate the record while uploading into table

Hi,
I am uploading records into the table, and it so happened that an incorrect record full of text data was there in theinput file, it got uploaded along with the records,
hence I need to modify the code to check for such data -it is text data.
I have an 'empid' field (only numbers). I used that field to check for numeric data some thing like this...
if itab-empid+0(1) between '0' and '1'.
move-corresponding itab to DTABLE.
APPEND DTABLE.
else.
continue.
endif.
it is not working, throwing a short dump.
is there a better way to validate this? All I am doing is if empid field has any text data do not read into the internal table.
Thanks,
SK

Hi,
Check this, It will work.
if itab-empid CO '12345 67890'.
move-corresponding itab to DTABLE.
APPEND DTABLE.
else.
endif.
Regards
L Appana

Similar Messages

  • Turkish Special characters issue in ECC 6.0, while uploading into table

    HI All,
    We are working with Turkish special characters in ECC 6.0
    We are uploading a CSV file containing characters like : İ, Ğ, Ş, Ü, Ö, as soon as the file gets uploaded to application server,
    it gets converted to ? or # or Ý.
    Also, we are reading the file using OPEN DATASET, ENCODING NON-UNICODE, IGNORING CONVERSION ERRORS, the same characters gets uploaded into the custom table  i.e. Ý.
    I have also tried saving the file in UNICODE / UTF-8 format, but the issue still remains.
    I tried searching SAP Notes as well.
    Any pointers to resolve the same will be helpful.
    Regards,
    Siddhesh Sanghvi

    Dear Siddhesh,
    Perhaps OSS note 508854 could help here.
    Also please be aware that Turkish only runs on ISO codepage 8859-9 (aka Latin-5 / SAP codepage 1610).
    I hope this helps.
    Best regards,
    Ian Kehoe

  • How to use header information in line records while inserting into table?

    Hi,
    Requirement: Data in flat file needs to be loaded into Oracle Tables.
    File has header information (basically file information, some account info) and Line information ( Actual data need to be loaded to oracle tables).
    File has position based data, first 2 char for Header is 00 and line is 50
    Now, header has some extra info which needs to be loaded along with details lines ( This has to be done using sql loader control file).
    What should be the control file logic to capture header information in details lines?
    Please suggest.
    I am calling this control file from Unix, so I can change the control file definition dynamically by retrieving the first line of the data file and modify the control file before executing the sql loader command. Is there any option to achieve this using SQL LOADER commands?
    Thanks,
    Venkat.

    Pl post details of OS and database versions.
    Use the WHEN clause to load header and detail lines into separate tables, then write PL/SQL code to perform needed post-processing.
    See the examples in section titled "Distinguishing Different Input Record Formats" here http://docs.oracle.com/cd/E11882_01/server.112/e22490/ldr_control_file.htm
    HTH
    Srini

  • Validate the records in table maintainence generator

    hi to all experts,
    this is raj.............
    i have query to ask to all experts...
    "i have to validate the records or entries before populating
    into the table using table maintainence generator"
    can anybody help out in this...
    regards,
    raj
    Edited by: Julius Bussche on Oct 24, 2008 11:52 AM

    hi...
    write u r code in the screen number spicefied ...in PAI
    MODULE CHECK_BEFORE_INSERT  ON CHAIN-REQUEST.
    in this module u can write code for validation
    thanks
    sam

  • Need Help : Urgent : Making one of the record Bold in a Table

    Hi Frds,
    I am new to OAF.......
    I am  facing the issue that i have to make one of the record bold in a table...........
    By using the query, i m trying to display the payslip
    It contains the list of Earnings ,Deductions and NetPay amount..........
    this is the part of the query........
    select payment_date,element_name,arabic_name,val,balance from
      select '0' flag,assignment_id,null payment_date,'Payslip for the Month'  element_name,to_char(payment_date,'Month-YYYY')arabic_name,
       null val, null balance from xx_payroll_info
    where 1 =1
    and payment_date = last_day(:2) 
    and assignment_id = (select assignment_id from xx_people_reporting_info
        where person_id = :1)
    union all
    select '1'flag,assignment_id,payment_date,element_name,arabic_name,
       value val,null,balance
      from xx_payslip_details_mv
    where 1 = 1
    and payment_date = last_day(:2)
    and earn_deduct = ('E')
    and assignment_id in (select assignment_id from xx_people_reporting_info)
    union all
    select '2' flag,assignment_id,payment_date,'Earnings-Total',null,sum(value) val,null
      from xx_payslip_detail_mv
    where 1 =1
    and payment_date = last_day(:2)
    and earn_deduct = 'E'
    and assignment_id in (select assignment_id from xx_people_reporting_info
           where 1 =1
                and person_id = :1 )
    group by assignment_id,payment_date
    My Requirement is : I have to make the Payslip For the month of , Date, Earnings-Total  into Bold.....  How can i do this.... plz... help me out in this......
    Thanks &Regards,
    Jaya

    Hi Jaya,
    Set CSS Class property as  OraDataText for respectiveb column.
    OR
    /In Controller PR
                    import oracle.cabo.style.CSSStyle;
                    CSSStyle customCss = new CSSStyle();
                     customUnCss.setProperty("text-transform","uppercase");
                     customUnCss.setProperty("font","bold 16px \"Trebuchet MS\", Verdana, sans-serif");//# -red
                     OAMessageStyledTextBean styledTextBean =(OAMessageStyledTextBean)webBean.findIndexedChildRecursive("POCommentsItem");
                     if(styledTextBean!=null)
                      styledTextBean.setInlineStyle(customUnCss);
           Thanks,
            Dilip

  • How can one  read a Excel File and Upload into Table using Pl/SQL Code.

    How can one read a Excel File and Upload into Table using Pl/SQL Code.
    1. Excel File is on My PC.
    2. And I want to write a Stored Procedure or Package to do that.
    3. DataBase is on Other Server. Client-Server Environment.
    4. I am Using Toad or PlSql developer tool.

    If you would like to create a package/procedure in order to solve this problem consider using the UTL_FILE in built package, here are a few steps to get you going:
    1. Get your DBA to create directory object in oracle using the following command:
    create directory TEST_DIR as ‘directory_path’;
    Note: This directory is on the server.
    2. Grant read,write on directory directory_object_name to username;
    You can find out the directory_object_name value from dba_directories view if you are using the system user account.
    3. Logon as the user as mentioned above.
    Sample code read plain text file code, you can modify this code to suit your need (i.e. read a csv file)
    function getData(p_filename in varchar2,
    p_filepath in varchar2
    ) RETURN VARCHAR2 is
    input_file utl_file.file_type;
    --declare a buffer to read text data
    input_buffer varchar2(4000);
    begin
    --using the UTL_FILE in built package
    input_file := utl_file.fopen(p_filepath, p_filename, 'R');
    utl_file.get_line(input_file, input_buffer);
    --debug
    --dbms_output.put_line(input_buffer);
    utl_file.fclose(input_file);
    --return data
    return input_buffer;
    end;
    Hope this helps.

  • I have to validate the field enter in that table  values is enter in the ra

    i have one table field with data
    1. <=0.5
    2. <=1
    3.textsfsfs
    4. >=2 like that
    i have to validate the field enter in that table  values is enter in the range of the above field.
    can you help me how to validate
    ex:
    if wa-upper =  wa2-sumplus  here i have to check the upper and lowe values
    if the user enter in between and eq based on the i have to give erro message.
    Please help me the same.
    Thanks
    Ramkumar

    Hi Lekha,
    Thank you this problem was solve.
    we did the this validation in back end insted of front end.
    i passed the table data in to ZFM there we are validating and giving the error message.
    thank you for helping me all the time.
    ONE problem:
    LV_TEXT is the context attribut containe type string.
    i amgetting the values in to LV_TEXT attribut.
    LV_TEXT = nkafjkafkafhkafksfkak<b>#</b>bshfsafkasfkasfkas.
    i wanto to split this and will get the before <b>#</b> values in to other other node workarea LS_dis_new.
    this LS_DIS_NEW i have to modify with table LT_DIS_NEW.
    i used the code : Split wa at '#' into table LT_DIS_NEW.
    this is not working.
    please help me the same.
    Thanks
    Ramkumar

  • Loading issue : Error: sql error in the database while accessing a table

    Hello,
    where as one of the DTP in the process chain failed due to  *Error: sql error in the database while accessing a table*, where as in the short dump it showing as Transaction log of data base is full., but i checked the data base space in DB02, more space is available . once we run the same DTP by manually its successful. its not through  any errors.
    could u please help me out solve the problem.
    Thanks
    siva kumar.

    it might be a lock. do you drop index before loading?
    the database might be full at the moment of loading and not later if many loadings happen at the same time on the same system...
    when you then rerun your dtp manually, it can go through as it's perhaps the only one running at that moment...
    you can try to set the btch parameter to 1...this will help in some cases.
    M.

  • How to check the records in Master Data Table?

    Hi,
       I am trying to load the Master Data Table using the Flat File.Now how to check the records in Master Data Table?
    I done the following way:
    Info Provider->Info Object->Right Click->Display Data or Maintain Master Data
    But it's not showing the records.It's asking like CID from......To......
                                                                        CID(SID)from.............To.......
                                                                         here CID means customer id(characteristic).
    and showing some settings.
    Please guide me.
    Thanks & Regards

    Hi Sri,
    Go to T- code RSD1 and type your info object name and open the P- table in the infoobject then select execute symbol to see the updated  data in to master data info object.
    regards
    sap

  • How to insert the select query result into table?

    How to insert the select query result into table?
    SELECT  top 20 creation_time  
            ,last_execution_time 
            ,total_physical_reads
            ,total_logical_reads  
            ,total_logical_writes
            , execution_count 
            , total_worker_time
            , total_elapsed_time 
            , total_elapsed_time / execution_count avg_elapsed_time
            ,SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,
             ((CASE statement_end_offset 
              WHEN -1 THEN DATALENGTH(st.text)
              ELSE qs.statement_end_offset END 
                - qs.statement_start_offset)/2) + 1) AS statement_text
    FROM sys.dm_exec_query_stats AS qs
    CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) st
    ORDER BY total_elapsed_time / execution_count DESC;
    Thanks,
    Tirumala

    1. SELECT INTO
    Below method will create table when data is inserted from one table to another table. Its useful when you need exactly same datatype as source table.
    Use AdventureWorks2008R2;
    Go
    ---Insert data using SELECT INTO
    SELECT AddressLine1, City
    INTO BothellAddresses
    FROM Person.Address
    where City = 'Bothell';
    GO
    ---VERIFY DATA
    Select AddressLine1, City
    FROM BothellAddresses
    ---DROP TABLE
    DROP TABLE BothellAddresses
    GO
    2. INSERT INTO SELECT
    Below method will need table to be created prior to inserting data. Its really useful when table is already created and you want insert data from
    another table.
    Use AdventureWorks2008R2;
    Go
    ---Create Table
    CREATE TABLE BothellAddresses (AddressLine1 NVARCHAR(60), City NVARCHAR(30))
    ---Insert into above table using SELECT
    INSERT INTO BothellAddresses(AddressLine1, City)
    SELECT AddressLine1, City
    FROM Person.Address
    where City = 'Bothell';
    ---VERIFY DATA
    Select AddressLine1, City
    FROM BothellAddresses
    ---DROP TABLE
    DROP TABLE BothellAddresses
    GO
    Regards,
    Vishal Patel
    Blog: http://vspatel.co.uk
    Site: http://lehrity.com

  • I press the record while i do live stream. where does the video saved at in my computer?

    i press the record while i do live stream. where does the video saved at??

    iMovie (Apple), Pinnacle Studio is another. But there a number in the app store. and that is just if you are limited to the iPad.

  • Avoiding duplicate records while inserting into the table

    Hi
    I tried the following insert statement , where i want to avoid the duplicate records while inserting itself
    but giving me the errror like invalid identifier, though the column exists in the table
    Please let me know Where i'm doing the mistake.
    INSERT INTO t_map tm(sn_id,o_id,txt,typ,sn_time)
       SELECT 100,
              sk.obj_id,
              sk.key_txt,
              sk.obj_typ,
              sysdate,
              FROM S_KEY sk
        WHERE     sk.obj_typ = 'AY'
              AND SYSDATE BETWEEN sk.start_date AND sk.end_date
              AND sk.obj_id IN (100170,1001054)
               and   not exists  (select 1
                                                                   FROM t_map tm1 where tm1.O_ID=tm.o_id
                                                                        and tm1.sn_id=tm.sn_id
                                                                        and tm1.txt=tm.txt
                                                                        and tm1.typ=tm.typ
                                                                        and tm1.sn_time=tm.sn_time )

    Then
    you have to join the table with alias tml where is that ?do you want like this?
    INSERT INTO t_map tm(sn_id,o_id,txt,typ,sn_time)
       SELECT 100,
              sk.obj_id,
              sk.key_txt,
              sk.obj_typ,
              sysdate,
              FROM S_KEY sk
        WHERE     sk.obj_typ = 'AY'
              AND SYSDATE BETWEEN sk.start_date AND sk.end_date
              AND sk.obj_id IN (100170,1001054)
               and   not exists  (select 1
                                                                   FROM t_map tm where sk.obj_ID=tm.o_id
                                                                        and 100=tm.sn_id
                                                                        and sk.key_txt=tm.txt
                                                                        and sk.obj_typ=tm.typ
                                                                        and sysdate=tm.sn_time )

  • Urgent: Error while uploading into pdf file

    Hi ,
    I got a requirement that converting smartform into pdf file and sending into application server, And uploading the that pdf file into presentation server once a day am geting error when uploading into pdf format from application server .
    Error : There was an  error while tryinging to parse an image.
    Please help me out its urgent.
    Thanks in advance
    Regards
    krishna
    Edited by: krishna rao on Feb 13, 2008 12:05 PM

    U can use this code
    Reward if useful
    REPORT  ZMN_PDF_UPLOAD.
    data: begin of itab occurs 0,
    field(256),
    end of itab.
    data: dsn(100) value '\usr\sap\DEV\DVEBMGS00\work\testpdf',
    length like sy-tabix,
    lengthn like sy-tabix.
    call function 'GUI_UPLOAD'
    exporting
    filename = 'c:\temp\test.pdf'
    filetype = 'BIN'
    importing
    filelength = length
    tables
    data_tab = itab.
    open dataset dsn for output in binary mode.
    loop at itab.
    transfer itab-field to dsn.
    endloop.
    close dataset dsn.
    clear itab.
    refresh itab.
    *To crosscheck if it went well
    open dataset dsn for input in binary mode.
    do.
    read dataset dsn into itab-field.
    if sy-subrc = 0.
    append itab.
    else.
    exit.
    endif.
    enddo.
    call function 'GUI_DOWNLOAD'
    exporting
    filename = 'c:\temp\testn.pdf'
    filetype = 'BIN'
    bin_filesize = length
    importing
    filelength = lengthn
    tables
    data_tab = itab.
    *Or
    *Use the TCode
    *CG3Z or CG3Y
    *for downloading to Application Server.

  • Use of sequence numbers while inserting into tables

    Hi,
    Consider i have a stored procedure where i insert records into 30 to 40 tables.
    for example i have a table A and a sequence SEQ_A for that table.
    Is there any difference in performance in the following two ways of
    insertion,
    1. select SEQ_A.NEXTVAL into variable_a FROM DUAL;
    INSERT INTO A VALUES(variable_a);
    2.INSERT INTO A VALUES (SEQ_A.NEXTVAL).
    I have 30 to 40 insert statements like that in method 1.
    if i replace it by method 2. will there be any improvement in performance?
    Thanks & Regards
    Sundar

    This could be interesting. I agree that triggers should be used for data integrity, though even better is to only allow write access to tables via stored procedures.
    Anyway while you are waiting for the test case that shows triggers are faster, which could take some time, it is quick and easy to come up with a test case that shows the opposite.
    SQL> create table t (id number, dummy varchar2(1));
    Table created.
    real: 40
    SQL> insert into t select s.nextval, 'a' from all_objects;
    29625 rows created.
    real: 5038
    SQL> rollback;
    Rollback complete.
    real: 40
    SQL> create trigger tt before insert on t
      2  for each row
      3  begin
      4     select s.nextval into :new.id from dual;
      5  end;
      6  /
    Trigger created.
    real: 291
    SQL> insert into t select null, 'a' from all_objects;
    29626 rows created.
    real: 13350
    SQL> rollback;
    Rollback complete.
    real: 1082
    SQL>Note with triggers even the rollback took longer.
    Martin

  • How to remove carraige return from the field while loading external table

    I am facing an issue of not getting rid of carraige returns present in the fileds of the source .csv file while loading the records into external table.
    I had tried using LRTRIM, but it does not help.
    The error I am getting is:
    KUP-04021: field formatting error for field POPULATION_DESCRIPTION
    KUP-04037: terminator not found
    I am pasting one record out of the .csv file which is causing this error as below:
    "Business Card Accounts
    ",123,7 BizCard - Gamers,Control,"Business Card Accounts
    ",75270,75271
    You can see the carraige return in the 1st field as well as 5th field. Filed are separated by commas & eclosed by double quotes.
    Could anybody help on this please?

    Can you copy the file to an external table only version, and then dos2unix it?
    Alternatively, you can use the ACCESS PARAMETERS area in your external table definition to set that your RECORDS DELIMITED BY carriage returns, instead of the default.
    Check out the example here http://www.psoug.org/reference/externaltab.html

Maybe you are looking for

  • SharePoint TempDB.mdf growing too large? I have to restart SQL Server all the time. Please help

    Hi there, On our DEV SharePoint farm > SQL server The tempdb.mdf size grows too quickly and too much. I am tired of increasing the space and cannot do that anymore. All the time I have to reboot the SQL server to get tempdb to normal size. The Live f

  • How to determine actual colors in a black and white photo?

    I'm not sure if I'm in the right section, but I'm wondering if it's possible to use an Adobe program to restore actual colors in a black and white photo? I don't want add color by imagining or guessing; I need to determine the real colors. This might

  • Inter org transfer accross OUs and LEs

    Can I make an inter org transfer across OUs?If yes, what is the advantage of an ISO vis-a-vis IO transfer? Can I do an inter org transfer across LEs as well?

  • DBAdapter not working in SOA 11g

    Hi All, I created a simple composite to insert a row in database table. However, it 's failing. I have set up the weblogic server per the following link: http://download.oracle.com/docs/cd/E12839_01/integration.1111/e10231/life_cycle.htm#BABJFGGF - t

  • Exporting XDCAM from Premiere CC2014 to SxS Card

    Hi There, I am Running Adobe Premiere CC 2014 with My Sony PMW-500 Occasionally I need to master my edit to an SXS card. I export an MXF OP1a from the time line with the settings relevant to my camera. I then open Content browser and select the SxS c