For a READ TABLE how to build a dynamic WITH KEY condition?

Hi All,
I have a Z table with 6 fields. The first field is the Plant and is the key field. This field can be matched with the field from selection screen. Now I have 4 character fields which can contain various values. Now I have another field at the end of the table and this field is the one which I will need for further processing.
Now this last field will be selected based on the data for first 5 fields.
This Read is performed in a loop and the data for all the 4 character fields may not be present.
Now my problem is how to build a Read statement for this table where I need to get the value of the Last field based on the values of first 5 fields?

Hi,
    Use
IF    you have internal table With header line then use
      REad Tablename  with key  field1 = value1   field2 = value2      field3 = value3        field4 = value4    field5 = value5.
  If sy-subrc = 0.
endif.
if  you have internal table WithOut header line then use
     REad Tablename into workArea  with key  field1 = value1   field2 = value2      field3 = value3        field4 = value4    field5 = value5.
  If sy-subrc = 0.
endif.
regards,
Amit

Similar Messages

  • Is it possible to use dynamic 'with key' conditions of 'READ itab' ??

    Hi~
    I want to try to set  'with key'  conditions dynamically..
    READ TABLE itab WITH KEY <...>.
    In this <...> phrase, the condition keys could be 2 or 3( don't know at yet this point)
    so i want to make it dynamic with importing data.
    Is it possible?
    Please help me!
    thank you in advance~

    Hey,
    You could write 2 READ statements instead of trying to write a dynamic READ statement.
    IF CONDITION FOR 2 KEYS IS MET.
    READ TABLE WITH KEY1 = (value1) KEY2 = (value2).
    ELSE.
    READ TABLE WITH KEY1 = (value1) KEY2 = (value2) KEY3 = (value3).
    ENDIF.
    ~Kiran

  • How to build a array with high sampling rates 1K

    Hi All:
    Now I am trying to develop a project with CRio.
    But I am not sure how to build a array with high sampling rates signal, like >1K. (Sigle-point data)
    Before, I would like to use "Build Arrary" and "Shift Register" to build a arrary, but I found it is not working for high sampling rates.
    Is there anyother good way to build a data arrary for high sampling rates??
    Thanks
    Attachments:
    Building_Array_high_rates.JPG ‏120 KB

    Can't give a sample of the FPGA right now but here is a sample bit of RT code I recently used. I am acquiring data at 51,200 samples every second. I put the data in a FIFO on the FPGA side, then I read from that FIFO on the RT side and insert the data into a pre-initialized array using "Replace Array subset" NOT "Insert into array". I keep a count of the data I have read/inserted, and once I am at 51,200 samples, I know I have 1 full second of data. At this point, I add it to a queue which sends it to another loop to be processed. Also, I don't use the new index terminal in my subVI because I know I am always adding 6400 elements so I can just multiply my counter by 6400, but if you use the method described further down below , you will want to use the "new index" to return a value because you may not always read the same number of elements using that method.
    The reason I use a timeout of 0 and a wait until next ms multiple is because if you use a timeout wired to the FIFO read node, it spins a loop in the background that polls for data, which rails your processor. Depending on what type of acquisition you are doing, you can also use the method of reading 0 elements, then using the "elements remaining" variable, to wire up another node as is shown below. This was not an option for me because of my programs architecture and needing chunks of 1 second data. Had I used this method it would have overcomplicated things if I read more elements then I had available in my 51,200 buffer.
    Let me knwo if you have more qeustions
    CLA, LabVIEW Versions 2010-2013
    Attachments:
    RT.PNG ‏36 KB
    FIFO read.PNG ‏4 KB

  • How to build a screen with master detail data

    Hi ,expert ,
    Someone can teach me how to build a screen with master detail table ?
    I wnat to build a screen for user to maintain FERT group  and  FERT detail list  in one screen .
    just like this ..
    MASTER Block
    FERT1      
    FERT2 
    FERT3
    DETAIL Block
    FERT1A1
    FERT1A2
    FERT1A3
    when I double click FERT1 in the Master Block the detail view will show FERT1A1  A2 A3
    Thanks for your help ....
    Moderator message : Not enough research before posting. Spec dumping not allowed. Thread locked.
    Edited by: Vinod Kumar on Jun 13, 2011 1:38 PM

    An inefficient way to create the array is to use the build array and a shift register as shown below. It's more effecient in terms of memory management to create the array and then use the replace array subset as shown in the other image. Of course, if you don't need the array inside the loop, just wire the value out of the while loop and on the exit tunnel, right click and select 'Enable Indexing'.
    Message Edited by Dennis Knutson on 07-03-2007 10:25 PM
    Message Edited by Dennis Knutson on 07-03-2007 10:26 PM
    Attachments:
    Crude Build Array.PNG ‏4 KB
    Better Build Array.PNG ‏6 KB

  • I need your expert opinion on how to create a map with multiple conditions.

    Hello.
    I need your expert opinion on how to create a map with multiple conditions.
    I have a procedure (which i cannot import or re-create in OWB due to the bug), so i am trying to create a map instead :-(
    How can i create a cursors within the map?
    My function creates table and cursor.
    Then it will have to check for duplicates in the tables (the one created and another table) - the criteria for finding duplicates is a number of fields.I then need to place few different conditions (if some attributes are not available) and it has to load cursor based on this conditions. The next step is to fetch the data into the cursor based on what attributes are missing.
    The next thing it will do is insert the data into table (if record doesn't exist), output the error in separate table is record is corrupted, or update the record with changed information.
    In short i need to re-create match / merge but with conditions, iterations etc 'built into' it.
    I can read up on available functions - it's just what would be the best options? and what would be the best approach to do so?
    In my function i use %rowtype - but cannot use it in owb - so what would be the alternative? i don't really want to create a lot of variables and then have a nightmare of maintaing it. are there any tips regarding this?
    having looked through Oracle dedupe - it's not really what i need because it is just DISTINCT.
    I would appreciate any help / advise on this.
    Thank you very much

    thanks a lot for your reply - i will look into this option :-)
    it is a bit more complicated now as i have to re-create the match / merge and then somehow 'tweak' it to achieve the result i need.
    At the moment i am looking to breakdown the package into smaller chunks 'functions' and try creating the map that way.
    Anyway, thank you very much for your suggestion.

  • How was created the cluster with keys in example: Sim Phone.vi

    Hello all
    I have LV 7.1.1
    I have found the example: Sim Phone.vi
    And I don't know how was created the cluster with keys?
    Best regards
    Iskander

    It's just like any other cluster you create. Put a cluster container on the front panel and insert some Booleans. the actual Booleans are on the classic controls palette. The border of the cluster is also colored transparent with the paintbrush on the Tools palette.

  • How to build a form with multiple tables in oracle application express

    Hi everyone,
    I have got problem in building a form with multiple tables.I have a main table with (20) columns and this main table is related to the other tables with the primary key-foreign key relation ship.My requirement is i have to build a form which has fields from many tables and all the fields are related to the main table using (ID) column.In that form if i enter ID field i have to get information from differnt tables.
    Please help me to solve this (building a form with mutiple tables)
    Thank you
    sans

    Sans,
    I am no Apex expert, but with a situation as "complex" as yours, have you thought about creating a VIEW that joins these 7/8 tables, placing an INSTEAD OF trigger on that view to do all the business logic in the database, and base your application on the view?
    This is the "thick-database" approach that has been gaining momentum of late. The idea is to put your business logic in the database wherever possible, and let the application (Form, Apex, J2EE, whatever) concentrate on UI issues,

  • How to build a document with conditional text

    So, I created a condition for a feature that is new to my document and until it's stable, I want to hide that text. No problem. I selected the condition and from the Show/Hide Conditional Text pod, I moved it over to hide. When I created the conditional text, I gave it a background color of gray so I could easily distinguish the conditional text from the non-conditional text. However, if I leave the conditional text visible and go to generate a PDF, the gray background style appears on the conditional text in the PDF. Is there something I'm missing here when it comes to building a PDF? I don't want the style I see in the FM file to appear in the final PDF. I only want that background color as an indicator while I'm editing it. I don't want to have to remember to change the style every time I want to build with the condition visible. Here's a screenshot from the PDF. The bits in gray are what I had applied the condition to.
    After selecting the book file, I tried both doing a Save as PDF and a Print Book but both options ended up with my conditional text having the gray background style in the final output.

    No, you have misunderstood the problem. Yes, If I want to hide the condition so it doesn't print, that works great. But, once the feature is active (or say I have two customers, one that has the feature and one that doesn't), If I want to print the document with the conditional text visible, then I want the text but I don't want the background style that shows up in FM. The conditional style should only appear in FM, not the generated PDF.
    I worked for years with Madcap's Flare and you could set the color of the conditional text in order to distinguish what text was conditioned and with what condition (different colors for different conditions). However, when you generated the output, those colors never showed up. The only thing that displayed was the text that was set to be visible. That's what I was expecting from FM. And the FM tutorials I have taken, that's what they stated should happen. Here's a transcript from the FrameMaker 10 tutorial on Lynda.com:
    When we go down to the Conditional Text pod, you'll notice that we have a number of radio buttons for In, Not In, As Is, and then we also have our tags down below. So this is going to be in the US version. So we'll click the US tag. We'll change the radio button to In. You'll see the status change over here to In, and then we'll apply that by clicking the first button in our group of buttons here to apply it. Now, you'll see something change here in the document and if we deselect our text, you can see it's now blue with the overline and that's how we decided the style and color would appear for our US tags. That's not how it's going to print. It's just for our own visual purposes.

  • In my output fianl int. table how to display 'X' based on some conditions

    Hi,
    can somebody tell me
    how to populate the value in my fianl table as 'X'.This is my requirement.How to do???
    In the LOOP on lt_stpox, if lb_recursive is set to X, then populate gs_output-rekri = X for all components for material.
    this is my coading.
    *Panthom item check
       IF  p_phant = c_x .
          DELETE lt_stpox WHERE dumps = c_y.
        ENDIF.
        CLEAR lb_recursive.
        READ TABLE lt_stpox TRANSPORTING NO FIELDS WITH KEY rekri = 'x'.
        IF sy-subrc EQ 0.
          lb_recursive = 'X'.
        ENDIF.
        DELETE lt_stpox WHERE rekri = c_y.
        LOOP AT  lt_stpox INTO ls_stpox.
    *Move header data to final table.
          MOVE-CORRESPONDING ls_topmat TO gs_output.
    *move comonent data to final table.
          MOVE ls_stpox-ojtxp TO gs_output-maktx1.
          MOVE ls_stpox-idnrk TO gs_output-idnrk.
          MOVE ls_stpox-mngko TO gs_output-menge.
          MOVE ls_stpox-rekri TO gs_output-rekri.
          MOVE ls_stpox-meins TO gs_output-meins.
          MOVE ls_stpox-stufe TO gs_output-dglvl.
          APPEND gs_output TO gt_output.
        ENDLOOP.
        CLEAR: gs_output,ls_stpox,ls_topmat.
      ENDLOOP.
    ENDFORM.                    " BUILD_OUTPUT

    Hi,
    As per my understanding of your question, You are checking whether lt_stpox-rekri = 'X'  in below code and then you are setting lb_recursive as 'X' accordingly.
    CLEAR lb_recursive.
    READ TABLE lt_stpox TRANSPORTING NO FIELDS WITH KEY rekri = 'x'.
    IF sy-subrc EQ 0.
    lb_recursive = 'X'.
    ENDIF.
    DELETE lt_stpox WHERE rekri = c_y.
    And after that you are looping at lt_stpox to populate final internal table.
    So, instead of doing this, you can directly loop at table lt_stpox and in loop check if  lt_stpox-rekri = 'X', if yes then gs_output-rekri = X.
    Refer below code.
    LOOP AT lt_stpox INTO ls_stpox.
    If ls_stpox-rekri eq 'X'.
    gs_output-rekri = X.
    Endif.
    *Move header data to final table.
    MOVE-CORRESPONDING ls_topmat TO gs_output.
    *move comonent data to final table.
    MOVE ls_stpox-ojtxp TO gs_output-maktx1.
    MOVE ls_stpox-idnrk TO gs_output-idnrk.
    MOVE ls_stpox-mngko TO gs_output-menge.
    MOVE ls_stpox-rekri TO gs_output-rekri.
    MOVE ls_stpox-meins TO gs_output-meins.
    MOVE ls_stpox-stufe TO gs_output-dglvl.
    APPEND gs_output TO gt_output.
    ENDLOOP.
    CLEAR: gs_output,ls_stpox,ls_topmat.
    ENDLOOP.
    Hope it helps.
    Thanks,
    Archana
    Edited by: Archana Pawar on Feb 1, 2010 11:43 AM

  • How to build a Matrix with Group Left Report

    I want to build a Matrix with Group Left Report,not Matrix with Group Above Report,i am still finding the solution, any help is useful.
    thanks
    <[email protected]>

    Hi,
    The problem in your output is not clear. The report output should appear like:
    Order Mode.....Sales_Rep_ID > 10..11..12..
    Online.........Order Status
    ...............A..............x....x...x
    ...............B..............x....x...x
    ...............C..............x....x...x
    Order Mode.....Sales_Rep_ID > 10..11..12..
    Retail.........Order Status
    ...............A..............x....x...x
    ...............B..............x....x...x
    ...............C..............x....x...x
    Here "Order Mode" is the group field (it repeats for every group). Could you pl specify what output you are getting?
    If the problem is that you don't want the Title (like "Order Mode" in the above example) to print in every group, just place it outside the group repeating frame. It will print only once.
    Navneet.

  • How to build a array with collected data

    Hi,
    I have collected data from serial port with VISA. Now I want to build a array with 100 date points. Should I connect VISA Read with Build Array directly? How to do it?
    PS: All of them are in a While Structure.
    Thank you!

    An inefficient way to create the array is to use the build array and a shift register as shown below. It's more effecient in terms of memory management to create the array and then use the replace array subset as shown in the other image. Of course, if you don't need the array inside the loop, just wire the value out of the while loop and on the exit tunnel, right click and select 'Enable Indexing'.
    Message Edited by Dennis Knutson on 07-03-2007 10:25 PM
    Message Edited by Dennis Knutson on 07-03-2007 10:26 PM
    Attachments:
    Crude Build Array.PNG ‏4 KB
    Better Build Array.PNG ‏6 KB

  • How to build a form with a tree component

    Hi, i'd like to know if it's posssible to build a form with
    the Flash 8 Tree component.
    My menu looks like a tree but the childnodes of this tree are
    some form criteria that you can aditionate and post to a serveur.
    I try to use the accordeon menu, and it works but my menu
    must have dynamic heigth, and open all the boxes like the tree
    component...
    I'm in a hole... please healp me...
    Thinks

    Sans,
    I am no Apex expert, but with a situation as "complex" as yours, have you thought about creating a VIEW that joins these 7/8 tables, placing an INSTEAD OF trigger on that view to do all the business logic in the database, and base your application on the view?
    This is the "thick-database" approach that has been gaining momentum of late. The idea is to put your business logic in the database wherever possible, and let the application (Form, Apex, J2EE, whatever) concentrate on UI issues,

  • How to  build a dynamic control  in 'as' file

    example :
    I want to build a dynamic CheckBox in as file (in
    flex2.0),who can help me! thanks

    thanks,i'm a chinese.I'm not be good at English.
    Now the problem have be settled.
    非常感谢你!

  • How to populate a listbox with key in a table control

    I have the following code:
    MODULE carga_huecos INPUT.
    DATA: BEGIN OF li_huecos OCCURS 0,
            key(40) TYPE c,
            text(80) TYPE c,
    END OF li_huecos.
    DATA: BEGIN OF estru_hueco OCCURS 0,
          hueco LIKE zmov_wm-hueco,
    END OF estru_hueco.
    CLEAR: li_huecos, estru_hueco.
    REFRESH: li_huecos, estru_hueco.
    SELECT lgpla
        FROM lagp
        INTO TABLE estru_hueco
      WHERE lgnum = 'WWM' AND
            lgtyp = i_zmov_wm-almacen.
      LOOP AT estru_hueco.
        li_huecos-key  = estru_hueco-hueco.
        li_huecos-text = estru_hueco-hueco.
        APPEND li_huecos.
        CLEAR li_huecos.
      ENDLOOP.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = 'I_ZMOV_WM-HUECO'
          values          = li_huecos[]
        EXCEPTIONS
          id_illegal_name = 1
          OTHERS          = 2.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    I see that internal table  li_huecos has the values I need. But vrm_set_values function is not working. I need this values to be seen in a table control field which I have defined as "listbox with key". The name of the internal table associated to the table control is "I_zmov_wm" and the field is HUECO.
    After function is executed sy-subrc = 0 but no value is seen in the list.
    Thanks.

    hi ,
    instead of this 
    LOOP AT estru_hueco.
    li_huecos-key = estru_hueco-hueco.
    li_huecos-text = estru_hueco-hueco.
    APPEND li_huecos.
    CLEAR li_huecos.
    ENDLOOP.
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
    id = 'I_ZMOV_WM-HUECO'
    values = li_huecos[]
    EXCEPTIONS
    id_illegal_name = 1
    OTHERS = 2.
    IF sy-subrc 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    add this 
    data : name  type vrm_id  .
    LOOP AT estru_hueco.
    li_huecos-key = estru_hueco-hueco.
    li_huecos-text = estru_hueco-hueco.
    APPEND li_huecos.
    CLEAR li_huecos.
    ENDLOOP.
    name  = 'I_ZMOV_WM-HUECO' .
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
    id =   name
    values = li_huecos[]
    EXCEPTIONS
    id_illegal_name = 1
    OTHERS = 2.
    IF sy-subrc 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    regards
    Deepak.

  • How to build a filter with particular frequncy respond?

    Hi,
    Are there any methods to create a filter with particular frequncy respond? It's better if I can simply input the filter's xy data according to my filter sharp. Thanks.
    Bill

    Look in the examples for FILTER
    select FIR Filter example
    For IIR filters
    slect the IIR filter example.
    The main problem that I see with inputting xy's data is that it's tricky for a program to decide which trade-off to make for passband ripple or cut off for example.

Maybe you are looking for

  • Setting default application

    when I'm trying to open up a document or something it says something like "There is no default application specified to open the document (name of document)" . How do you set a default application and what should I set it to? I have an iMac version 1

  • How to call Stored Procedure in OWB?

    Hi, I'm not able to call stored procedures in the OWB. There are transformations available to call the functions namely Mapping Transformation, but i didnt find any such transformation for stored procedures. I was able to validate, generate ad deploy

  • How to achieve the order base on my input?

    Hi all, I have the following query select column_name,column_id from user_tab_columns              where table_name = 'ITEM_GROUPS'                And column_id in (Select to_number(column_value) from The(Select cast(str2tbl('25,26,31,32,24') as myta

  • Fragementation of table data in the DB file

    Hi, I am working on an OLTP system where this OLTP is residing on an oracle 10G database[database name ORCL] now further it has got a user OLTP which contains about 50 tables and all these tables are residing physically on a single database file[dbf

  • Monitor serialisation progress

    Hi is it possible to monitor progress of writeObject and readObject methods? Also I need to determine size of object I am going to write: I was thinking about write my Object into ByteArrayOutputStream so that I can determine its size, but is there a