<?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: At selection-screen ouput and Initilization in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen-ouput-and-initilization/m-p/1482502#M225577</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Initialization event is used to set the default values for the parameters/selct-options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT Selection-Screen output is used for validation of the selection-screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anurag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Aug 2006 10:17:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-03T10:17:09Z</dc:date>
    <item>
      <title>At selection-screen ouput and Initilization</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen-ouput-and-initilization/m-p/1482499#M225574</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;  When we can do initializations in At selection-screen output why we need initialization event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;  Satya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Aug 2006 10:11:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen-ouput-and-initilization/m-p/1482499#M225574</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-03T10:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: At selection-screen ouput and Initilization</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen-ouput-and-initilization/m-p/1482500#M225575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Initialization event is used for popultating the default data on to the selection screen or populating the data to their respective internal tables before the output is being displayed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;************************************************************************
*              AT SELECTION SCREEN OUTPUT                              *
************************************************************************
AT SELECTION-SCREEN OUTPUT.
   PERFORM schedule_update.

************************************************************************
*               INITIALISATION                                         *
************************************************************************
INITIALIZATION.
  r_balance-low = p_box1.
  r_balance-option = 'GT'.
  r_balance-sign = 'I'.
  APPEND r_balance.
  CLEAR r_balance.

  r_balance-low = p_box2.
  r_balance-option = 'LE'.
  r_balance-sign = 'I'.
  APPEND r_balance.
  CLEAR r_balance.

  r_balance-low = p_box2.
  r_balance-option = 'GT'.
  r_balance-sign = 'I'.
  APPEND r_balance.
  CLEAR r_balance.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Aug 2006 10:13:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen-ouput-and-initilization/m-p/1482500#M225575</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-03T10:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: At selection-screen ouput and Initilization</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen-ouput-and-initilization/m-p/1482501#M225576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;at selection-screen is more useful in making dynamic screen modifications like making screen fields input enabled/disabled at run time.&lt;/P&gt;&lt;P&gt;and more over, if you press enter 10 times, then the code in at-selection screen out put triggers ten times.&lt;/P&gt;&lt;P&gt;Initialization event triggers only once.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Aug 2006 10:16:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen-ouput-and-initilization/m-p/1482501#M225576</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-03T10:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: At selection-screen ouput and Initilization</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen-ouput-and-initilization/m-p/1482502#M225577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Initialization event is used to set the default values for the parameters/selct-options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT Selection-Screen output is used for validation of the selection-screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anurag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Aug 2006 10:17:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen-ouput-and-initilization/m-p/1482502#M225577</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-03T10:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: At selection-screen ouput and Initilization</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen-ouput-and-initilization/m-p/1482503#M225578</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;EVENTS IN CLASSICAL REPORTS,&lt;/P&gt;&lt;P&gt;1.INITIALIZATION.&lt;/P&gt;&lt;P&gt;2.AT SELECTION-SCREEN.&lt;/P&gt;&lt;P&gt;3.TOP-OF-PAGE.&lt;/P&gt;&lt;P&gt;4.START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;5.END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;6.END-OF-PAGE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INITIALIZATION, IS THE EVENT USED TO INITIALIZE THE SELECTION SCREEN FIELDS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AFTER THE SELECTION SCREEN IS DISPLAYED ON THE SCREEN,AND AFTER YOU GIVE ALL THE INPUT VALUES ON THE SCREEN,&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ENVET WILL EXECUTE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IT IS THE EVENT FOR INPUT-FIELD VALIDATATIONS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check for it,&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;kcc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Aug 2006 10:18:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen-ouput-and-initilization/m-p/1482503#M225578</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-03T10:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: At selection-screen ouput and Initilization</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen-ouput-and-initilization/m-p/1482504#M225579</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;the INITIALIZATION event is perform after starting the program (of type 1) and before the selection screen appears. You can use it for variables or selection fields initialization, for instance. AT SELECTION-SCREEN OUTPUT is executed in the PBO (Process Before Output) of the screen. As difference to INITIALIZATION, this event can be executed many times, like when the user presses ENTER.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Aug 2006 10:22:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen-ouput-and-initilization/m-p/1482504#M225579</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-03T10:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: At selection-screen ouput and Initilization</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen-ouput-and-initilization/m-p/1482505#M225580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;INITIALIZATION : tigger  only once when program is loaded.&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN OUTPUT, if it occurs in the report  this event is always executed for PBO of a selection screen. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Syntax Diagram 
INITIALIZATION 


Basic form 
INITIALIZATION. 



Effect 
Event keyword: 

(For executable programs of type 1), the associated event is executed before the selection screen is displayed. 

The parameters (PARAMETERS) and selection criteria (SELECT-OPTIONS) defined in the program already contain default values (if specified). You can assign different values here and also change the database-specific selections. 



Example 
Define the last day of the previous month as the key date: 



PARAMETERS QUAL_DAY TYPE D DEFAULT SY-DATUM. 
INITIALIZATION. 
  QUAL_DAY+6(2) = '01'. 
  QUAL_DAY      = QUAL_DAY - 1. 



Here, the default value of QUAL_DAY is the current date, e.g. 05.04.88 (QUAL_DAY = '19880405'). Two subseqent statements set the date first to the beginning of the month, e.g. 01.04.88 (QUAL_DAY = '19880401') and then, by subtracting one day, to the last day of the previous month, e.g. 31.03.88 (QUAL_DAY = '19880331'). 


Example 
When the selection screen is displayed, the SELECT-OPTION FL_DATE should contain two selection lines. 


DATA SBOOK_WA TYPE SBOOK. 
SELECT-OPTIONS FL_DATE FOR SBOOK_WA-FLDATE. 

INITIALIZATION. 

  MOVE: 'I'      TO FL_DATE-SIGN, 
        'EQ'     TO FL_DATE-OPTION, 
        SY-DATUM TO FL_DATE-LOW. 
  APPEND FL_DATE. 

  MOVE: 'BT'       TO FL_DATE-OPTION, 
        '19960101' TO FL_DATE-LOW, 
        '19960630' TO FL_DATE-HIGH. 
  APPEND FL_DATE. 



When the selection screen is displayed, FL_DATE contains the selection by the single value SY-DATUM (current date) and the interval from January 1, 1996 to June 30, 1996. 



Note 
In more precise terms, INITIALIZATION is executed in the following steps: 



Specify default values for the selections. 

Execute the event INITIALIZATION. 

Import variant (if used to start the report). On SUBMIT, the values specified for each WHERE clause are also transferred, if necessary. 

Execute the event AT SELECTION-SCREEN OUTPUT, if it occurs in the report (unlike INITIALIZATION, this event is always executed for PBO of a selection screen). 

Display selection screen. 

Transport the screen fields containing user input to the report fields. 

Continue with START-OF-SELECTION. 



Note 
Since INITIALIZATION is only executed once when you start the report, it is not suitable for screen modifications such as suppressing individual parameters ( LOOP AT SCREEN, MODIFY SCREEN) because these changes would disappear again when the user pressed ENTER. The correct event for screen modifications is AT SELECTION-SCREEN OUTPUT. 



Note 
The INITIALIZATION event is processed only in the case of SUBMIT, not CALL SELECTION-SCREEN. 



Note 
The SET PF-STATUS statement does not work during the processing of an event. Instead, you should set a status with one of the function modules RS_SET_SELSCREEN_STATUS or RS_EXTERNAL_SELSCREEN_STATUS. 



Related 
AT SELECTION-SCREEN, START-OF-SELECTION 


Additional help 
Description of Reporting Events&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Prabhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Aug 2006 10:22:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen-ouput-and-initilization/m-p/1482505#M225580</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-03T10:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: At selection-screen ouput and Initilization</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen-ouput-and-initilization/m-p/1482506#M225581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prasad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just as an example if we have 4 tabs(A, B, C, D) on the selection screen with each tab having  different input fields, and in one tab i have to set a default value based on some Validation....say in tab C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so..we can do the consition either in initialization or at selection-screen output.&lt;/P&gt;&lt;P&gt;Suppose i do at at selection screen output it will set and once i press tab B and come back to tab C again the validation is done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If we do at initialization then the validation is done only once.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vidya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Aug 2006 10:25:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen-ouput-and-initilization/m-p/1482506#M225581</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-03T10:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: At selection-screen ouput and Initilization</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen-ouput-and-initilization/m-p/1482507#M225582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prasad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  I guess INITIALIZATION is a one time event , it will be triggered only once in Program &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  where as AT SELECTION_SCREEN OUTPUT will be triggered when we change any thing in the selection screen ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so its better to use INITIALIZATION when we want to initialize any data&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Aug 2006 10:37:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen-ouput-and-initilization/m-p/1482507#M225582</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-03T10:37:11Z</dc:date>
    </item>
  </channel>
</rss>

