How to MODIFY A CUSTOM TABLE  FROM A FLAT FILE

Dear Friends,
                 I have a requirement where i have to upload data from excel file to my custom table  so i have used a FM
'TEXT_CONVERT_XLS_TO_SAP' and i have collected data into a internal table , till here i am able to get data correctly , now i hae to upload this data into a custom table .
the flat file is having  6 fields and the custom table is having
8 fields , for uploading the data into this custom table from the internal table where i have collected above iam getting problem . Actually iam using a modify statement to update the custom table .
the flat file which i have collected into the internal table is as below :
  IDNo.     Name     Date      Location   Designation  Dept
  101       Raja      4/12/2007  Delhi      Manager      HR
  102       James    4/12/2007  Delhi      Clerk          HR
Custom table  is having the below fields
IDNO.  Name  Date  Location Designation  Dept   Manager
101                                                                   Raja
now when i run the program iam getting the problem   while usign the modify statment is the ID no which is already having
a record as  IDno = 101  and manger = Raja.......with the other fields   name , date, location,designation and dept as blank.
if i want to fill this fields from my flat file the modify statment
just filling all the fields  for the ID no = 101  and manager field which already having Raja as being overwritten by space .....
becasue this field is not being there in the flat file.
the code iam using as follows.
The flat file is having with the below structure
TYPES: BEGIN OF t_emp_data,
          IDNO(11) TYPE c,
         Name(13) TYPE c,
         Date(20) TYPE c,
          Location (40) TYPE c,
         Designation(40) TYPE c,
         Dept(40) TYPE c,
         end of t_emp_data.
The Custom Table(ZEMP_DATA) is having with the below structure
TYPES: BEGIN OF t_emp_data_table,
          IDNO(11) TYPE c,
         Name(13) TYPE c,
         Date(20) TYPE c,
          Location (40) TYPE c,
         Designation(40) TYPE c,
         Dept(40) TYPE c,
         Manager(20) type c,  -- this is the extra field in table
         end of t_emp_data_table.
data :
it_empdata TYPE STANDARD TABLE OF t_emp_data,
it_empdata_tmp TYPE STANDARD TABLE OF t_empdata_tmp,
wa_empdata_tmp  type t_empdata_tmp,
wa_empdata type t_emp_data.
loop at it_empdata into  wa_empdata.
  move-corresponding  wa_empdata to   wa_empdata_tmp.
  modify ZEMP_DATA  from  wa_empdata_tmp .
endloop.
could any one please let me know what i have to do inorder to not get the manager field data not being overwritten with the modify statment , for the IDNo. 101  . I want the data which is already ( manager = Raja) shouldnt not be get overwritten with Space.
please help me in this regard
Regards
Madhuri.

Hi,
use a slect statement before
"move-corresponding wa_empdata to wa_empdata_tmp."
select manager
from ztable
into wa_empdata_tmp-manager
where id = 100.
regards,
lavanya

Similar Messages

  • How to get a single table from a .db file

    Hello,
    We have taken a backup of our whole schema into a .db file. and by mistake one of our table in that schema got truncated. Is there any way we can restore only that table from the .db file?
    Please help.
    Thanks
    Ramesh

    It's not so easy. You could perform a point-in-time recovery of the whole database, where point-in-time is the moment just before the table was truncated. Big disadvantage is you lose all other changes made after the truncation,too. Or you restore to an auxiliary database, export the table and import it back into the source database.
    Werner

  • Error while loading  data into External table from the flat files

    HI ,
    We have a data load in our project which feeds the oracle external tables with the data from the Flat Files(.bcp files) in unix.
    While loading the data, we are encountering the following error.
    Error occured (Error Code : -29913 and Error Message : ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04063: un) while loading data into table_ext
    Please let us know what needs to be done in this case to solve this problem.
    Thanks,
    Kartheek

    Kartheek,
    I used Google (mine still works).... please check those links:
    http://oraclequirks.blogspot.com/2008/07/ora-29400-data-cartridge-error.html
    http://jonathanlewis.wordpress.com/2011/02/15/ora-29913/
    HTH,
    Thierry

  • How to download an Internal Table to a flat file

    Hi All,
    I have an Internal Table with 7 columns.I am using FM 'Gui_download'.The flat file is generating correctly.But I need to display the 7 fields vertically one after other instead of displaying horizontally.The internal table consists of only one record.
    Very Urgent
    Thanks

    Hi,
    do you know the ABAP Development? I think you should post your question there. Also have you tried the SDN Search?
    Regards
    Gregor

  • Create multiple external tables from same flat file ?

    using oracle 10g
    currently create many external tables like so..
    CREATE TABLE "XT_UNITS"
    "Q1_2012" VARCHAR2(25 BYTE),
    "Q2_2012" VARCHAR2(25 BYTE),
    "Q3_2012" VARCHAR2(25 BYTE),
    "Q4_2012" VARCHAR2(25 BYTE)
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER DEFAULT DIRECTORY "XE_FILES" ACCESS PARAMETERS ( records delimited BY newline
    skip 1 fields terminated BY ',' OPTIONALLY ENCLOSED BY '"' MISSING FIELD VALUES
    ARE NULL ) LOCATION ( 'xtunits.csv' ))
    is there any way I can use 1 flat file (csv) to populate many external tables ?
    maybe by section ?

    Jay wrote:
    using oracle 10g
    currently create many external tables like so..
    CREATE TABLE "XT_UNITS"
    "Q1_2012" VARCHAR2(25 BYTE),
    "Q2_2012" VARCHAR2(25 BYTE),
    "Q3_2012" VARCHAR2(25 BYTE),
    "Q4_2012" VARCHAR2(25 BYTE)
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER DEFAULT DIRECTORY "XE_FILES" ACCESS PARAMETERS ( records delimited BY newline
    skip 1 fields terminated BY ',' OPTIONALLY ENCLOSED BY '"' MISSING FIELD VALUES
    ARE NULL ) LOCATION ( 'xtunits.csv' ))
    is there any way I can use 1 flat file (csv) to populate many external tables ?
    maybe by section ?Not a logical question.
    An external table definition relates to one or more files.
    You could probably create multiple externable table definitions to access the same file(s), but you may end up with some operating system file locking issues if you're not careful, and to be honest why would you need to do that?

  • How can I copy a table from a web file and paste it into a word document on a pc?

    I am having diffculty getting a pdf file from a web document pasted into my word document.  I do no get the option to copy or save as a table.  I can copy and paste the text but I lose the table and the format and just get the text.  Anybody know what I can do to solve this?

    Try holding down the alt key as you mark the text to be copied. You can then copy columns to table text.

  • How to Restore a data table from a 'dmp' file in a database of oracle ?

    Hello,
    I want just to restore one table belonging in a database. I Have the dmp file which I must restore.
    Then I am asking if it's possible to restore only a table not all the databse ? If Yes, What I mut do to realize it ?
    I need really helps .
    Regards.

    Can I assume dmp file you refer to is a file created by using oracle "exp" command. If that be the case you can use the imp command to populate/refresh/re-create that particular object only.
    check this link for the information about imp.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/exp_imp.htm#sthref2517
    Regards
    Raj

  • How to read a table from a word file, using HWPF

    How can I read a table from a Word file using HWPF?
    I looked in API and Table class doesn't seem to have a constructor... very very strange for me. pls help

    the constructor is HWPFDocument = new HWPFDocument(/*file*/)
    Here is the API for that
    http://poi.apache.org/apidocs/org/apache/poi/hwpf/HWPFDocument.html
    Also here is another link to something that might help you more with tables
    http://www.aspose.com/Community/forums/thread/79182.aspx

  • 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

  • How to download the custom Tables to xls from the system?

    Hi
    How to download the custom Tables to xls from the system?
    Vijay

    Hi,
    Goto SE11, in the table name field give Z*, and click on display. You will get the list of Z tables.
    Regards,
    Prabu

  • "CX_SY_OPEN_SQL_DB" ERROR  when modifying a custom table

    Dear friends,
    I get this runtime error "DBIF_RSQL_SQL_ERROR"
    "CX_SY_OPEN_SQL_DB" excpetion raised while am trying to modify a custome table . says deadlock detected while waiting for resourcebelow is the code snippet please suggest solution on how to avoid the error. thanks for the help in advance.
    kathy
    *Get all packspec levels
      lt_levels                            =  iv_packspec_content-levels.
      loop at lt_levels into ls_levels.
        if ls_levels-hutyp is not initial.
          ls_zpackspec-guid                =  ls_levels-guid.
          ls_zpackspec-aennr               =  ls_levels-aennr.
          ls_zpackspec-total_quan          =  ls_levels-total_quan.
          ls_zpackspec-level_type          =  ls_levels-level_type.
          ls_zpackspec-/cfscmx/nest_fc     =  ls_levels-/cfscmx/nest_fc.
          ls_zpackspec-maxstack            =  ls_levels-maxstack.
          ls_zpackspec-unit_tw             =  ls_levels-unit_tw.
          ls_zpackspec-g_weight            =  ls_levels-g_weight.
          ls_zpackspec-unit_tv             =  ls_levels-unit_tv.
          ls_zpackspec-g_volume            =  ls_levels-g_volume.
          ls_zpackspec-trgqty              =  ls_levels-trgqty.
          ls_zpackspec-flg_minimum_ps      =  ls_levels-flg_minimum_ps.
          ls_zpackspec-creadat             =  sy-datum.
          ls_zpackspec-matid               =  iv_packspec_content-content-matid.
          ls_zpackspec-hu_create           =  ls_levels-hu_create.
          ls_zpackspec-unit_gw             =  ls_levels-unit_gw.
          ls_zpackspec-g_capa              =  ls_levels-g_capa.
          ls_zpackspec-unit_gv             =  ls_levels-unit_gv.
          ls_zpackspec-hutyp               =  ls_levels-hutyp.
          ls_zpackspec-block               =  ls_levels-block.
          ls_zpackspec-length              =  ls_levels-length.
          ls_zpackspec-width               =  ls_levels-width.
          ls_zpackspec-height              =  ls_levels-height.
          ls_zpackspec-unit_lwh            =  ls_levels-unit_lwh.
          ls_zpackspec-nest_ftr            =  ls_levels-nest_ftr.
          if not ls_elementgroup is initial.
            sort ls_elementgroup by guid.
            read table ls_elementgroup assigning <ps_el_group>
                                        with key guid = ls_levels-elementgroup
                                   binary search.
            if <ps_el_group> is assigned.
              ls_elemgroup = <ps_el_group>-elements.
            endif.
            sort ls_elemgroup by hurelevant.
            read table ls_elemgroup assigning <ps_elem>
                                     with key hurelevant = 1
                                binary search.
            if sy-subrc eq 0.
              ls_zpackspec-hurelevant      =  <ps_elem>-hurelevant.
            endif.
          endif.
          append ls_zpackspec  to  lt_zpackspec.
          clear  ls_zpackspec.
        endif.
      endloop.
    **Update Packspec data for each level in the table ZPACKSPEC.*
      *if not lt_zpackspec is initial.*
        *modify zpackspec from table lt_zpackspec.*
        *ev_zpackspec  =   lt_zpackspec.*
      *endif.*

    Kathy - do you have duplicate entries for the same key fields in the internal table you are using for the update?
    Rob

  • How to create the custom table?

    Hi, how to create the custom table and how to integrate the table with defferent R/3?
    my requiremnt is i have to create the two tables and those i have to integrate with the existed R/3 and using those R/3 i have to update my custom tables .....can give me some idea?
    Tks
    DPk

    how to create the custom table
    There are two approach in creating a table.
    1. Bottom-up approach
    2. Top-down approach.
    Both are valid and you can choose which approach is suitable for you. I always use the bottom-up approach. Here are the steps to create the tables with this approach.
    1. SE11 will take you to the DDIC and enter the name of the new table to be created. Let us say Zname. Click create.
    2. Enter the short discription of the table and enter the field of the table. If it is primary key and you have to check the box.
    3. Enter the data element and double click it, you will be asked to save and will take you to data element discription page. Enter the short discription of the data element and enter the information of domain like the length of field and type of field.
    4. If you wanted to use the existing domain then its fine, or else, you have to create one. Enter the domain name in the data element page and double click it. Page will ask to save and jump to domain creation page.
    5. In the domain page, you have to save the information which you have already given in the data elements page and check it. Before going to data element page, you have to activate the domain.
    6. Go to data element page and save, check and activate.
    7. Go to main table page and save, check, and activate.
    8. Also, you have to save the technical settings of the table.
    The table is now ready for operation. You can use it in your program or you can use it to enter information.
    Check table: It is the table which will have all the information about the Foreign keys which are the primary keys in the check table.
    It can be created by creating the foreign key from the main table. Click foreign key in the main table and it will take you to a page which will ask for table name and field to which foreign key relation has to be associated. Enter the information and you can create the check table automatically.
    SM30 is used for maintenance of the table, that is to realease the errors occured during the creation of the table.
    how to integrate the table with defferent R/3
    Transport the Table to the another server/client/qas/prd
    Kanagaraja L

  • How to access the database tables from application

    Hii all,
    The information in webcenter content, such as meta data fields, users, security groups etc are stored in
    database tables like-      Revisions, SecurityGroups, Users, DocType etc..
    Can we access this tables from an adf application or any webcenter application..
    If yes, then what can be the approach for that..??
    Another things, how can we create custom tables just like the predefined tables...??
    Any information regarding this.??
    Thanks

    Can we access this tables from an adf application or any webcenter application.Yes, you can - like to any other existing database. But I would strongly discourage you from any, but read-only access, or you can easily end up with inconsistent data.
    If yes, then what can be the approach for that..??Just create a database connection and define in your model what tables you want to access.
    Another things, how can we create custom tables just like the predefined tables...
    Actually, WebCenter Content provides functionality of creation of custom tables (see http://docs.oracle.com/cd/E23943_01/doc.1111/e10978/c04_metadata.htm#autoId2 ) and these are probably the only good candidates for read-write access. See further in the manual what use cases are supported. Of course, you could do this even externally, but rather than Data Definition Language, I'd use services (if there are some).

  • [b]How to create this Custom Table on Custom Schema with foreign key [/b]

    This Custom Table is create in Custom Schema and Refers to Seeded Table in APPS schema
    1 create table test_dff (test_id number(15) primary key,
    2* invoice_id number(15) constraint ap_test_fk REFERENCES ap_invoices_all(invoice_id) ON DELETE CASCADE)
    SQL> /
    invoice_id number(15) constraint ap_test_fk REFERENCES ap_invoices_all(invoice_id) ON DELETE CASCADE
    ERROR at line 2:
    ORA-02270: no matching unique or primary key for this column-list
    How to create this Custom Table on Custom Schema
    thanks in advance

    hi prashant
    sorry for replying late, i have checked your query and it gives me no rows, but if i check for user_cons_columns it gives me no rows either in APPS Schema, but in AP schema it gives me
    SQL> SELECT * FROM user_cons_columns WHERE table_name = 'AP_INVOICES_ALL';
    OWNER CONSTRAINT_NAME TABLE_NAME
    COLUMN_NAME
    POSITION
    AP SYS_C008177 AP_INVOICES_ALL
    INVOICE_ID
    SQL> SELECT constraint_name, constraint_type FROM user_constraints WHERE table_name = 'AP_INVOICES_A
    LL';
    CONSTRAINT_NAME C
    SYS_C008177 C
    SYS_C008178 C
    SYS_C008179 C
    SYS_C008180 C
    SYS_C008181 C
    SYS_C008182 C
    SYS_C008183 C
    SYS_C008184 C
    SYS_C008185 C
    SYS_C008187 C
    SYS_C008189 C
    SYS_C008191 C
    and since this is a combination of Unique and Not Null Constraints , i am getting the same issue. do u have any solution to make the Detail table records to delete without using Alerts/DB Triggers?
    thanks for your time .
    abdul rahman

  • How to modify the standard table

    plzzzzz answer my qestion.
    how to modify the standard table?
    in my knowedge we have the accese key is it correct or worng

    Hi
    <b>The system asks for access key only of two reasons:</b>
    1) You may be having problem of access rights. You would have to contact basis peopl.
    2) You may try to name an object not complying with the rules. You may have to check with the same.
    the process of getting access key is
    <b>the steps to get access key</b>
    you can also try via transaction OSS1
    In your Inbox, click on 'Registration', then on 'Register Objects', then you will have to choose your installation and give details about your object.
    The details you can get by going to your object and clicking on 'Change' - the pop-up screen which asks you for the access key gives you all the details you need to fill in on OSS1 to get your key.
    <b>or</b>
    U can get Access key from www.service.sap.com
    After getting into the site,select quicklinks, then click s to goto SSCR, in
    that select registration,
    after giving the proper details, u can get the access key
    <b>or</b>
    on sap support portal (sapnet)
    --> key & request
    ---> register SSCR key
    ---> registration
    ---> register developper
    and then choose your rigth installation number
    you can get the access key in this way
    <b>reward if usefull</b>

Maybe you are looking for