<?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: Diaglog Program - To write 'Find' in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/diaglog-program-to-write-find/m-p/2820788#M659714</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here i am attaching code which i used in one of the programs to use FIND functionality. FIND is the user command assigned in the pf status and you need to alter this code and add to your User command module of PAI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if sy-ucomm eq 'FIND'.&lt;/P&gt;&lt;P&gt;    clear g_val2.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Popup for the user to enter value to search for&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    call function 'POPUP_TO_GET_VALUE'&lt;/P&gt;&lt;P&gt;         exporting&lt;/P&gt;&lt;P&gt;              fieldname           = 'FINDSTR'&lt;/P&gt;&lt;P&gt;              tabname             = 'RSDXX'&lt;/P&gt;&lt;P&gt;              titel               = ''&lt;/P&gt;&lt;P&gt;              valuein             = l_val&lt;/P&gt;&lt;P&gt;         importing&lt;/P&gt;&lt;P&gt;              answer              = l_ans&lt;/P&gt;&lt;P&gt;              valueout            = g_val2&lt;/P&gt;&lt;P&gt;         exceptions&lt;/P&gt;&lt;P&gt;              fieldname_not_found = 1&lt;/P&gt;&lt;P&gt;              others              = 2.&lt;/P&gt;&lt;P&gt;    if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  move g_top_line to l_cnt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at i_sl_tab from g_top_line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if l_first eq 'X'.&lt;/P&gt;&lt;P&gt;      clear l_first.&lt;/P&gt;&lt;P&gt;      continue.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if i_sl_tab-err cs g_val2.&lt;/P&gt;&lt;P&gt;      g_top_line = sy-tabix.&lt;/P&gt;&lt;P&gt;      exit.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if i_sl_tab-res cs g_val2.&lt;/P&gt;&lt;P&gt;      g_top_line = sy-tabix.&lt;/P&gt;&lt;P&gt;      exit.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if i_sl_tab-num cs g_val2.&lt;/P&gt;&lt;P&gt;      g_top_line = sy-tabix.&lt;/P&gt;&lt;P&gt;      exit.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;If there are no more entries for the search, display message&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  if g_top_line eq l_cnt.&lt;/P&gt;&lt;P&gt;    message s899 with 'String'(104) g_val2 'not found'(109).&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully this will help you out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Sep 2007 02:10:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-25T02:10:38Z</dc:date>
    <item>
      <title>Diaglog Program - To write 'Find'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diaglog-program-to-write-find/m-p/2820787#M659713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am writing a dialog program, in PBO under 'Find' I entered '%SC'. Looks like I need to write the code for this 'Find'. Is there a way I can use SAP find code to utlize in my program.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;PV&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2007 01:19:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diaglog-program-to-write-find/m-p/2820787#M659713</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-25T01:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Diaglog Program - To write 'Find'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diaglog-program-to-write-find/m-p/2820788#M659714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here i am attaching code which i used in one of the programs to use FIND functionality. FIND is the user command assigned in the pf status and you need to alter this code and add to your User command module of PAI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if sy-ucomm eq 'FIND'.&lt;/P&gt;&lt;P&gt;    clear g_val2.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Popup for the user to enter value to search for&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    call function 'POPUP_TO_GET_VALUE'&lt;/P&gt;&lt;P&gt;         exporting&lt;/P&gt;&lt;P&gt;              fieldname           = 'FINDSTR'&lt;/P&gt;&lt;P&gt;              tabname             = 'RSDXX'&lt;/P&gt;&lt;P&gt;              titel               = ''&lt;/P&gt;&lt;P&gt;              valuein             = l_val&lt;/P&gt;&lt;P&gt;         importing&lt;/P&gt;&lt;P&gt;              answer              = l_ans&lt;/P&gt;&lt;P&gt;              valueout            = g_val2&lt;/P&gt;&lt;P&gt;         exceptions&lt;/P&gt;&lt;P&gt;              fieldname_not_found = 1&lt;/P&gt;&lt;P&gt;              others              = 2.&lt;/P&gt;&lt;P&gt;    if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  move g_top_line to l_cnt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at i_sl_tab from g_top_line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if l_first eq 'X'.&lt;/P&gt;&lt;P&gt;      clear l_first.&lt;/P&gt;&lt;P&gt;      continue.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if i_sl_tab-err cs g_val2.&lt;/P&gt;&lt;P&gt;      g_top_line = sy-tabix.&lt;/P&gt;&lt;P&gt;      exit.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if i_sl_tab-res cs g_val2.&lt;/P&gt;&lt;P&gt;      g_top_line = sy-tabix.&lt;/P&gt;&lt;P&gt;      exit.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if i_sl_tab-num cs g_val2.&lt;/P&gt;&lt;P&gt;      g_top_line = sy-tabix.&lt;/P&gt;&lt;P&gt;      exit.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;If there are no more entries for the search, display message&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  if g_top_line eq l_cnt.&lt;/P&gt;&lt;P&gt;    message s899 with 'String'(104) g_val2 'not found'(109).&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully this will help you out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2007 02:10:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diaglog-program-to-write-find/m-p/2820788#M659714</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-25T02:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Diaglog Program - To write 'Find'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diaglog-program-to-write-find/m-p/2820789#M659715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The "%SC" is for using the inbuilt "find" in lists (reports) and "%SC=" does "find again".  To implement your own "find" in a module pool, you can set the button to whatever you need e.g. "ZSEEK", and then implement the logic that is appropriate to your business requirement withing the PAI... and you might find just having a "find value" / "position at" / "goto" field on the screen instead is easier for the users.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;P&gt;p.s. this thread might be better placed under UI Programming&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2007 03:21:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diaglog-program-to-write-find/m-p/2820789#M659715</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-25T03:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: Diaglog Program - To write 'Find'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diaglog-program-to-write-find/m-p/2820790#M659716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;How to use inbuilt "find"? When I used '%SC', 'Find' button doesn't do anything. Do you how to implement inbuilt find?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;PV&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2007 05:13:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diaglog-program-to-write-find/m-p/2820790#M659716</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-25T05:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Diaglog Program - To write 'Find'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diaglog-program-to-write-find/m-p/2820791#M659717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As noted above, it depends on what you / your users want the "find" in your dialog program to do... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "%SC" only works in a report ... for example, run transaction LIBS... then in the command box at the top of the SAPGui type in %SC  - you will get the "Find" box and this will let you search the data that has been brought to the screen in the list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what is your dynpro doing?... For example "find" could mean "find an employee name" or "find the best price" or "find a file on the PC"... it very much depends on what your screens contain.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to implement a "find" for a table control, for example, you would need to do something like the example the other person above wrote i.e. get a search value from the user, look through the internal table where you have the data values, match the search value to a row (or not!), and reposition the table control so that entry is at the top of the list... there's no magic solution, just traditional code logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2007 06:13:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diaglog-program-to-write-find/m-p/2820791#M659717</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-25T06:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Diaglog Program - To write 'Find'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diaglog-program-to-write-find/m-p/2820792#M659718</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;IS ur scenario like this?&lt;/P&gt;&lt;P&gt;U using one table control to display data and whn u press FIND button one screen opens in which u have to give find term?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this is the case i can help u.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward me back if this is so.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2007 12:27:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diaglog-program-to-write-find/m-p/2820792#M659718</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-25T12:27:46Z</dc:date>
    </item>
  </channel>
</rss>

