Question about reading generic tables with keys

Hello
I'm wondering if it's possible to read a generic table with key statement:
FIELD-SYMBOLS:
    <lv_key>         TYPE zconf_key,
    <lt_data_bi>     TYPE INDEX TABLE,
    <lt_data_ai>     TYPE INDEX TABLE,
    <ls_data_bi>     TYPE any,
    <ls_data_ai>     TYPE any.
* create data types
  CREATE DATA lt_data_bi TYPE (ls_node-data_table_type).
  ASSIGN lt_data_bi->* TO <lt_data_bi>.
  CREATE DATA lt_data_ai TYPE (ls_node-data_table_type).
  ASSIGN lt_data_ai->* TO <lt_data_ai>.
* do check
  LOOP AT <lt_data_ai> ASSIGNING <ls_data_ai>.
    ASSIGN COMPONENT 'KEY' OF STRUCTURE <ls_data_ai> TO <lv_key>.
    READ TABLE <lt_data_bi> WITH KEY key = <lv_key>
    ASSIGNING <ls_data_bi> BINARY SEARCH.
I receive the message: "The specified type has no structure and therefore no component called KEY" in the read statement above.
Does anyone has an idea what I can do here?
Regards,
  Mathias

Mathias Glockner wrote:
>     READ TABLE <lt_data_bi> WITH KEY key = <lv_key>
In your structure ls_data_bi there is no field called KEY . please check whether you have field KEY in structure
a®s

Similar Messages

  • Read internal table with key not equal to

    Hi,
    How can I read internal table with key not equal to some other field.
    Basically in read statement we can read only fields equal to others fields.

    Hi,
    Test the following Code you can Use Loop at for this But not Read Table
    DATA: BEGIN OF it_test OCCURS 10,
      f1(4),
      f2 TYPE i,
      f3(2),
      END OF it_test.
    DATA: it_test2 LIKE STANDARD TABLE OF it_test WITH HEADER LINE.
    it_test-f1 = '1000'.
    it_test-f2 = 10.
    it_test-f3 = 'B'.
    APPEND it_test TO it_test.
    it_test-f1 = '2000'.
    it_test-f2 = 10.
    it_test-f3 = 'A'.
    APPEND it_test TO it_test.
    it_test-f1 = '1000'.
    it_test-f2 = 10.
    it_test-f3 = 'B'.
    APPEND it_test TO it_test.
    it_test-f1 = '1000'.
    it_test-f2 = 10.
    it_test-f3 = 'A'.
    APPEND it_test TO it_test.
    it_test-f1 = '1000'.
    it_test-f2 = 40.
    it_test-f3 = 'A'.
    APPEND it_test TO it_test.
    LOOP AT it_test INTO it_test WHERE f3 NE 'A'.
      WRITE: / it_test-f1, it_test-f2, it_test-f3.
    ENDLOOP.
    Kind Regards,
    Faisal

  • Read the internal table with key

    Hi friends,
    decleration of internal table is :
    TYPES : BEGIN OF ty_qmel,
              qmart TYPE qmel-qmart,
              qmnum TYPE qmel-qmnum,
              qmtxt TYPE qmel-qmtxt,
              strmn TYPE qmel-strmn,
              ltrmn TYPE qmel-ltrmn,
              objnr TYPE qmel-objnr,
              qmdat TYPE qmel-qmdat,
            END OF ty_qmel.
    i have written the query as follows .
    SELECT  qmart qmnum qmtxt strmn ltrmn FROM qmel
       INTO CORRESPONDING FIELDS OF TABLE i_qmel
       FOR ALL ENTRIES IN i_qmel
       WHERE qmart EQ i_qmel-qmart.
    I am getting the data into 1_qmel.
    Let me know how to read this table with key...?
    Thanks in advance...

    Hi,
    Refer this code.
    *&      Form  SUB_COLLECT_DATA
          text
    FORM sub_collect_data.
    *--Local variables
      DATA : lv_count(3) TYPE c.
      IF NOT it_fpltc[] IS INITIAL.
        LOOP AT it_fpltc INTO wa_fpltc.
          lv_count = wa_fpltc-fpltr+3(3).
          wa_final-ccnum = wa_fpltc-ccnum.
          wa_final-rfzei = lv_count.
          CLEAR : wa_vbrk.
          READ TABLE it_vbrk INTO wa_vbrk WITH KEY rplnr = wa_fpltc-fplnr
                                                   BINARY SEARCH.
          IF sy-subrc EQ 0.
            wa_final-vbeln = wa_vbrk-vbeln.
            wa_final-bukrs = wa_vbrk-bukrs.
          ENDIF.
          APPEND wa_final TO it_final.
          CLEAR : wa_vbrk,
                  wa_fpltc,
                  lv_count.
        ENDLOOP.
    Regards,
    PRashant

  • Help to read a table with data source and convert time stamp

    Hi Gurus,
      I have a req and need to write a ABAP prog. As soon as i excute ABAP program it should ask me enter a data source name, then my ABAP prog has excute teh code, in ABAP code i have to read a table with this data source as key, sort time stamp from table and should display the data source and time stamp as output.
    As follows:
    Enter Data Source Name: 
    Then user enters : 2lis_11_vahdr
    Then out put should be "Data source  :"  10-15-2008.
    The time stamp format in table is 20,050,126,031,520 (YYYYMMDDhhmmss). I have to display as 05-26-2005. Any help would be apprciated.
    Thanks,
    Ram

    Hi Jayanthi Babu Peruri,
    I tried to extract YEAR, MONTH, DAY separately and using
    EDIT MASK written it.
    Definitely there will be some STANDARD CONVERSION ROUTINE will be there. But no idea about it.
    DATA : V_TS      TYPE TIMESTAMP,
           V_TS_T    TYPE CHAR16,
           V_YYYY    TYPE CHAR04,
           V_MM      TYPE CHAR02,
           V_DD      TYPE CHAR02.
    START-OF-SELECTION.
      GET TIME STAMP FIELD V_TS.
      V_TS_T = V_TS.
      CONDENSE V_TS_T.
      V_YYYY = V_TS_T.
      V_MM   = V_TS_T+4(2).
      V_DD   = V_TS_T+6(2).
      V_TS_T(2) = V_MM.
      V_TS_T+2(2) = V_DD.
      V_TS_T+4(4) = V_YYYY.
      SKIP 10.
      WRITE : /10 V_TS," USING EDIT MASK '____-__-________'.
              /10 V_YYYY,
              /10 V_MM,
              /10 V_DD,
              /10 V_TS_T USING EDIT MASK '__-__-__________'.
    If you want DATE alone, just declare the length of V_TS_T as 10.
    Regards,
    R.Nagarajan.
    We can -

  • Hi I have a question about shooting in Raw with my Canon EOS 6d. I'm in the process of learning photography and my goal was to start shooting in raw. I have Photoshop CS5. When I tried to edit my images in raw I received an error message stating, "The pho

    Hi I have a question about shooting in Raw with my Canon EOS 6d.
    I'm in the process of learning photography and my goal was to start shooting in raw.
    I have Photoshop CS5. When I tried to edit my images in raw I received an error message stating, "The photoshop camera raw plug-in did not recognize the format. If these files are from a camera, you may need to update your camera raw plug in."
    In researching the issue I read that to edit in raw you need a camera model requirement of at least 7.3 which only works with CS6. My version of CS5 is 6.0.0.205. Being new to all this I see that my options are to upgrade to CS6 or convert by using DNG converter and paying a monthly fee. Two things I know nothing about and don't know which is would be more beneficial.
    I'd appreciate any advise on which route to go and how upgrade and what it may cost. THANKS in advance!
    Heather

    In researching the issue I read that to edit in raw you need a camera model requirement of at least 7.3 which only works with CS6.
    That is correct. Your camera was first supported by Camera Raw 7.3. Camera Raw 7.3 will not work with CS5. You need CS6 or CC.
    Being new to all this I see that my options are to upgrade to CS6 or convert by using DNG converter and paying a monthly fee. Two things I know nothing about and don't know which is would be more beneficial.
    I'd appreciate any advise on which route to go and how upgrade and what it may cost.
    It all depends on your preferred workflow and your budget.
    Using the DNG converter is free. There is no monthly fee. You use the converter to convert all Raw files from the EOS 6D to DNGs then edit the DNGs in CS5. That's an extra step every time - every photo. Some people don't like the extra step. Others don't mind.
    Camera raw, DNG | Adobe Photoshop CC
    Or you can upgrade to CS6 (non-Cloud) and pay the upgrade fee
    Creative Suite 6
    Or join the Cloud and pay the monthly fee
    Or join the Photoshop Photography Program (US9.99/month) and get PS CC+LR

  • Read Table with key field - question

    Hi,
    Can you use the same key field more than once?
    For example:
      READ TABLE I_TVKWZ INTO I_TVKWZ_2 WITH KEY WERKS = '1004'
                                                                                    Werks = '1002'.
    I get an error when trying this.
    Is there an alternative?
    Thanks,
    John

    Hi John,
    try this:
    DATA: begin of itab occurs 0,
            werks like mseg-werks,
            i     type i,
          end   of itab.
    itab-werks = '1000'. itab-i = itab-i + 1. append itab.
    itab-werks = '1000'. itab-i = itab-i + 1. append itab.
    itab-werks = '2000'. itab-i = itab-i + 1. append itab.
    itab-werks = '3000'. itab-i = itab-i + 1. append itab.
    itab-werks = '5000'. itab-i = itab-i + 1. append itab.
    itab-werks = '5000'. itab-i = itab-i + 1. append itab.
    itab-werks = '7000'. itab-i = itab-i + 1. append itab.
    itab-werks = '7000'. itab-i = itab-i + 1. append itab.
    itab-werks = '9000'. itab-i = itab-i + 1. append itab.
    itab-werks = '9000'. itab-i = itab-i + 1. append itab.
    itab-werks = '9000'. itab-i = itab-i + 1. append itab.
    loop at itab where werks = '1000' or werks = '9000'.
    write: / itab-werks, itab-i.
    endloop.
    Regards, Dieter

  • Replacemnt for read table with key binary search

    as read table with
    READ TABLE gt_INT_CURR_VALUE into gs_int_curr_value
               WITH KEY gs_FS_EINA_KEY  BINARY SEARCH.
    the statement read tabel with key is absolute in ecc 6 so how to replace it .

    Hi subratt,
    internal tables with header lines are obsolete and in oo context (CLASS / METHOD code) forbidden.
    OK, you'd better use SORTED TABLE and FIELD-SYMBOLS to gt optimal code::
    READ TABLE gt_INT_CURR_VALUE into gs_int_curr_value
    WITH KEY gs_FS_EINA_KEY BINARY SEARCH.
    may be replaced with
    DATA:
      gt_INT_CURR_VALUE_SORTED LIKE SORTED TABLE OF  gs_int_curr_value
        WITH [NON-]UNIQUE KEY <fields of  gs_FS_EINA_KEY>.
    FIELD-SYMBOLS:
      <nt_curr_value> LIKE gs_int_curr_value.
    gt_INT_CURR_VALUE_SORTED = gt_INT_CURR_VALUE.
      READ TABLE gt_INT_CURR_VALUE_SORTED ASSIGNING <nt_curr_value>
        WITH TABLE KEY <key1> = gs_FS_EINA_KEY-<key1> ..  <keyn> = gs_FS_EINA_KEY-<keyn>.
    Regards,
    Clemens

  • Read Table with Key in a Deep Structure

    Hello,
    I'd like to read a table while comparing a value in a deep structure.  So in the following code the key ID is a deep structure within cs_purchase_order_message-purchase_order-item-value.
    For some reason code check returns no errors with the following code, but I get a short dump with a syntax error on id-value when I execute the code.
    read table cs_purchase_order_message-purchase_order-item assigning <fs_xml_item> with key id-value = <fs_item>-number_int.
    How do I use "with key" when the value is in a deep structure?
    Thanks,
    Matt

    Refer to example link below:
    http://sap.ittoolbox.com/groups/technical-functional/sap-dev/read-deep-structure-736023.
    Regards,
    Venkat.

  • Read table with key doubt

    Hi guys!
    Please, what can i do when i use the
    Read table xxxx WITH KEY tab_key = value ASSIGNING <fs>
    statement and there is more than one entry with the specified selection criteria? How can i return the values to an internal table?
    I need to get all the entries and i don't have the full table key.
    thanks!

    Hi Fabio,
    An efficient way to do this is to have your table sorted by a specific key.  Let's say I have a table with the feild material number.
    You can do this:
    data: lv_index like sy-tabix.
    sort itab by material_number.
    ready table itab with key material_number = yournumber
    binary search.
    if sy-subrc eq 0.
      move sy-tabix to lv_index. " this holds the index of your first material record
    now we loop at the table start at that index
      loop at itab index lv_index.
    perform your processing
    if we come accross a different material number - exit the loop.
      if itab-material_number ne yournumber.
        exit.
      endif.
    endloop.
    endif.
    This way you only processes the records you are looking for.
    thanks.
    JB

  • Question about how to create FORIGEN KEY constraints against XMLTYPE table

    Hi,
    1.I have a table called SNPLEX_DESIGN which is created as XMLTYPE, the XMLTYPE is refered to a registered XMLschema. The XMLschema has a data element called BATCH_ID, and I create a primary key for the SNPLEX_DESIGN table on the BATCH_ID. The SQL staement as
    ALTER TABLE SNPLEX.SNPLEX_DESIGN ADD (CONSTRAINT "BATCH_ID_PK" PRIMARY KEY(xmldata."BATCH_ID"))
    2. I have another table call SNPLEX_PROCESS which is a regual relational table with a column TOKENID. I would like to create a forign key on TOKENID which needs to refer to the SNPLEX_DESIGN table BATCH_ID_PK primary key.
    But I got error when I try to alter the SNPLEX_PROCESS table.
    SQL> ALTER TABLE "SNPLEX"."SNPLEX_PROCESS" ADD (CONSTRAINT "BATCH_ID_FK" FOREIGN KEY("TOKENID") RE
    FERENCES "SNPLEX"."SNPLEX_DESIGN"(xmldata."BATCH_ID"));
    ERROR at line 1:
    ORA-02298: cannot validate (SNPLEX.BATCH_ID_FK) - parent keys not found
    3. Can someone helps me on this.. I have no problem to create a foreign key in SNPLEX_DESIGN to refere primary key in relational table. But Why I can not do the other way around.
    Any assistances will be appreciated..
    Jinsen

    Hi Jinsen
    As mentioned in the error message not all rows in PROCESS have a corresponding value in DESIGN.
    To find out which are missing do some selects to compare your data or use the exception clause in the ALTER TABLE statement.
    e.g.: ALTER TABLE "SNPLEX"."SNPLEX_PROCESS" ADD (CONSTRAINT "BATCH_ID_FK" FOREIGN KEY("TOKENID") RE
    FERENCES "SNPLEX"."SNPLEX_DESIGN"(xmldata."BATCH_ID")) EXCEPTIONS INTO <exception table>
    Notice that you have to create the <exception table> with the script $ORACLE_HOME/rdbms/admin/utlexcpt.sql.
    Chris

  • Question about sorted, hashed tables, mindset when using OO concepts...

    Hello experts,
    I just want to make sure if my idea about sorted and hashed table is correct.Please give tips and suggestions.
    In one of my reports, I declared a structure and an itab.
    TYPES: BEGIN OF t_mkpf,
            mblnr           LIKE mkpf-mblnr,
            mjahr           LIKE mkpf-mjahr,
            budat           LIKE mkpf-budat,
            xblnr(10)       TYPE c,
            tcode2          LIKE mkpf-tcode2,
            cputm           LIKE mkpf-cputm,
            blart           LIKE mkpf-blart,
          END OF t_mkpf.
    it_mkpf       TYPE SORTED   TABLE OF t_mkpf WITH HEADER LINE
                                       WITH NON-UNIQUE KEY mblnr mjahr.
    Now, I declared it as a sorted table with a non-unique key MBLNR and MJAHR. Now suppose I have 1000 records in my itab. how will it search for a particular record?
    2. Is it faster than sorting a standard table then reading it using binary search?
    3. How do I use a hashed table effectively? lets say that I want to use hashed type instead of sorted table in my example above.
    4. I am currently practicing ABAP Objects and my problem is that I think my mindset when programming a report is still the 'procedural one'. How do one use ABAP concepts effectively?
    Again, thank you guys and have a nice day!

    Hi Viray,
    <b>The different ways to fill an Internal Table:</b>
    <b>append&sort</b>
    This is the simplest one. I do appends on a standard table and then a sort.
    data: lt_tab type standard table of ...
    do n times.
    ls_line = ...
    append ls_line to lt_tab.
    enddo.
    sort lt_tab.
    The thing here is the fast appends and the slow sort - so this is interesting how this will compare to the following one.
    <b>read binary search & insert index sy-tabix</b>
    In this type I also use a standard table, but I read to find the correct insert index to get a sorted table also.
    data: lt_tab type standard table of ...
    do n times.
    ls_line = ...
    read table lt_tab transporting no fields with key ... binary search.
    if sy-subrc <> 0.
      insert ls_line into lt_tab index sy-tabix.
    endif.
    enddo.
    <b>sorted table with non-unique key</b>
    Here I used a sorted table with a non-unique key and did inserts...
    data: lt_tab type sorted table of ... with non-unique key ...
    do n times.
    ls_line = ...
    insert ls_line into table lt_tab.
    enddo.
    <b>sorted table with unique key</b>
    The coding is the same instead the sorted table is with a unique key.
    data: lt_tab type sorted table of ... with unique key ...
    do n times.
    ls_line = ...
    insert ls_line into table lt_tab.
    enddo.
    <b>hashed table</b>
    The last one is the hashed table (always with unique key).
    data: lt_tab type hashed table of ... with unique key ...
    do n times.
    ls_line = ...
    insert ls_line into table lt_tab.
    enddo.
    <b>You Can use this Program to Test:</b>
    types:
      begin of local_long,
        key1 type char10,
        key2 type char10,
        data1 type char10,
        data2 type char10,
        data3 type i,
        data4 type sydatum,
        data5 type numc10,
        data6 type char32,
        data7 type i,
        data8 type sydatum,
        data9 type numc10,
        dataa type char32,
        datab type i,
        datac type sydatum,
        datad type numc10,
        datae type char32,
        dataf type i,
        datag type sydatum,
        datah type numc10,
        datai type char32,
        dataj type i,
        datak type sydatum,
        datal type numc10,
        datam type char32,
        datan type i,
        datao type sydatum,
        datap type numc10,
        dataq type char32,
        datar type i,
        datas type sydatum,
        datat type numc10,
        datau type char32,
        datav type i,
        dataw type sydatum,
        datax type numc10,
        datay type char32,
        dataz type i,
        data11 type numc10,
        data21 type char32,
        data31 type i,
        data41 type sydatum,
        data51 type numc10,
        data61 type char32,
        data71 type i,
        data81 type sydatum,
        data91 type numc10,
        dataa1 type char32,
        datab1 type i,
        datac1 type sydatum,
        datad1 type numc10,
        datae1 type char32,
        dataf1 type i,
        datag1 type sydatum,
        datah1 type numc10,
        datai1 type char32,
        dataj1 type i,
        datak1 type sydatum,
        datal1 type numc10,
        datam1 type char32,
        datan1 type i,
        datao1 type sydatum,
        datap1 type numc10,
        dataq1 type char32,
        datar1 type i,
        datas1 type sydatum,
        datat1 type numc10,
        datau1 type char32,
        datav1 type i,
        dataw1 type sydatum,
        datax1 type numc10,
        datay1 type char32,
        dataz1 type i,
      end of local_long.
    data:
      ls_long type local_long,
      lt_binary type standard table of local_long,
      lt_sort_u type sorted table of local_long with unique key key1 key2,
      lt_sort_n type sorted table of local_long with non-unique key key1 key2,
      lt_hash_u type hashed table of local_long with unique key key1 key2,
      lt_apsort type standard table of local_long.
    field-symbols:
      <ls_long> type local_long.
    parameters:
      min1 type i default 1,
      max1 type i default 1000,
      min2 type i default 1,
      max2 type i default 1000,
      i1 type i default 100,
      i2 type i default 200,
      i3 type i default 300,
      i4 type i default 400,
      i5 type i default 500,
      i6 type i default 600,
      i7 type i default 700,
      i8 type i default 800,
      i9 type i default 900,
      fax type i default 1000.
    types:
      begin of measure,
        what(10) type c,
        size(6) type c,
        time type i,
        lines type i,
        reads type i,
        readb type i,
        fax_s type i,
        fax_b type i,
        fax(6) type c,
        iter type i,
      end of measure.
    data:
      lt_time type standard table of measure,
      lt_meantimes type standard table of measure,
      ls_time type measure,
      lv_method(7) type c,
      lv_i1 type char10,
      lv_i2 type char10,
      lv_f type f,
      lv_start type i,
      lv_end type i,
      lv_normal type i,
      lv_size type i,
      lv_order type i,
      lo_rnd1 type ref to cl_abap_random_int,
      lo_rnd2 type ref to cl_abap_random_int.
    get run time field lv_start.
    lo_rnd1 = cl_abap_random_int=>create( seed = lv_start min = min1 max = max1 ).
    add 1 to lv_start.
    lo_rnd2 = cl_abap_random_int=>create( seed = lv_start min = min2 max = max2 ).
    ls_time-fax = fax.
    do 5 times.
      do 9 times.
        case sy-index.
          when 1. lv_size = i1.
          when 2. lv_size = i2.
          when 3. lv_size = i3.
          when 4. lv_size = i4.
          when 5. lv_size = i5.
          when 6. lv_size = i6.
          when 7. lv_size = i7.
          when 8. lv_size = i8.
          when 9. lv_size = i9.
        endcase.
        if lv_size > 0.
          ls_time-iter = 1.
          clear lt_apsort.
          ls_time-what = 'APSORT'.
          ls_time-size = lv_size.
          get run time field lv_start.
          do lv_size times.
            perform fill.
            append ls_long to lt_apsort.
          enddo.
          sort lt_apsort by key1 key2.
          get run time field lv_end.
          ls_time-time = lv_end - lv_start.
          ls_time-reads = 0.
          ls_time-readb = 0.
          ls_time-lines = lines( lt_apsort ).
          get run time field lv_start.
          do.
            add 1 to ls_time-readb.
            lv_i1 = lo_rnd1->get_next( ).
            lv_i2 = lo_rnd2->get_next( ).
            read table lt_apsort
              assigning <ls_long>
              with key key1 = lv_i1
                       key2 = lv_i2
              binary search.
            if sy-subrc = 0.
              <ls_long>-data11 = sy-index.
            endif.
            get run time field lv_end.
            subtract lv_start from lv_end.
            if lv_end >= ls_time-time.
              exit.
            endif.
          enddo.
          get run time field lv_start.
          do.
            add 1 to ls_time-reads.
            lv_i1 = lo_rnd1->get_next( ).
            lv_i2 = lo_rnd2->get_next( ).
            read table lt_apsort
              assigning <ls_long>
              with key key2 = lv_i1
                       key1 = lv_i2.
            if sy-subrc = 0.
              <ls_long>-data11 = sy-index.
            endif.
            get run time field lv_end.
            subtract lv_start from lv_end.
            if lv_end >= ls_time-time.
              exit.
            endif.
          enddo.
          get run time field lv_start.
          do fax times.
            lv_i1 = lo_rnd1->get_next( ).
            lv_i2 = lo_rnd2->get_next( ).
            read table lt_apsort
              assigning <ls_long>
              with key key1 = lv_i1
                       key2 = lv_i2
              binary search.
            if sy-subrc = 0.
              <ls_long>-data21 = sy-index.
            endif.
          enddo.
          get run time field lv_end.
          ls_time-fax_b = lv_end - lv_start.
          get run time field lv_start.
          do fax times.
            lv_i1 = lo_rnd1->get_next( ).
            lv_i2 = lo_rnd2->get_next( ).
            read table lt_apsort
              assigning <ls_long>
              with key key2 = lv_i1
                       key1 = lv_i2.
            if sy-subrc = 0.
              <ls_long>-data21 = sy-index.
            endif.
          enddo.
          get run time field lv_end.
          ls_time-fax_s = lv_end - lv_start.
          collect ls_time into lt_time.
          clear lt_binary.
          ls_time-what = 'BINARY'.
          ls_time-size = lv_size.
          get run time field lv_start.
          do lv_size times.
            perform fill.
            read table lt_binary
              transporting no fields
              with key key1 = ls_long-key1
                       key2 = ls_long-key2
              binary search.
            if sy-index <> 0.
              insert ls_long into lt_binary index sy-tabix.
            endif.
          enddo.
          get run time field lv_end.
          ls_time-time = lv_end - lv_start.
          ls_time-reads = 0.
          ls_time-readb = 0.
          ls_time-lines = lines( lt_binary ).
          get run time field lv_start.
          do.
            add 1 to ls_time-readb.
            lv_i1 = lo_rnd1->get_next( ).
            lv_i2 = lo_rnd2->get_next( ).
            read table lt_binary
              assigning <ls_long>
              with key key1 = lv_i1
                       key2 = lv_i2
              binary search.
            if sy-subrc = 0.
              <ls_long>-data11 = sy-index.
            endif.
            get run time field lv_end.
            subtract lv_start from lv_end.
            if lv_end >= ls_time-time.
              exit.
            endif.
          enddo.
          get run time field lv_start.
          do.
            add 1 to ls_time-reads.
            lv_i1 = lo_rnd1->get_next( ).
            lv_i2 = lo_rnd2->get_next( ).
            read table lt_binary
              assigning <ls_long>
              with key key2 = lv_i1
                       key1 = lv_i2.
            if sy-subrc = 0.
              <ls_long>-data11 = sy-index.
            endif.
            get run time field lv_end.
            subtract lv_start from lv_end.
            if lv_end >= ls_time-time.
              exit.
            endif.
          enddo.
          get run time field lv_start.
          do fax times.
            lv_i1 = lo_rnd1->get_next( ).
            lv_i2 = lo_rnd2->get_next( ).
            read table lt_binary
              assigning <ls_long>
              with key key1 = lv_i1
                       key2 = lv_i2
              binary search.
            if sy-subrc = 0.
              <ls_long>-data21 = sy-index.
            endif.
          enddo.
          get run time field lv_end.
          ls_time-fax_b = lv_end - lv_start.
          get run time field lv_start.
          do fax times.
            lv_i1 = lo_rnd1->get_next( ).
            lv_i2 = lo_rnd2->get_next( ).
            read table lt_binary
              assigning <ls_long>
              with key key2 = lv_i1
                       key1 = lv_i2.
            if sy-subrc = 0.
              <ls_long>-data21 = sy-index.
            endif.
          enddo.
          get run time field lv_end.
          ls_time-fax_s = lv_end - lv_start.
          collect ls_time into lt_time.
          clear lt_sort_n.
          ls_time-what = 'SORT_N'.
          ls_time-size = lv_size.
          get run time field lv_start.
          do lv_size times.
            perform fill.
            insert ls_long into table lt_sort_n.
          enddo.
          get run time field lv_end.
          ls_time-time = lv_end - lv_start.
          ls_time-reads = 0.
          ls_time-readb = 0.
          ls_time-lines = lines( lt_sort_n ).
          get run time field lv_start.
          do.
            add 1 to ls_time-readb.
            lv_i1 = lo_rnd1->get_next( ).
            lv_i2 = lo_rnd2->get_next( ).
            read table lt_sort_n
              assigning <ls_long>
              with table key key1 = lv_i1
                             key2 = lv_i2.
            if sy-subrc = 0.
              <ls_long>-data11 = sy-index.
            endif.
            get run time field lv_end.
            subtract lv_start from lv_end.
            if lv_end >= ls_time-time.
              exit.
            endif.
          enddo.
          get run time field lv_start.
          do.
            add 1 to ls_time-reads.
            lv_i1 = lo_rnd1->get_next( ).
            lv_i2 = lo_rnd2->get_next( ).
            read table lt_sort_n
              assigning <ls_long>
              with key key2 = lv_i1
                       key1 = lv_i2.
            if sy-subrc = 0.
              <ls_long>-data11 = sy-index.
            endif.
            get run time field lv_end.
            subtract lv_start from lv_end.
            if lv_end >= ls_time-time.
              exit.
            endif.
          enddo.
          get run time field lv_start.
          do fax times.
            lv_i1 = lo_rnd1->get_next( ).
            lv_i2 = lo_rnd2->get_next( ).
            read table lt_sort_n
              assigning <ls_long>
              with table key key1 = lv_i1
                             key2 = lv_i2.
            if sy-subrc = 0.
              <ls_long>-data21 = sy-index.
            endif.
          enddo.
          get run time field lv_end.
          ls_time-fax_b = lv_end - lv_start.
          get run time field lv_start.
          do fax times.
            lv_i1 = lo_rnd1->get_next( ).
            lv_i2 = lo_rnd2->get_next( ).
            read table lt_sort_n
              assigning <ls_long>
              with key key2 = lv_i1
                       key1 = lv_i2.
            if sy-subrc = 0.
              <ls_long>-data21 = sy-index.
            endif.
          enddo.
          get run time field lv_end.
          ls_time-fax_s = lv_end - lv_start.
          collect ls_time into lt_time.
          clear lt_sort_u.
          ls_time-what = 'SORT_U'.
          ls_time-size = lv_size.
          get run time field lv_start.
          do lv_size times.
            perform fill.
            insert ls_long into table lt_sort_u.
          enddo.
          get run time field lv_end.
          ls_time-time = lv_end - lv_start.
          ls_time-reads = 0.
          ls_time-readb = 0.
          ls_time-lines = lines( lt_sort_u ).
          get run time field lv_start.
          do.
            add 1 to ls_time-readb.
            lv_i1 = lo_rnd1->get_next( ).
            lv_i2 = lo_rnd2->get_next( ).
            read table lt_sort_u
              assigning <ls_long>
              with table key key1 = lv_i1
                             key2 = lv_i2.
            if sy-subrc = 0.
              <ls_long>-data11 = sy-index.
            endif.
            get run time field lv_end.
            subtract lv_start from lv_end.
            if lv_end >= ls_time-time.
              exit.
            endif.
          enddo.
          get run time field lv_start.
          do.
            add 1 to ls_time-reads.
            lv_i1 = lo_rnd1->get_next( ).
            lv_i2 = lo_rnd2->get_next( ).
            read table lt_sort_u
              assigning <ls_long>
              with key key2 = lv_i1
                       key1 = lv_i2.
            if sy-subrc = 0.
              <ls_long>-data11 = sy-index.
            endif.
            get run time field lv_end.
            subtract lv_start from lv_end.
            if lv_end >= ls_time-time.
              exit.
            endif.
          enddo.
          get run time field lv_start.
          do fax times.
            lv_i1 = lo_rnd1->get_next( ).
            lv_i2 = lo_rnd2->get_next( ).
            read table lt_sort_u
              assigning <ls_long>
              with table key key1 = lv_i1
                             key2 = lv_i2.
            if sy-subrc = 0.
              <ls_long>-data21 = sy-index.
            endif.
          enddo.
          get run time field lv_end.
          ls_time-fax_b = lv_end - lv_start.
          get run time field lv_start.
          do fax times.
            lv_i1 = lo_rnd1->get_next( ).
            lv_i2 = lo_rnd2->get_next( ).
            read table lt_sort_u
              assigning <ls_long>
              with key key2 = lv_i1
                       key1 = lv_i2.
            if sy-subrc = 0.
              <ls_long>-data21 = sy-index.
            endif.
          enddo.
          get run time field lv_end.
          ls_time-fax_s = lv_end - lv_start.
          collect ls_time into lt_time.
          clear lt_hash_u.
          ls_time-what = 'HASH_U'.
          ls_time-size = lv_size.
          get run time field lv_start.
          do lv_size times.
            perform fill.
            insert ls_long into table lt_hash_u.
          enddo.
          get run time field lv_end.
          ls_time-time = lv_end - lv_start.
          ls_time-reads = 0.
          ls_time-readb = 0.
          ls_time-lines = lines( lt_hash_u ).
          get run time field lv_start.
          do.
            add 1 to ls_time-readb.
            lv_i1 = lo_rnd1->get_next( ).
            lv_i2 = lo_rnd2->get_next( ).
            read table lt_hash_u
              assigning <ls_long>
              with table key key1 = lv_i1
                             key2 = lv_i2.
            if sy-subrc = 0.
              <ls_long>-data11 = sy-index.
            endif.
            get run time field lv_end.
            subtract lv_start from lv_end.
            if lv_end >= ls_time-time.
              exit.
            endif.
          enddo.
          get run time field lv_start.
          do.
            add 1 to ls_time-reads.
            lv_i1 = lo_rnd1->get_next( ).
            lv_i2 = lo_rnd2->get_next( ).
            read table lt_hash_u
              assigning <ls_long>
              with key key2 = lv_i1
                       key1 = lv_i2.
            if sy-subrc = 0.
              <ls_long>-data11 = sy-index.
            endif.
            get run time field lv_end.
            subtract lv_start from lv_end.
            if lv_end >= ls_time-time.
              exit.
            endif.
          enddo.
          get run time field lv_start.
          do fax times.
            lv_i1 = lo_rnd1->get_next( ).
            lv_i2 = lo_rnd2->get_next( ).
            read table lt_hash_u
              assigning <ls_long>
              with table key key1 = lv_i1
                             key2 = lv_i2.
            if sy-subrc = 0.
              <ls_long>-data21 = sy-index.
            endif.
          enddo.
          get run time field lv_end.
          ls_time-fax_b = lv_end - lv_start.
          get run time field lv_start.
          do fax times.
            lv_i1 = lo_rnd1->get_next( ).
            lv_i2 = lo_rnd2->get_next( ).
            read table lt_hash_u
              assigning <ls_long>
              with key key2 = lv_i1
                       key1 = lv_i2.
            if sy-subrc = 0.
              <ls_long>-data21 = sy-index.
            endif.
          enddo.
          get run time field lv_end.
          ls_time-fax_s = lv_end - lv_start.
          collect ls_time into lt_time.
        endif.
      enddo.
    enddo.
    sort lt_time by what size.
    write: / ' type      | size   | time        | tab-size    | directread  | std read    | time direct | time std read'.
    write: / sy-uline.
    loop at lt_time into ls_time.
      write: / ls_time-what, '|', ls_time-size, '|', ls_time-time, '|', ls_time-lines, '|', ls_time-readb, '|', ls_time-reads, '|', ls_time-fax_b, '|', ls_time-fax_s.
    endloop.
    form fill.
      lv_i1 = lo_rnd1->get_next( ).
      lv_i2 = lo_rnd2->get_next( ).
      ls_long-key1 = lv_i1.
      ls_long-key2 = lv_i2.
      ls_long-data1 = lv_i1.
      ls_long-data2 = lv_i2.
      ls_long-data3 = lv_i1.
      ls_long-data4 = sy-datum + lv_i1.
      ls_long-data5 = lv_i1.
      ls_long-data6 = lv_i1.
      ls_long-data7 = lv_i1.
      ls_long-data8 = sy-datum + lv_i1.
      ls_long-data9 = lv_i1.
      ls_long-dataa = lv_i1.
      ls_long-datab = lv_i1.
      ls_long-datac = sy-datum + lv_i1.
      ls_long-datad = lv_i1.
      ls_long-datae = lv_i1.
      ls_long-dataf = lv_i1.
      ls_long-datag = sy-datum + lv_i1.
      ls_long-datah = lv_i1.
      ls_long-datai = lv_i1.
      ls_long-dataj = lv_i1.
      ls_long-datak = sy-datum + lv_i1.
      ls_long-datal = lv_i1.
      ls_long-datam = lv_i1.
      ls_long-datan = sy-datum + lv_i1.
      ls_long-datao = lv_i1.
      ls_long-datap = lv_i1.
      ls_long-dataq = lv_i1.
      ls_long-datar = sy-datum + lv_i1.
      ls_long-datas = lv_i1.
      ls_long-datat = lv_i1.
      ls_long-datau = lv_i1.
      ls_long-datav = sy-datum + lv_i1.
      ls_long-dataw = lv_i1.
      ls_long-datax = lv_i1.
      ls_long-datay = lv_i1.
      ls_long-dataz = sy-datum + lv_i1.
      ls_long-data11 = lv_i1.
      ls_long-data21 = lv_i1.
      ls_long-data31 = lv_i1.
      ls_long-data41 = sy-datum + lv_i1.
      ls_long-data51 = lv_i1.
      ls_long-data61 = lv_i1.
      ls_long-data71 = lv_i1.
      ls_long-data81 = sy-datum + lv_i1.
      ls_long-data91 = lv_i1.
      ls_long-dataa1 = lv_i1.
      ls_long-datab1 = lv_i1.
      ls_long-datac1 = sy-datum + lv_i1.
      ls_long-datad1 = lv_i1.
      ls_long-datae1 = lv_i1.
      ls_long-dataf1 = lv_i1.
      ls_long-datag1 = sy-datum + lv_i1.
      ls_long-datah1 = lv_i1.
      ls_long-datai1 = lv_i1.
      ls_long-dataj1 = lv_i1.
      ls_long-datak1 = sy-datum + lv_i1.
      ls_long-datal1 = lv_i1.
      ls_long-datam1 = lv_i1.
      ls_long-datan1 = sy-datum + lv_i1.
      ls_long-datao1 = lv_i1.
      ls_long-datap1 = lv_i1.
      ls_long-dataq1 = lv_i1.
      ls_long-datar1 = sy-datum + lv_i1.
      ls_long-datas1 = lv_i1.
      ls_long-datat1 = lv_i1.
      ls_long-datau1 = lv_i1.
      ls_long-datav1 = sy-datum + lv_i1.
      ls_long-dataw1 = lv_i1.
      ls_long-datax1 = lv_i1.
      ls_long-datay1 = lv_i1.
      ls_long-dataz1 = sy-datum + lv_i1.
    endform.".
    Thanks & Regards,
    YJR.

  • Pros and cons of creating a table with key

    Hi Folks
    I have some tables where there is no key defined in the source system. What is the best way to build such tables. In my case the source system is Teradata.
    I have 25-30 columns in dimension and what is the best way to load this data where there is no.
    What will be the Pros and Cons if I have a table without a key  or if I create a table with 25-30 keys.
    regards
    Poonam

    I recently purchased a Mac Mini and am using it with my TV.  Here's what I found:
    Using the HDMI connection on the Mac Mini, the image on the TV is very harsh.  It's very bright, high contrast and garish colors.  I did a lot of testing and am convinced this is due to the HDMI Display Profile in OS X Yosemite.  I could not find any way to change the display profile in the Mac Mini as long as HDMI was the connection.
    Using the miniDisplayport/Thunderbolt connection on the Mac Mini, with the Apple miniDisplayPort-DVI adapter and a DVI-HDMI cable the picture is perfect.  (Note, however, that this connection only carries video; if you want audio you will have to use a separate cable to connect the Mac Mini audio line out port to your TV's audio line in port.)
    That said, the larger the TV the less quality you will have displaying text.  I suggest using a 21" or smaller TV as a monitor if you will be doing text work.
    My setup is with a 40" Sony Bravia 1080p HDTV and the primary use is for video (concerts, movies, Skype, etc), not office apps.   As I said earlier, the picture is perfect - brightness, contrast, colors, resolution are as nice as I could ask for.

  • Reg - Reading internal table with multiple record in a single field

    Dear Guru's,
                        i want to read a internal table with field having mutilple entries like
    read table READ TABLE LT_T2 INTO LT_T2_WA WITH KEY HKONT IN ( '0001152430', '0001152930', '0001152410' ).
    But it says comma without preceding colon (after READ?).
    please guide me.....
    thanks & Regards,
    Balaji.S

    ya this is inside the loop.
    plz check....
    loop at lt_t2 into lt_t2_wa.
    READ TABLE LT_T2 INTO LT_T2_WA WITH KEY HKONT IN ( '0001152430', '0001152930', '0001152410' ).
    endloop.
    thanks & Regards,
    Balaji.S

  • Dumb question about monodimensional internal tables

    Hi all gurus,
    in ABAP/4 it is possible to define an internal table made up by a single field , so that we could consider such a declaration:
    DATA: itab TYPE TABLE OF EBELN
    as a single-dimension array.
    Now, supposing I want to fast access this vector directly with a read table... I don't have an explicit field name to refer to in the WITH KEY clause.
    My workaround actually is to define such a vector in this way:
    DATA: begin of itab,
                doc_no TYPE EBELN,
                end of itab.
    so that a fast READ TABLE statement can be possible specifying the WITH TABLE clause in this way:
    READ TABLE itab WITH KEY doc_no = <valuetosearchfor>  .
    Anyway, I'm wondering if these ops are possible even in an itab defined in the first form, without the need of defining a specific itab structure. In many situation I find mono-dimensional tables really useful, I'd like to avoid every time an explicit DATA type def.

    Hello,
    I dont know if this is what you are looking for. You can use the addition:
    ... WITH TABLE KEY [keyname COMPONENTS] ...
    SAp documentation also adds:
    The pseudo component table_line can be specified as a component for tables with an unstructured row type, if their whole table entry is defined as a table key.
    For more details on psuedo components read this : [http://help.sap.com/abapdocu_70/en/ABENITAB_COMPONENTS.htm|http://help.sap.com/abapdocu_70/en/ABENITAB_COMPONENTS.htm]
    Hope this helps.
    BR,
    Suhas

  • How to update database table with key field?

    Hello Experts,
    I have a database table with following fields
    MATNR   - Key
    SSOUR  -  Key
    KUNNR   - Key
    MENG1 
    MENG2
    MENG3
    And this table contains records like...
    MSD50001     R      1000001     5.30    2.30    5.25
    MSD50002     R      1000002     5.30    2.30    5.25
    MSD50003     R      1000003     5.30    2.30    5.25
    MSD50005     R      1000004     5.30    2.30    5.25
    MSD50004     R      1000005     5.30    2.30    5.25
    I have an internal table with same fields of above database table.
    MSD50001     A      1000001     5.30    2.30    5.25
    MSD50002     A      1000002     5.30    2.30    5.25
    MSD50003     A      1000003     5.30    2.30    5.25
    MSD50005     A      1000004     5.30    2.30    5.25
    MSD50004     A      1000005     5.30    2.30    5.25
    MSD50006     A      1000006     5.30    2.30    5.25
    I want to update the DB table with following internal table records.
    If internal table records = db table records are same then Update....else insert from internal table to db table.
    But here, SSOUR is key field so i am not able to use
    MODIFY dbtab from itab.
    It results me , entries in internal table are inserted into db table.
    So i have double records.
    Is there any statement which updates the key field? and if no fields in db table then insert it?
    Regards
    RH

    hi,
    u cannot update akey field.u can update only non key fields by using key field as a selection criteria.For example if u go to sm30 if u enter any table for inserting values, the key field will always be greyed out it is not succumbed to chnges.but u can insert value into ,if ur inserting and in the insert staemnet if  u have key field which is already present in the table it will return sy-subrc = 4 otherwise it will insert the record and return 0.
    eg for update :
    UPDATE zdm_wtyprof  SET upload_status = 'S'
                             WHERE spart = wa_upd-spart.
    here spart is the key field and it will update the status field in the table as S.
    if updated succesfully it will return 0.
    SIMILARLY U CAN USE select.

Maybe you are looking for

  • How can I get the value of a custom property from a resource object?

    I am trying to get the value(s) of a custom property, called "status" within a method. The method has an object of type IResource available to it. I have tried the following: PropertyName propName = new PropertyName("","status"); value = res.getPrope

  • How to send program output as  mail in HTML format

    Hi Friends, I have a BDc which runs in background and its been Stored in my system and displayed as HTML format. My requirement is now i want that Same HTML file which i am displaying to be sent as a mail in HTML format itself..Kindly help me on this

  • Can a 3D view be called from JavaScript

    I have spent many hours looking for this solution, but haven't found the answer yet. I want to have a Flash movie call a 3D view. Thanks in advance for your help.

  • BLOG ENTRIES on FTP

    I have published my iweb on a ftp server but the blog entries doesn't appear ? what should I do?

  • Downloading and Updating, OSX Mountain Lion App Store

    Updated to Mountain Lion a while ago, went to update my apps a few days ago to realize nothing would happen. When I click download or update the box shades and the 'loading' wheel in the top left just keeps spinning forever. Nothing happens can anyon