<?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 Cursor position : still didnt get solution in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/cursor-position-still-didnt-get-solution/m-p/2844165#M666232</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In screen painter, I have two fields er_id and er_name.In er_id I have validated &lt;/P&gt;&lt;P&gt;for duplication record.Once user enters er_id,I checked for its existence in its table &lt;/P&gt;&lt;P&gt;if exists warning message is displayed and if not exists cursor should go to next field i.e er_name.How to acheive this?My code is &lt;/P&gt;&lt;P&gt;select * from t1 where er_id = er_id &lt;/P&gt;&lt;P&gt;if sy-dbcnt &amp;lt;&amp;gt; o &lt;/P&gt;&lt;P&gt;message 'er id exists' &lt;/P&gt;&lt;P&gt;else &lt;/P&gt;&lt;P&gt;set cursor field 'er_name'. &lt;/P&gt;&lt;P&gt;endif &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this is not working,i placed above code in module m1 input',some said that set cursor should be in PBO.So I assigned boolean value to one variable and checked in PBO,even then its not working. &lt;/P&gt;&lt;P&gt;else &lt;/P&gt;&lt;P&gt;status = 'yes'. &lt;/P&gt;&lt;P&gt;endif &lt;/P&gt;&lt;P&gt;PBO: &lt;/P&gt;&lt;P&gt;if status = 'yes'. &lt;/P&gt;&lt;P&gt;set cursor field 'er_name'. &lt;/P&gt;&lt;P&gt;endif. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Help me.Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : I admit that in SAP validations are not done at field level. Its just my curiosity to know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Sep 2007 21:13:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-26T21:13:42Z</dc:date>
    <item>
      <title>Cursor position : still didnt get solution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cursor-position-still-didnt-get-solution/m-p/2844165#M666232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In screen painter, I have two fields er_id and er_name.In er_id I have validated &lt;/P&gt;&lt;P&gt;for duplication record.Once user enters er_id,I checked for its existence in its table &lt;/P&gt;&lt;P&gt;if exists warning message is displayed and if not exists cursor should go to next field i.e er_name.How to acheive this?My code is &lt;/P&gt;&lt;P&gt;select * from t1 where er_id = er_id &lt;/P&gt;&lt;P&gt;if sy-dbcnt &amp;lt;&amp;gt; o &lt;/P&gt;&lt;P&gt;message 'er id exists' &lt;/P&gt;&lt;P&gt;else &lt;/P&gt;&lt;P&gt;set cursor field 'er_name'. &lt;/P&gt;&lt;P&gt;endif &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this is not working,i placed above code in module m1 input',some said that set cursor should be in PBO.So I assigned boolean value to one variable and checked in PBO,even then its not working. &lt;/P&gt;&lt;P&gt;else &lt;/P&gt;&lt;P&gt;status = 'yes'. &lt;/P&gt;&lt;P&gt;endif &lt;/P&gt;&lt;P&gt;PBO: &lt;/P&gt;&lt;P&gt;if status = 'yes'. &lt;/P&gt;&lt;P&gt;set cursor field 'er_name'. &lt;/P&gt;&lt;P&gt;endif. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Help me.Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : I admit that in SAP validations are not done at field level. Its just my curiosity to know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2007 21:13:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cursor-position-still-didnt-get-solution/m-p/2844165#M666232</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-26T21:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Cursor position : still didnt get solution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cursor-position-still-didnt-get-solution/m-p/2844166#M666233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try the program below as a demo... it includes comments to explain... I think your problem may be that you are using lowercase in the variable name you are trying to place the cursor on, but without seeing your original code I cannot be sure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;report zlocal_jc_set_cursor_in_pbo.

data:
*" Dynnr fields need to be global
  g_er_id(10)           type c,
  g_er_name(30)         type c.

*=======================================================================
* Mainline
*=======================================================================
start-of-selection.

**" screen has just:
**"   process before output.
**"     module d9999_pbo.
**
**"   process after input.
**"     module d9999_pai.
*"
  call screen '9999'. "screen with G_ER_ID and G_ER_NAME input fields
*                     "and a button with ZEXIT as fcode

*----------------------------------------------------------------------*
*  MODULE d9999_pbo OUTPUT
*----------------------------------------------------------------------*
module d9999_pbo output.

*" Move cursor to second field if user keys "2" into first field in
*" prior PAI

  if g_er_id = '2'.
    set cursor field 'G_ER_NAME'.
  endif.

endmodule.

*----------------------------------------------------------------------*
*  MODULE d9999_pai INPUT
*----------------------------------------------------------------------*
module d9999_pai input.

*" Leave if they click button:
  if sy-ucomm = 'ZEXIT'. "Exit button on screen has this Fcode
    leave program.
  endif.

endmodule.                    "d9999_pai INPUT&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2007 05:26:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cursor-position-still-didnt-get-solution/m-p/2844166#M666233</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-27T05:26:45Z</dc:date>
    </item>
  </channel>
</rss>

