<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem in writing a Read Statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-writing-a-read-statement/m-p/6986554#M1493333</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just append each value to individual ranges.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while apending to ranges , just use CP, EQ based on the string  given for search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if wa-field1 in s_field1 "values entered in popup&lt;/P&gt;&lt;P&gt;or wa-field2 in s_field2. "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move sy-tabix to wa_tabix-index.&lt;/P&gt;&lt;P&gt;append wa_tabix to i_find_index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i_find_index will hold the index no of the entries that satisfied the serach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now on each find button and find next button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move the index in the itab i_find_index to the top_line of table control.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Jun 2010 13:17:51 GMT</pubDate>
    <dc:creator>kesavadas_thekkillath</dc:creator>
    <dc:date>2010-06-15T13:17:51Z</dc:date>
    <item>
      <title>Problem in writing a Read Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-writing-a-read-statement/m-p/6986550#M1493329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my Table control I have a POSITION button which is used to find the record in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written the following code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

  CALL FUNCTION 'POPUP_GET_VALUES'
    EXPORTING
*   NO_VALUE_CHECK        = ' '
      popup_title           = 'Find the record'
*   START_COLUMN          = '5'
*   START_ROW             = '5'
* IMPORTING
*   RETURNCODE            =
    TABLES
      fields                = lt_tab
 EXCEPTIONS
   error_in_fields       = 1
   OTHERS                = 2

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have five primary keys in my table, so that in the pop up I am getting all the five fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user will enter any of the five fields , I want to write a read statement based on the fields entered by the user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anybody help in writing the Read  statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or could any one help me in writing out the FIND functionality for a table control&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: SAP LEARNER on Jun 15, 2010 1:40 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jun 2010 10:31:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-writing-a-read-statement/m-p/6986550#M1493329</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-15T10:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in writing a Read Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-writing-a-read-statement/m-p/6986551#M1493330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the problem you are getting with that write statement... provide your code here&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jun 2010 12:05:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-writing-a-read-statement/m-p/6986551#M1493330</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-15T12:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in writing a Read Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-writing-a-read-statement/m-p/6986552#M1493331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Its not the write statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example if the user fills up the values in the First field and third field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I must write the query as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE ITAB WITH KEY F1 = &amp;lt;value1&amp;gt; and F3 = &amp;lt;value2&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if he fills up 3  and fifth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE ITAB WITH KEY F3 = &amp;lt;value1&amp;gt; and F5 = &amp;lt;value2&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it must be dynamic with those fields which user has filled up&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to write the READ statement&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jun 2010 12:48:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-writing-a-read-statement/m-p/6986552#M1493331</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-15T12:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in writing a Read Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-writing-a-read-statement/m-p/6986553#M1493332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think it's pretty well covered in F1 for READ TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jun 2010 13:10:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-writing-a-read-statement/m-p/6986553#M1493332</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-15T13:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in writing a Read Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-writing-a-read-statement/m-p/6986554#M1493333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just append each value to individual ranges.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while apending to ranges , just use CP, EQ based on the string  given for search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if wa-field1 in s_field1 "values entered in popup&lt;/P&gt;&lt;P&gt;or wa-field2 in s_field2. "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move sy-tabix to wa_tabix-index.&lt;/P&gt;&lt;P&gt;append wa_tabix to i_find_index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i_find_index will hold the index no of the entries that satisfied the serach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now on each find button and find next button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move the index in the itab i_find_index to the top_line of table control.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jun 2010 13:17:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-writing-a-read-statement/m-p/6986554#M1493333</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-06-15T13:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in writing a Read Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-writing-a-read-statement/m-p/6986555#M1493334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;read the table with fieldname&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jun 2010 13:31:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-writing-a-read-statement/m-p/6986555#M1493334</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-15T13:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in writing a Read Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-writing-a-read-statement/m-p/6986556#M1493335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not know what fields will be filled up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as there are 5 PK fields so 5! chances will be there for the where condition in the READ statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried in the following way.&lt;/P&gt;&lt;P&gt;I created a structure with the primary key fields and I filled the structure with the user filled values.&lt;/P&gt;&lt;P&gt;Then I used it in the read statement as below, but it did not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

    LOOP AT lt_tab .
      IF lt_tab-fieldname = 'SOCIEDAD'.
        lw_pk-sociedad = lt_tab-value.
      ENDIF.
      IF lt_tab-fieldname = 'NATURAL_YEAR'.
        lw_pk-natural_year = lt_tab-value.
      ENDIF.
      IF lt_tab-fieldname = 'CICLO_DE_VENTAS'.
        lw_pk-ciclo_de_ventas = lt_tab-value.
      ENDIF.
      IF lt_tab-fieldname = 'MODEL_VERSION'.
        lw_pk-model_version = lt_tab-value.
      ENDIF.
    ENDLOOP.

    DATA:lw_yrwbw010 TYPE ty_yrwbw010.

    READ TABLE t_yrwbw010 INTO lw_yrwbw010 WITH KEY lw_pk.
     IF sy-subrc = 0.
      table-top_line = sy-tabix.
     ENDIF.

  ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Rob Burbank &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please help me !! I could not find that in F1 help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@ Keshav.T    	 &lt;/P&gt;&lt;P&gt;Could you please elaborate it please&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jun 2010 13:58:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-writing-a-read-statement/m-p/6986556#M1493335</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-15T13:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in writing a Read Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-writing-a-read-statement/m-p/6986557#M1493336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Keshav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used Loop with where condition using the ranges,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jun 2010 14:35:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-writing-a-read-statement/m-p/6986557#M1493336</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-15T14:35:56Z</dc:date>
    </item>
  </channel>
</rss>

