How to use Read table with out key fields

Hi Experts,
I need to retrieve the 2 internal tables data into single table.
I have 3 common fields between the 2 tables but I don't have the Key fields. Then how to use the read table in this.
Thanks in Advance.
Edited by: satish4abap on Mar 10, 2010 9:39 AM

Hi Satish,
Key fields are nothing but the common fields with which you can pick the data from the second internal table.
If you can paste your Internal table fields then we will be able to assit you better.
However, in genral scenarios you can use it as below :
In this scenario, we are putting data from 3 internal table to another single internal table.
LOOP AT T_PRGEN INTO WA_PRGEN.
       WA_FINAL-GUID_PR       = WA_PRGEN-GUID_PR.
       WA_FINAL-ATTR20A       = WA_PRGEN-ATTR20A.
       WA_FINAL-ATTR05A       = WA_PRGEN-ATTR05A.
       WA_FINAL-ATTR05B       = WA_PRGEN-ATTR05B.
       WA_FINAL-ATTR05C       = WA_PRGEN-ATTR05C. " + DG1K902190
       WA_FINAL-ATTR10A       = WA_PRGEN-ATTR10A.
    READ TABLE T_V_TCAV201 INTO WA_V_TCAV201 WITH KEY ATTRV20 = WA_PRGEN-ATTR20A BINARY SEARCH.
    IF SY-SUBRC = 0.
      WA_FINAL-TEXT1   = WA_V_TCAV201-TEXT1.    "SUBID-TEXT1
    ENDIF.
    READ TABLE T_PNTPR INTO WA_PNTPR WITH KEY GUID_PR = WA_PRGEN-GUID_PR BINARY SEARCH.
    IF SY-SUBRC = 0.
       WA_FINAL-PRVSY  = WA_PNTPR-PRVSY.   "PROD NO
       WA_FINAL-GRVSY  = WA_PNTPR-GRVSY.   "LOGICAL SYS GROUP
    ENDIF.
  append wa_final to t_final.
endloop.

Similar Messages

  • How to make entriesinto table with out first field not edited

    hi everyone,
    I'm new to SAP ,the task provided to me is to display the data in the display fields when the particular cell in table is selected
    at the same time a button is provided make new entries into the table by clicking a button
    but when iclick the new entry button the row which is already selected getting erased temporarily
    but when i update the new record and save it it is also shown along with new record
    the code i used is here below
    method onactioncreate .
    DATA:
          node_expenseset                     TYPE REF TO if_wd_context_node,
          elem_expenseset                    TYPE REF TO if_wd_context_element,
          stru_expenseset                    TYPE if_exp_main=>element_expenseset .
    *   navigate from <CONTEXT> to <EXPENSESET> via lead selection
        node_expenseset = wd_context->get_child_node( 'EXPENSESET' ).
    *   @TODO handle not set lead selection
        IF ( node_expenseset IS INITIAL ).
        ENDIF.
    *   get element via lead selection
        elem_expenseset = node_expenseset->get_element(  ).
    *   @TODO handle not set lead selection
        IF ( elem_expenseset IS INITIAL ).
        ENDIF.
      clear stru_expenseset.
    *   get all declared attributes
        elem_expenseset->set_static_attributes(
          exporting
            static_attributes = stru_expenseset ).
    *  data:
    *    node_expenseset1                    type ref to if_wd_context_node,
    *    elem_expenseset1                    type ref to if_wd_context_element,
    *    stru_expenseset1                    type if_exp_main=>element_expenseset1 .
    ** navigate from <CONTEXT> to <EXPENSESET1> via lead selection
    *  node_expenseset1 = wd_context->get_child_node( name = if_exp_main=>wdctx_expenseset1 ).
    ** get element via lead selection
    *  elem_expenseset1 = node_expenseset1->get_element(  ).
    ** alternative access  via index
    ** Elem_Expenseset1 = Node_Expenseset1->get_Element( Index = 1 ).
    ** @TODO handle non existant child
    ** if ( Elem_Expenseset1 is initial ).
    ** endif.
    *clear stru_expenseset1.
    ** get all declared attributes
    *  elem_expenseset1->get_static_attributes(
    *    importing
    *      static_attributes = stru_expenseset1   ).
    endmethod.
    here both table and drill down report are binded to same node
    can any one send me the code to clear only drill down report contents
    thanks & Regards
    Madhu

    Hi madhu,
    Try the following code to create new entries in the table on action of the create button
    DATA:
          node_expenseset                     TYPE REF TO if_wd_context_node,
          elem_expenseset                    TYPE REF TO if_wd_context_element,
          stru_expenseset                    TYPE if_exp_main=>element_expenseset .
      navigate from <CONTEXT> to <EXPENSESET> via lead selection
        node_expenseset = wd_context->get_child_node( 'EXPENSESET' ).
      @TODO handle not set lead selection
        IF ( node_expenseset IS INITIAL ).
        ENDIF.
      create new element
        elem_expenseset = node_expenseset->create_element(  ).
    *Bind the element to the node 
      node_expenseset->bind_element(
                   new_item = elem_expenseset
                   set_initial_elements = abap_false
    *set the created element as lead selected
      node_expenseset->set_lead_selection( element = elem_expenseset ).
    Edited by: krishna chandra on Nov 29, 2010 1:30 PM

  • How to use NODIM func with out it's values being rounded

    I created a new calculated key figure in Query Designer 3.x, and used the function NODIM() - Value with out dimensions. When I use this function, the values are rounding off to the nearest value.
    For example, I have a value 0.000075 US$, when I use NODIM function the value is displayed as 0.000080. Value is getting rounded to nearest value.
    I tried using absolute value it did not work.
    Can any one tell me how to use NODIM function with out it's value being rounded to nearest value.
    Thanks,

    Hi,
    According to your description, you might want that "Notice" field has a default value when form is created and users can be able to change the value of that
    field.
    As a workaround, you can add an action rule in “Name” field via InfoPath to fill the default value in “Notice” field only when “Name” field is not blank and “Notice”
    field is blank.
    Settings of the rule are as below, you can modify it based on your need:
    Here is a link about how to add an action rule in InfoPath form, you can use it as a reference:
    https://support.office.microsoft.com/en-us/article/Add-rules-for-performing-other-actions-5322d726-b787-4e5f-8d37-ba6db68b451d?CorrelationId=8a64c12f-aa60-4d90-b1f9-a44fcc4e74b5&ui=en-US&rs=en-US&ad=US
    Best regards
    Patrick Liang
    TechNet Community Support

  • Can we create table maintence generator with out key field

    Hi,
    I have created a ztable in that client is the primary key as I don't want any other field as primary key.
    For this  i have created table maintenace generator but when i open it in sm30 blnak screen is coming.
    Here my question is can we create a table maintenace generator with out key field other than MANDT.
    If it's possible please let me know.
    Regards
    hari

    >
    Mathews Joseph wrote:
    > I agree to the above points , but you can try one thing.
    >
    > When you create the table maintenance screen , from SE11 you assign a function group.
    >
    > Double click on the function group and you can go to the main program and open that in SE80, take screen generated and try manually adjusting the screen and putting the non key field details...
    >
    > Not sure this will work , but may be you can give it a try.
    >
    > Mathews
    But the table could hold at most a single record (per client). The design is lacking.
    Rob

  • Sender file adapter Adapter with out Key field

    Hi All
                 i do have have a requirment ,Sender file adapter , for FCC but file is  with out Key field
    HEADER>
    <DATA1>
    <DATA2>
    <DATA3>
    <HEADER>              file structure
    <ITEM>
    <ITEM1>
    <ITEM2>
    <ITEM3>
    <ITEM
    and the file si
    '10001,20081902,US
    10,soda,1
    30,soda,4
    40,soda,5
    10002,20081902,US
    10,steel,1
    30,steel,4
    40,steel,5
    , and i need to identify the Header and Item using there lenght only , please anyone as idea abt this help me

    Why to post the same question TWICE... in 30 min ? you don't like the answers ?
    File content Conversion Issuse for a Sender File Adapter

  • How to fill internal table with selection screen field.

    Hi all,
    i am new to sap . pls tell me how to fill internal table with selection screen field.

    Hi,
    Please see the example below:-
    I have used both select-options and parameter on the selection-screen.
    Understand the same.
    * type declaration
    TYPES: BEGIN OF t_matnr,
            matnr TYPE matnr,
           END OF t_matnr,
           BEGIN OF t_vbeln,
             vbeln TYPE vbeln,
           END OF t_vbeln.
    * internal table declaration
    DATA : it_mara  TYPE STANDARD TABLE OF t_matnr,
           it_vbeln TYPE STANDARD TABLE OF t_vbeln.
    * workarea declaration
    DATA : wa_mara  TYPE t_matnr,
           wa_vbeln TYPE t_vbeln.
    * selection-screen field
    SELECTION-SCREEN: BEGIN OF BLOCK b1.
    PARAMETERS : p_matnr TYPE matnr.
    SELECT-OPTIONS : s_vbeln FOR wa_vbeln-vbeln.
    SELECTION-SCREEN: END OF BLOCK b1.
    START-OF-SELECTION.
    * I am adding parameter value to my internal table
      wa_mara-matnr = p_matnr.
      APPEND wa_mara TO it_mara.
    * I am adding select-options value to an internal table
      LOOP AT s_vbeln.
        wa_vbeln-vbeln =  s_vbeln-low.
        APPEND  wa_vbeln TO  it_vbeln.
      ENDLOOP.
    Regards,
    Ankur Parab

  • Multiple entries in a Z table with same key fields

    Hi
    I do have a ZTABLE, with 3 key fields defined earlier. It consists of around 1 lakh records. Later onwards, two of the non keyfields have been made to key fields.
    This table is being populated with records at the time of saving a ztransaction.
    But some times, the system is updating the same records, some times twice, sometimes thrice, etc. I got to know that all fields (both key fields and non-key fields) of the record are same. That is, records are being updated in to the database table n number of times may be depending of some false logic in the program.
    If I tried to enter the same using SM30, it is showing me an error message stating that the record is already existing.
    What can be the reson?

    Hi,
    It seems there is some kind of data inconsistency..try to get all the records and then delete the duplicate entries through program....Now once u r done , from now onwards there won't be any duplicate entiers.,also before updating table use filters to avoid the duplication..
    Regards,
    Nagaraj

  • How to read from an internal table with multiple key fields.

    Hi All!!
    I want to read from an internal table having keys as k1,k2,k3.
    How can I use read statement to read an entry having this as the key fields.
    Thanks in adavance..
    Prabhas Jha

    hi there
    use:
    sort itab by K1 K2 K3.
    read table itab into wa with key K1 = value 1
                                                  K2 = value2
                                                  K3 = value 3
                                                   BINARY SEARCH.
    where:
    itab is ur internal table
    wa is the work area with the same line type as the itab
    cheers
    shivika

  • How to use tree tables with CRUD operation for begineers ADF 11g

    This is Friday night call for help.
    This is only few sample ressources on the web for tree table and only one with CRUD operation.
    I used this one http://jobinesh.blogspot.com/2010/05/crud-operations-on-tree-table.html because this is the only one that address CRUD.
    And it is shaky. Deletion works fine but insertion not very well. This is working using custom code provided below.
    Depending if the user selection in the tree, the code insert from the master node to the children node.
    Any other options because it is not working well.
    Also where Oracle describes how to use the row, rowset, itorator API? This is really hard to understand like almost if we should not use it.
    then if not how can I insert in tree with two nodes and insert in the parent or children depending the users selection.
    Lately I 'been posting questions on this forum with no response. This hurts. I understand developers cannot spend their time on this but People from Oracle, please help. We pay licenses...
    public void createChildren(RowIterator ri, Key selectedNodeKey) {
    final String deptViewDefName = "model.DepartmentsView";
    final String empViewDefName = "model.EmployeesView";
    if (ri != null && selectedNodeKey != null) {
    Row last = ri.last();
    Key lastRowKey = last.getKey();
    // if the select row is not the last row in the row iterator...
    Row[] found = ri.findByKey(selectedNodeKey, 1);
    if (found != null && found.length == 1) {
    Row foundRow = found[0];
    String nodeDefname =
    foundRow.getStructureDef().getDefFullName();
    if (nodeDefname.equals(deptViewDefName)) {
    RowSet parents =
    (RowSet)foundRow.getAttribute("EmployeesView");
    Row childrow = parents.createRow();
    parents.insertRow(childrow);
    } else {
    RowSet parents =
    (RowSet)foundRow.getAttribute("EmployeesView");
    Row childrow = parents.createRow();
    childrow.setAttribute("DepartmentId",
    foundRow.getAttribute("DepartmentId"));
    parents.insertRow(childrow);
    } else {
    System.out.println("Node not Found for " + selectedNodeKey);
    }

    I am looking for a sample that describe how to design a jsf page with a tree table.
    So you have Department and employees. In the tree first comes Department and if you click the node you see the employees assigned to this department.
    I need to be able to insert a new department or a new employee from the tree table by clicking on a insert button in the panel collection toolbar depending on user selection in the tree.
    I got part of it working but not good enough.
    By problem is the get insertion working
    I have a createChildren method in my AM implementation that get in input a RowIterator and selected node key.
    To goal is to create new records depending of the user selection and the input parameters get populated by the binding like this:
    #{backing_treeSampleBean.selectedNodeRowIterator} #{backing_TreeSampleBean.selectedNodeRowkey} via method binding with parameters.
    Is it the right approach?
    First to be able to insert a parent record, I select nothing in the tree and ri and selectedNodeKey comes to null
    we run this code
    ViewObjectImpl vo = getSchHolidaySchedExceptionsView1();
    //ViewObjectImpl vo = getDepartmentsView1();
    Row foundRow = vo.first();
    Row childrow = vo.createRow();
    vo.insertRow(childrow);
    A new blank entry appears in the parent node and we enter a value.
    The the problem starts when we want to add a child to this parent.
    We select the created parent and press the insert button, this code get executed
    if (nodeDefname.equals(deptViewDefName))
    //list of the children of the parent and create an new row
    RowSet childRows = (RowSet)foundRow.getAttribute("SchHolidayExceptionDatesView");
    Row childrow = childRows.createRow();
    childRows.insertRow(childrow);
    But the new entry does not appear, it is almost like it would be created for a different parent because this is a mandatory field that is not feel in yet and the interface complaints of a missing value. It is created somewhere just not a the right place... This is my guess.
    Do you see something wrong with the code?
    The full code og my create children method is there below
    I am using jdeveloper 11.1.1.3.0 any issues with tree table to know about with this version?
    Thanks for your help
    public void createChildren(RowIterator ri, Key selectedNodeKey) {
    final String deptViewDefName = "com.bcferries.app.pdfroutesched.model.SchHolidaySchedExceptionsView";
    final String empViewDefName = "com.bcferries.app.pdfroutesched.model.SchHolidayExceptionDatesView";
    if (ri != null && selectedNodeKey != null) {
    // last row
    Row last = ri.last();
    Key lastRowKey = last.getKey();
    // if the select row is not the last row in the row iterator...
    Row[] found = ri.findByKey(selectedNodeKey, 1);
    if (found != null && found.length == 1) {
    // foundRow is the row selected
    Row foundRow = found[0];
    // The row selected can be the parent node or the child node
    String nodeDefname = foundRow.getStructureDef().getDefFullName();
    // if parent row
    if (nodeDefname.equals(deptViewDefName))
    //list of the children of the parent and create an new row
    //works but we try to resolve the creation of a parent
    RowSet childRows = (RowSet)foundRow.getAttribute("SchHolidayExceptionDatesView");
    Row childrow = childRows.createRow();
    //childrow.setAttribute("HolidayDate", new java.util.Date().getDate());
    System.out.println("insert child row from master");
    childRows.insertRow(childrow);
    } else
    //RowSet ParentRow = (RowSet)foundRow.getAttribute("SchHolidaySchedExceptionsView");
    //RowSet childRows = (RowSet)ParentRow.first().getAttribute("SchHolidayExceptionDatesView");
    Row childrow = ri.createRow();
    System.out.println("insert child row from child ");
    } else {
    System.out.println("Node not Found for " + selectedNodeKey);
    } else {
    System.out.println(" param null try creating for first row : " +
    ri + " * " + selectedNodeKey);
    ViewObjectImpl vo = getSchHolidaySchedExceptionsView1();
    Row foundRow = vo.first();
    Row childrow = vo.createRow();
    vo.insertRow(childrow);
    }

  • Reading data from BSEG table with Non-key fields in where clause

    Hi All,
        I have to read data from BSEG table based on WBS element field (PROJK). As I'm not passing key fields to WHERE clause system couldnt run the select statement. Since BSEG is a cluster table I cant even create secondary index on PROJK field.
       Could you please tell me, how to improve its performance.
    Regards
    Jaker.

    SELECT bukrs
                 belnr
                 gjahr
                 shkzg
                 dmbtr
                 hkont
                 lifnr
                 matnr
                 werks
                 menge
                 meins
                 ebeln
            FROM bseg
            INTO TABLE it_bseg
            PACKAGE SIZE 10
            FOR ALL ENTRIES IN it_final
            WHERE  bukrs EQ it_final-bukrs
               AND belnr EQ it_final-belnr
               AND gjahr EQ it_final-gjahr
               AND buzei EQ it_final-buzei
               AND hkont EQ it_final-hkont
               AND werks IN s_werks.
    By using package and fetch from BSEG table. gathering all other information to a final internal table.This will reduce the hit to database.And also try to put that data in hashed internal table which is it_bseg....then definetly improve the performance.
    <REMOVED BY MODERATOR>
    Dara.
    Edited by: Alvaro Tejada Galindo on Apr 21, 2008 12:47 PM

  • How to use i cloude with out wifi

    How to use icloude with out wifi. I never backed my contacts up in iclode, and now my wifi does not work.

    icloud is on the internet to be able to use it one have to have an Internet connection over wifi or over 3g

  • Read statement with repeated key field

    Hi Experts ,
    We  are in the process of UCCHECK in an upgrade program and come across an issue with read statement using repeated key fields which is not allowed in a unicode compatable environment.
                READ TABLE it_vbpa WITH KEY
                                          vbeln = l_vbeln
                                          parvw = '0'
                                          parvw = 'ZN'.
    I checked this in 4.6c environment and observed that the Read statement uses the last key value for reading and doesnt consider other values even if the last value is not present in the table  .
    I want to know if I can use only that last value for read statement ? If so, what was the use of the repeated key fields in a read statement?
    Thanks and Regards
    Sanu

    Hi,
    Your main aim in a upgrade would be to successfully replicate the 4.6x functionalities in the ECC 6 version with the unicode checks. So it would be a safe option to only consider the last key condition. I dont have access to a 4.6C environment. May be it was a mistake corrected by SAP in the new version.
    Vikranth

  • Read statement with duplicate key fields

    Hello,
    I have an internal table(EKBE) with 8 fields
    ebeln ebelp vgabe gjahr belnr budat wrbtr refkey
    populating the first 7 fields from EKBE table with VGABE = 2 and PO#, concatenating the WRBTR and GJAHR to get the Refkey and passing this to the 8th field.
    Using this refkey, getting the document numbers from BKPF.
    I am looping another internal table into a work area and reading the above internal table by passing the ebeln field and I am doing some calculations ,etc.
    A custom table is getting updated from the above work area.
    The issue is-
    The internal table EKBE can have the same PO numbers with the same line item numbers but with different ref key's.
    So, when I am reading the int. tab, it is reading only one record, since I have no other key's to read except EBELN. So for one PO# it is reading only 1 ref key, I cannot use the line item# as a key, as the line item#'s never match, even if they match they could be same PO# with same line item# and different ref key.
    Any inputs highly appreciated.
    Regards,
    Kiran

    Loop on EKBE Internal table as well to fetch all entries of PO. Use Parallel cursor to optmize performance.
    http://wiki.sdn.sap.com/wiki/display/Snippets/ABAPCodeforParallelCursor-Loop+Processing

  • Data from two tables with no key fields

    Hi Friends,
    I want to retrieve data from mara and mseg tables,matnr from mara and menge from mseg but problem is there is no key fields
    from these two tables how can i retrieve the data from these two tables?
    regards,
    bikash

    Hi,
    You need to have a common field between 2 tables if you want to put a join between them.
    Or otherwise,
    Find the check table of the primary keys of the tables.
    Try to find the common fields from one of the check tables of the primary keys.
    Example,
    If you want to join tables A and B.
    Both tables don't contain common fields.
    A has primary key fields X and Y.
    go to check table of X or Y.
    Let check table of X is C.
    check any field in C which are exist in table B.
    Join tables A and C.
    Based on this pick the data from B.
    Regards,
    Prashant

  • How to map a table with out a primary key with a pojo?

    hello
    Is it possible to map a pojo with a table, table don't have primary key. I m using hibernate,How to do that in hibernate.
    Thanks &Regards
    snimi

    Hello,
    EclipseLink has support for database object-relational datatypes, but they are not supported or exposed through JPA. Instead, you will need to leave it unmapped and then change the mapping, using a customizer to create the mapping described:
    http://wiki.eclipse.org/Introduction_to_Object-Relational_Data_Type_Mappings_(ELUG)#Object-Relational_Data_Type_Array_Mapping
    Best Regards,
    Chris

Maybe you are looking for

  • Problem with collaboration rooms

    Hi all, I have a prolem in collaboration rooms, After i create a room, i will get a link to enter the room. when i click on the link, i am able to enter the room but with an  error saying <b>"No connection to groupware server (No logon data found for

  • SQL server remote configuration

    Hi, We are trying to install just the BIDS in a user machine to be able to develop reports remotely. I have a couple of questions. 1. In my current scenario, SQL server 2008 R2 is already setup with the reporting services in say, Machine1. Can it be

  • An Exception.java is generated when use wsa.jar

    I used wsa.jar(version:10.1.3) to parse WSDL file: http://api.rakuten.co.jp/rws/soap/GenreSearch/2007-04-11?wsdl ,and the generated java files contains Exception.java. The Exception.java file is looks like: public class Exception extends Exception {.

  • Links in Subscription emails

    Will we ever see a proper link to new posts again? Links now only take you to the thread and in Threaded view it's a pain to locate new posts in large threads. This To view the topic, visit: http://discussions.apple.com/thread.jspa?threadID=1174821 a

  • Sending a text using the Spanish Keyboard

    When I send a message to some one in Spanish using the Spanish keyboard, they cannot read it because it shows as a bunch of squares and symbols. They are using an Envy touch to see my messages. Can some one help me? Is anyone having the same problem?