<?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 Control / Variable name causes confusion . in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-variable-name-causes-confusion/m-p/3737497#M899505</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;while working on screen programming. example code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;PROGRAM  ZTEST_SCREEN_ONE.
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  ZPRNV_ADD  INPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE ZPRNV_ADD INPUT.
"UNCOMMENT THE MODULE AND GIVE A NAME AND DOUBLE CLICK TO CREATE PAI MODULE
  



"SY-UCOMM system variable which gives the command name which triggered this function
  IF SY-UCOMM = 'ADD'.
    
    "declare the variable with same name as the name given in design layout 
    "with this data will be mapped automatically on/off the screen
    DATA: TXT_A TYPE I  ,
          TXT_B TYPE I ,
          TXT_RESULT TYPE I.

    TXT_RESULT = TXT_A + TXT_B .


  ELSE.
    LEAVE.
  ENDIF.

ENDMODULE.                 " ZPRNV_ADD  INPUT&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if we somehow declare a variable in the function with the same name as of a control(eg textbox) , compiler maps them into one .&lt;/P&gt;&lt;P&gt;This may raise errors if we aren't aware of the variable names that are already in use and start to code on modules. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Q: Is there any way to avoid the same ?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i m new to ABAP &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 May 2008 03:02:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-05T03:02:09Z</dc:date>
    <item>
      <title>Control / Variable name causes confusion .</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-variable-name-causes-confusion/m-p/3737497#M899505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;while working on screen programming. example code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;PROGRAM  ZTEST_SCREEN_ONE.
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  ZPRNV_ADD  INPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE ZPRNV_ADD INPUT.
"UNCOMMENT THE MODULE AND GIVE A NAME AND DOUBLE CLICK TO CREATE PAI MODULE
  



"SY-UCOMM system variable which gives the command name which triggered this function
  IF SY-UCOMM = 'ADD'.
    
    "declare the variable with same name as the name given in design layout 
    "with this data will be mapped automatically on/off the screen
    DATA: TXT_A TYPE I  ,
          TXT_B TYPE I ,
          TXT_RESULT TYPE I.

    TXT_RESULT = TXT_A + TXT_B .


  ELSE.
    LEAVE.
  ENDIF.

ENDMODULE.                 " ZPRNV_ADD  INPUT&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if we somehow declare a variable in the function with the same name as of a control(eg textbox) , compiler maps them into one .&lt;/P&gt;&lt;P&gt;This may raise errors if we aren't aware of the variable names that are already in use and start to code on modules. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Q: Is there any way to avoid the same ?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i m new to ABAP &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 03:02:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-variable-name-causes-confusion/m-p/3737497#M899505</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T03:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Control / Variable name causes confusion .</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-variable-name-causes-confusion/m-p/3737498#M899506</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 this condition u can use any variables so to diffrentiate frm urs better add 'Z' infront of the variable so tht u can easily identify.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Arunprasad.P&lt;/P&gt;&lt;P&gt;Reward if useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 03:21:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-variable-name-causes-confusion/m-p/3737498#M899506</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T03:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: Control / Variable name causes confusion .</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-variable-name-causes-confusion/m-p/3737499#M899507</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;Declare variables in main program and then use it in screen.We can use Screen field and prg variables are same in SAP.this method is better. don't use diferent name for screen and prg. that will not suport for long time. you will get idea about this.you just use this concept now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 08:03:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-variable-name-causes-confusion/m-p/3737499#M899507</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T08:03:29Z</dc:date>
    </item>
  </channel>
</rss>

