Unicode issueAssigning database table data to a string field of a structure

Hi All,
This is piece of code where it is throwing the error in ERP 6.0 but this is working fine in SAP 4.6c.
select * into datatab-data from catsdb
where pernr IN select_pernr.
datatab-pernr = datatab-data+3(8).
datatab-tabname = 'CATSDB'.
datatab-dtype = 'C'.
where CATSDB is transparent table with 108 fields.
and datatab is a structure of type ZHCLONE_DATATAB in a Function Module defined with 4 fields PERNR,DTYPE,TABNAME,DATA.
data is a charater field of length 4999.
Error:CATSDB and DATATAB-DATA are not mutually convertable in unicode conversion.
Any pointers to this would be highly appreciated.
Thanks in advance.
Regards,
Rizwana.
Edited by: Rizwana Parveen on Jun 27, 2008 7:33 AM

Hi,
The Data in the table CATSDB cannot be copied directly into the field datatab-data if the catsdb contains any non-character type fields.
1>First take a work area
wa_catsdb like line of catsdb
2>Select the data from catstab into the the workarea
select * into wa_catstab from catsdb
where pernr IN select_pernr.
3>Now transform the workarea into the datatab-data variable
If the catstab contains complete character fields we can use direct move statement,else we need to use following method
class cl_abap_char_utilities definition load.
    CALL METHOD cl_abap_container_utilities=>read_container_c
  EXPORTING
    im_container               = wa_catstab
  IMPORTING
    ex_value           = datatab-data
  EXCEPTIONS
    illegal_parameter_type = 1
    OTHERS                 = 2.

Similar Messages

  • Oracle Database Table data Load it into Excel

    Hello All,
    Please I need your help for this problem:
    I need to load Oracle database Table data and load it into Excel and saved with xls format.
    Example -Select * from Slase data load it into the Excel.
    I appreciate ans sample code to help me do that, Please help me out. This is very urgent.
    Thanks alot and best regards,
    anbu

    >
    I need to load Oracle database Table data and load it into Excel and saved with xls format.
    Example -Select * from Slase data load it into the Excel.
    I appreciate ans sample code to help me do that, Please help me out. This is very urgent.
    >
    Nothing in these forums is 'urgent'. If you have an urgent problem you should contact Oracle support or hire a consultant.
    You have proven over and over again that you are not a good steward of the forums. You continue to post questions that you say are 'urgent' but rarely take the time to mark your questions ANSWERED when they have been.
    Total Questions: 90 (78 unresolved)
    Are you willing to make a commitment to to revisit your 78 unresolved questions and mark them ANSWERED if they have been?
    The easiest way to export Oracle data to Excel is to use sql developer. It is a free download and this article by Jeff Smith shows how easy it is
    http://www.thatjeffsmith.com/archive/2012/09/oracle-sql-developer-v3-2-1-now-available/
    >
    And One Last Thing
    Speaking of export, sometimes I want to send data to Excel. And sometimes I want to send multiple objects to Excel – to a single Excel file that is. In version 3.2.1 you can now do that. Let’s export the bulk of the HR schema to Excel, with each table going to it’s own workbook in the same worksheet.
    >
    And you have previously been ask to read the FAQ at the top of the thread list. If you had done that you would have seen that there is a FAQ for links that have many ways, with code, to export data to Excel.
    5. How do I read or write an Excel file?
    SQL and PL/SQL FAQ

  • Will HANA database table to insert a CLOB field , how to operate ?

    Will HANA database table to insert a CLOB field , how to operate ?
    Prior to this , I also see the related documentation : http://scn.sap.com/thread/3242930,
    So I used the link : http://docs.oracle.com/javase/tutorial/jdbc/basics/blob.html elaborated way to perform the operation to insert CLOB
    But practice tells me does not work, will be reported abnormal:"com.sap.db.jdbc.exceptions.jdbc40.SQLFeatureNotSupportedException: Method createClob() of ConnectionSapDB is not supported.".
    I want to know is , HANA how to insert CLOB field ? In this first say thank you !

    This is a problem with the driver. It is a known bug/issue.
    You have to use the dbms_lob.write procedure and append data to the clob inside a loop.
    i.e. do something like (pseudo-code)
    while(file.not_end)
    char[] buffer= file.read(start_pos,bytes_read);
    dmbs_lob.write(buffer);
    start_pos = start_pos+ bytes_read;
    null

  • Main Table data load u2013 UNSPSC fields is not loading

    I am new to SAP MDM
    I have the main table data that includes UNSPSC field. UNSPSC (hierarchy) table is already loaded.
    It works fine when I use import manager with field mapping and value mapping. (UNSPSC field value mapping is done).
    When I use the import server using the same map to load the main table data with UNSPSC field (in this case the UNSPSC field value is different but UNSPSC lookup table has that value) , UNSPSC field is not loading but all other fields are loaded including images and PDF's with new values
    If I go to the import manager and do the value mapping again for the UNSPSC field with the new value then save the map and use the import server to load the data then it is loading correctly.
    My question when we use the import server, main table data with UNSPSC codes value will be different  each time and it doesnu2019t make sense to go to the import manager and do the value mapping and saving the import map  before loading the data again.
    What I am missing here?.  Anyone can help me?

    Could anyone clarify this?
    Issue: UNSPSC field value mapping automatically by using the import server while loading the Main table.
    This issue was resolved yesterday and still works fine with the remote system MDC UNSPSC.
    Is there anyn settings in the ' Set MDIS Unmapped value handling'? (Right click on the field Product hierarchy  field at the destination side). By default it is setting to 'Add' for both the working remote system as well as the non working remote system
    SAP MDM 5.5 SP6 and I am using the standard Product Master repository
    I tried this in a different remote system MDC R/3 & ERP and it worked some time and didnu2019t work later. If it is working then during the UNSPSC code field mapping,  it automatically maps the values also.
    The destination side the main table Products and the destination side [Remote key] field is displayed.
    Source file, I have only 3 fields and they are Product No, Product Name and UNSPSC Category and UNSPSC Category is mapped to the destination field Product Hierarchy field(lookup hierarchy)
    Do I have to map any field  or clone any field and map to the [Remote Key Field]  in the destination side? If yes, what field I have to clone and map it to the Remote Key filed? Is there any other settings necessary. I am not using any matching with this field or any other field.
    Steve.
    Edited by: SteveLat on Oct 8, 2009 11:57 PM
    Edited by: SteveLat on Oct 9, 2009 12:03 AM
    Edited by: SteveLat on Oct 9, 2009 12:47 AM

  • Issue creating a Database table with a decimal key field

    Hi guys!
    Can you try this?
    - Create a Database Table ZTEST via SE11 with just the client field and a decimal field (which has to be a key field)
    - Create a corresponding text table for ZTEST with SPRAS, and a TEXT field
    - Create the dialog maintance view and enter some random data through SM30 (5 or 6 rows)
    Then go to SE11, display table ZTEST and click contents to show the data you just entered.
    Is there anything strange? In my case there is, actually: Not all text fields are shown, nevertheless if i try to display the data through SM30 the data is shown correctly....
    I've tried this in several releases and is always the same.
    Do you know why this is?
    Thanks in advance.

    Thanks for the answer.
    Unfortunately, this is not the case, the tables are correctly linked.
    Please look at the following snapshot, the first one, corresponds to the SE11 of the original table, the second one is the SE11 of the text table, and finally the third one is the SM30 of the original table.
    [Snapshot|http://img100.imageshack.us/img100/5071/testkl.jpg]

  • Determine data type of string field

    I am trying to determine the data type of input strings in a data flow task.  For each column in the input (all of which are strings) I want to sample X number of records, try to cast them as money, date, boolean, etc and if 100% of X records pass then
    use the first data type that passes the test.  I looked into row sample but this doesn't appear to be the right data flow task.  Can anyone point me in the right direction?
    Thanks!

    You have two tasks:  find the datatype by looking at X rows; cast all rows to the popular datatype.
    What I use is the TryParse method that occurs on several datatypes in .Net (http://msdn.microsoft.com/en-us/library/f02979c7(v=vs.110).aspx).  It returns true if it parses
    and false if it doesn't.  I have used this in a profiling package that reads a CSV and stores counts of values that can be converted to different datatypes.
    The second piece is trickier.  If you can afford, I would add a second dataflow.  The first dataflow looks at a sample of the data and determines the datatype. You assign that to a variable.  Then the second one has a derived column that has
    a set of derived columns, each with a formula like this:
    @DataType == "Int"?(DT_I4)[Column]:NULL(DT_I4)
    Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com

  • Table of origin for a field in extract structure ??

    Is there a way to look at the extract structure of a datasource and know the tables from which its pulling the data from ?
    I know I can always get them from help.sap.com by going to datasources and can look at the table of origin for a particular field...
    I was wondering if I can look at the same information on the system.
    I appreciate your replies ..
    Thanks,
    Rishi.

    Rishi,
       we can know get the tables in different ways, the best way and easy way to search the tables is HELP.SAP.COM as you said. you can use communication structure, ST05, SM50.
    All the best.
    Regards,
    Nagesh Ganisetti.

  • Duplicates in a database table

    Hi !
    I have a database table. It has 4 fields. 3 of them are key.
    Table (f1,f2,f3,f4)
    f1,f2,f3: key
    f4: numeric field.
    From a ABAP program, I can insert (using insert sentence) two records with the same key. why ???
    Then, if I try ....
    select f1 f2 f3 sum(f4)
    from table
    group by f1 f2 f3
    ... it doesn´t work. This sentence returns two records. Why ?
    (some fields of the key can be nulls)
    Thanks.

    HI,
    From a ABAP program, I can insert (using insert sentence) two records with the same key. why ???
    first of all It is not at all possible. There should be atleast one key value different for 2 data-row in database table. It is the fundamental concept of key. Your above statement holds for nonkey vaule or partial key field view/selection only.
    for next query,
    Instead of
    select f1 f2 f3 sum(f4)
    from table
    group by f1 f2 f3........
    use
    select distinct f1 f2 f3 sum(f4)
    from table
    group by f1 f2 f3............
    Regards,
    Anirban

  • File-to-rfc ..database tables are not updating??

    hi xi friends..
    in my file -to-rfc scenario.. without BPM ..
    in sxmb_moni..it is showing successfull.. database tables in sap not updating..
    my source structure..
    workorders 1..1
    ..order 1..unbounded
    ...id
    ...operation 1..unbounded
    .....id
    .....closingdate
    .....status
    .....comment
    my target is Zbapi_alm_conf_create..
    Zbapi_alm_conf_create
    ...Zdetail_return 1..1
    .....item 0..unbounded
    ...Ztimetickets
    .....item 0..unbounded
    .......orderid
    .......operation
    .......fin_conf
    .......con_text
    .......exec_fin_date
    in message mapping:
    MM_file_to_zrfc
    i changed the occurance of target to unbounded..
    message mapping like this..
    my source structure..
    workorders 1..1 
    ..order 1..unbounded   --------->Zrfc 0..unbouned
    ...id                  --------->Ztimetickets-item-order
    ...operation 1..unbounded ------>Ztimetickets-item 0..unbounded
    .....id                ---------->Ztimeticktes-item-operation
    .....closingdate       ----------->Ztimeticktes-item-exec_fin_date
    .....status            ----------->Ztimetickets-item-fin_conf
    .....comment           ------------>Ztimeticktes-item-conf_text
    and also in  interfacemapping ,changed the target occurance to unbounded.
    and in ID ,interface determination using enhanced i selected interface mapping with occurance unbounded..
    in sxmb_moni it is showing success..
    in adapter monetering( receiver).
    <i>Receiver channel 'cc_sap_work' for party '', service 'SAP_ERP__DEV' (internal name 'RfcClient[cc_sap_work]')
    Client data: {jco.client.lang=EN, jco.client.snc_mode=0, jco.client.client=400, jco.client.passwd=****, jco.webas.ignore_jdsr_error=1, jco.client.user=aar, jco.client.sysnr=10, jco.client.ashost=53.247.192.84}
    Repository data: {jco.client.lang=EN, jco.client.snc_mode=0, jco.client.client=400, jco.client.passwd=****, jco.webas.ignore_jdsr_error=1, jco.client.user=thotv, jco.client.sysnr=10, jco.client.ashost=53.247.192.84}
    Current pool size: 0, maximum pool size : 1
    Channel History
    - OK: 2006-12-31 14:19:47 CET: Message processed for interface ZBAPI_ALM_CONF_CREATE
    - OK: 2006-12-31 14:18:50 CET: Message processed for interface ZBAPI_ALM_CONF_CREATE</i>
    but the database tables are not updating..if i execute ZBAPI_ALM_CONF_CREATE manually in SAP ..tables are updating...
    please guide me...
    thanks in advance...
    regards
    Ram

    Hi..
    my mappis is like this..
    message                   message
    .message1                         message1       
    ..workorders 1..1 
    ..order 1..unbounded   -
    >Zrfc 0..unbouned
    ...id                  -
    >Ztimetickets-item-order
    ...operation 1..unbounded -
    >Ztimetickets-item 0..unbounded
    .....id                -
    >Ztimeticktes-item-operation
    .....closingdate       -
    >Ztimeticktes-item-exec_fin_date
    .....status            -
    >Ztimetickets-item-fin_conf
    .....comment           -
    >Ztimeticktes-item-conf_text
    i didnt mapped message at root..is this necessary to mapp messages??
    please tell me
    regards
    ram

  • After creating a customizing database table 'create entries disable'

    After creating the database table i want to add fields through goto-table contents-create entries but "create entries" is in disable mode how can i resolve this?

    Dear Dileep,
    You need to go to "Delivey and Maintainence" tab there you will "Data Browser/Table Maintainence",
    Here you need to select "Display/Maintainence Allowed" in the drop down list.
    Thie will help to find the "create entrie enable".
    Thanks,
    Ananth.

  • How to modify or put entry in a particular field of a database table

    i want to to modify a field in a database table record identification by primary key fileds
    the situatio is like this
    there are two primay key in database table
    customer number PK
    status PK
    date
    and third field which i want to modify is customer part number.
    based on condition that
    database table1-cuspip = wa_record-cuspip.
    database table1-status <> wa_record-status
    and database table-date = wa_record-date
    if above is true a particular field  the database table  for that record
    ie customer_part_number = 'FAiled'.
    loop at it_record into wa_Record
    endloop.
    please suggest how to modify the database table record if the avove condition is tru and please give me full working code
    regards
    Arora

    Dear Nishant,
    Use UPDATE function for updating the customer part number.
    But please do mention the database table and the keys used for update.
    if en entry already exists with the key then the Entry will fail so use MODIFY statement to modify the Consumber Part Number  with the specificed keys  and transport the modified customer part number and then do COMMIT the changed entry to database.
    Hope this helps you in some way.
    Encourage others to answer you queries by suitably rewarding them.
    Thanks
    Venugopal

  • THE DATA FROM THE ORACLE DATABASE VIEW DATA IS NOT REFERESHED AUTOMATICALLY

    THE DATA FROM THE ORACLE DATABASE VIEW DATA IS NOT REFERESHED AUTOMATICALLY IN OBIEE DASHBOARD(ANSWERS)
    UNLESS AND UNTILL I OPEN THE ORACLE BI ADMINISTRATOR TOOL AND DO UPDATE ALL ROWCOUNT AND THEN SAVE THE RPD.
    WHERE AS ORACLE DATABASE TABLE DATA IS AUTOMATICALLY REFRESHED.
    PLS SOMEONE HELP OUT IN THIS ISSUE.

    Check whether you have enable cache on that view?

  • Field name in database table

    Hi,
    Can we give the filed names start with '/' character, (like /name)? I saw like these field names in standard table MARA. How we create those fields in Z tables?
    Thanks.

    That are fields in Include structure.
    Yes u can create field with / in ur ztable.
    first create a structure by selection data type radio button in se11.
    in that structure create fields with /.
    NOTE: field must have 2 /.
    i.e ur field must be /str/struct1.
    activate it.
    now in ur database table goto edit menu select
    include->insert
    Give ur structure name .
    Message was edited by:
            Kalpanashri Rajendran

  • Download multiple table data using RTTI

    Hi,
    Using RTTI, I am trying to download database table data dynamically. I have code that works fine for one table at a time. If I need to download data from multiple tables in one go. How can I  do this using RTTI?
    Thanks in advance,
    VG
    My code is...
    DATA: go_struct TYPE REF TO cl_abap_structdescr,
                go_table TYPE REF TO cl_abap_tabledescr,
                gi_data type ref to data.
          FIELD-SYMBOLS: <gi_data> TYPE STANDARD TABLE.
    * Dynamically getting the line type of the specified table
          go_struct ?= cl_abap_typedescr=>describe_by_name( v_tabname ) .
          TRY.
              CALL METHOD cl_abap_tabledescr=>create
                EXPORTING
                  p_line_type  = go_struct
                  p_table_kind = 'S'
                RECEIVING
                  p_result     = go_table.
            CATCH cx_sy_table_creation .
    *MESSAGE e000 WITH text-004.
          ENDTRY.
    * creating internal table of table type just created
          CREATE DATA gi_data TYPE HANDLE go_table.
    * Assigning the internal table to field symbol
          ASSIGN gi_data->* TO <gi_data>.
    ** get the data into the internal table from db table
          SELECT * INTO TABLE <gi_data> FROM (v_tabname).
    download....
    CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
    *      filename                = 'C:\test.txt'
          filename                = p_file1
          write_field_separator   = 'X'
        TABLES
            data_tab               = <gi_data>
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6
          header_not_allowed      = 7
          separator_not_allowed   = 8
          filesize_not_allowed    = 9
          header_too_long         = 10
          dp_error_create         = 11
          dp_error_send           = 12
          dp_error_write          = 13
          unknown_dp_error        = 14
          access_denied           = 15
          dp_out_of_memory        = 16
          disk_full               = 17
          dp_timeout              = 18
          file_not_found          = 19
          dataprovider_exception  = 20
          control_flush_error     = 21
          OTHERS                  = 22.
      IF sy-subrc = 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Edited by: Thomas Zloch on Nov 5, 2010 9:42 AM - please use code tags

    Hi,
    DATA: go_struct TYPE REF TO cl_abap_structdescr,
    go_table TYPE REF TO cl_abap_tabledescr,
    gi_data type ref to data.
    FIELD-SYMBOLS: <gi_data> TYPE STANDARD TABLE.
    LOOP AT GT_TAB_LIST INTO GS_TAB_LIST.
    * Dynamically getting the line type of the specified table
    go_struct ?= cl_abap_typedescr=>describe_by_name( GS_TAB_LIST-tabname ) .
    TRY.
    CALL METHOD cl_abap_tabledescr=>create
    EXPORTING
    p_line_type = go_struct
    p_table_kind = 'S'
    RECEIVING
    p_result = go_table.
    CATCH cx_sy_table_creation .
    *MESSAGE e000 WITH text-004.
    ENDTRY.
    * creating internal table of table type just created
    CREATE DATA gi_data TYPE HANDLE go_table.
    * Assigning the internal table to field symbol
    ASSIGN gi_data->* TO <gi_data>.
    ** get the data into the internal table from db table
    SELECT * INTO TABLE <gi_data> FROM ( GS_TAB_LIST-tabname ).
    download....
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    * filename = 'C:\test.txt'
    filename = p_file1
    write_field_separator = 'X'
    TABLES
    data_tab = <gi_data>
    EXCEPTIONS
    file_write_error = 1
    no_batch = 2
    gui_refuse_filetransfer = 3
    invalid_type = 4
    no_authority = 5
    unknown_error = 6
    header_not_allowed = 7
    separator_not_allowed = 8
    filesize_not_allowed = 9
    header_too_long = 10
    dp_error_create = 11
    dp_error_send = 12
    dp_error_write = 13
    unknown_dp_error = 14
    access_denied = 15
    dp_out_of_memory = 16
    disk_full = 17
    dp_timeout = 18
    file_not_found = 19
    dataprovider_exception = 20
    control_flush_error = 21
    OTHERS = 22.
    IF sy-subrc = 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    endloop.

  • Deleting and updating database table

    hi all,
    i have to update the database table based on my internal table(both having same structure).
    my database has 2 records having a key field 1 and 2 respectively.(2 records)
    and my internal table has records with key fields 3, 4 and 5 respectively(3 records) .
    i want to delete all data from database table first..
    then i want to insert all the three records in the database table..
    finally i want my database to have 3 records with key fields 3, 4 and 5 respectively that are in the internal table
    what should be the correct way?

    Hi ,
    to delete all the records from dbtab
    DELETE dbtab.
    to update the database by using internal table
    -MODIFY dbtab       FROM TABLE itab.
    but as per my knowledge structures of internal table and database table should be same
    if the database table is a Ztable please change the structure of database table as you said
    Put fields 3,4and 5 as key fields
    Thanks & Regards,
    Sateesh.

Maybe you are looking for

  • IPod PRO

    OK, we all love the iPod, but there are a large number of users that don't think a $3 Digital to Analog converter (that CAN'T be bypassed) is acceptable audio quality in 2008 while the audio on the iPod hard drive is much better if you use Apple loss

  • CD/DVD drive is dead (+ some more)

    My CD/DVD combo drive is dead, and I'm looking for a do-it-yourself fix. Some important notes (maybe): -It started with a CD getting stuck in the tray during one of my many logic board freezes. When I restarted the computer, the CD wouldn't come out,

  • Cant convert to dvd format?

    i exported my 2hour, 1920X1080 hd , video out and it is 60gb, i then put it into compressor with dvd 120 best quality preset. When i click submit, i see the file in process but the time left is --:--:-- and the bar never move. A while more, the statu

  • Improve performance of query with order by

    Hello, I have a query with a necessary "order by" which lasts 24 seconds. The same query without the "order by" lasts 1 second. How can I improve the performance of the query with "order by"? Thank you very much. The query is: select distinct CC.acce

  • Delete on-the-go list

    Hello, anybody knows if it´s possible delete a list from On-the-go playlist. I don´t want some lists anymore and I have not found the way to do it. My ipod is classic 80GB. Any idea? Thanks