What is the use of selection -screen on field

Hi,
Can anyone tell me the use of at selection-screen on field and its syntax?
Regards,
Hema

Hi Hema,
AT SELECTION-SCREEN selscreen_event.
<b>Effect</b>
This statement defines event blocks for different events selscreen_event that are triggered by the ABAP runtime environment during selection screen processing.
Selection screen events occur immediately before sending a selection screen and after certain user actions on a displayed selection screen. They assist in selection screen processing in the ABAP program.
AT SELECTION-SCREEN is triggered at least twice during actions on selection screens that are linked into another selection screen as a subscreen - first for the linked selection screen itself, and then for the linking selection screens.
Note
The event blocks after AT SELECTION-SCREEN are implemented internally as procedures. Declarative statments in these event blocks create local data.
<b>Differenct Options:</b>
  | { ON {para|selcrit} }
  | { ON END OF selcrit }
  | { ON BLOCK block }
  | { ON RADIOBUTTON GROUP radi }
  | { }
  | { ON {HELP-REQUEST|VALUE-REQUEST}
  |   FOR {para|selcrit-low|selcrit-high} }
  | { ON EXIT-COMMAND }.
<b>Example</b>
REPORT demo_at_selection_screen.
Global data
DATA: sflight_tab TYPE TABLE OF sflight,
      sflight_wa  LIKE LINE  OF sflight_tab.
Selection screens
PARAMETERS p_carrid TYPE spfli-carrid.
SELECTION-SCREEN BEGIN OF SCREEN 500.
  SELECT-OPTIONS s_conn FOR sflight_wa-connid.
  DATA s_conn_wa LIKE LINE OF s_conn.
SELECTION-SCREEN END OF SCREEN 500.
Handling selection screen events
AT SELECTION-SCREEN ON p_carrid.
  IF p_carrid IS INITIAL.
    MESSAGE 'Please enter a value' TYPE 'E'.
  ENDIF.
  AUTHORITY-CHECK OBJECT 'S_CARRID'
                      ID 'CARRID' FIELD p_carrid
                      ID 'ACTVT'  FIELD '03'.
  IF sy-subrc = 4.
    MESSAGE 'No authorization for carrier' TYPE 'E'.
  ELSEIF sy-subrc <> 0.
    MESSAGE 'Error in authority check' TYPE 'A'.
  ELSE.
    IF sy-ucomm = 'ONLI'.
      CALL SELECTION-SCREEN '0500'.
    ENDIF.
  ENDIF.
AT SELECTION-SCREEN.
  IF sy-dynnr = '0500'.
    IF s_conn IS INITIAL.
      MESSAGE 'Please enter values' TYPE 'W'.
    ELSE.
      SELECT *
             FROM sflight
             INTO TABLE sflight_tab
             WHERE carrid = p_carrid AND
                   connid IN s_conn.
      IF sy-subrc <> 0.
        MESSAGE 'No flights found' TYPE 'E'.
      ENDIF.
    ENDIF.
  ENDIF.
Main program
START-OF-SELECTION.

Similar Messages

  • What r the list of selection screen events

    What r the list of selection screen events

    hi,
    chk out the following links...
    http://help.sap.com/saphelp_nw04/helpdata/en/56/1eb6c705ad11d2952f0000e8353423/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9a2e35c111d1829f0000e829fbfe/content.htm
    http://www.sap-img.com/abap/different-types-of-selection-screens.htm
    Regards,
    Viji

  • Regarding the event AT SELECTION-SCREEN ON FIELD ..

    Hi experts,
    Can u plz tell the real advantage of the event AT SELECTION-SCREEN ON FIELD than
    AT SELECTION-SCREEN ..
    in which type of situations  AT SELECTION-SCREEN ON FIELD is needed??
    Thanks & Regards,
    sathish.

    Hi,
    when we are going to do two are more field validations at a time
    we can use AT SELECTION-SCREEN ON <fieldname>.
    if it is there single field we can use AT SELECTION-SCREEN.
    have a look.
    select-options: s_vbeln like vbak-vbeln,
                          s_vkorg like vbak-vkorg,
                          s_vtweg like vbak-vtweg,
                          s_matnr like vbap-matnr.
    AT SELECTION-SCREEN ON s_vbeln.
    select----
    if sy-subrc <> 0.
    error message.
    endif.
    AT SELECTION-SCREEN ON s_vkorg.
    select----
    if sy-subrc <> 0.
    error message.
    endif.
    AT SELECTION-SCREEN ON s_vtweg.
    select----
    if sy-subrc <> 0.
    error message.
    endif.
    AT SELECTION-SCREEN ON s_matnr.
    select----
    if sy-subrc <> 0.
    error message.
    endif.
    Regards.
    sriram.

  • What is the use of EIN_FEDERAL and EIN_STATE_LOCAL fields in Voucher header record (PeopleSoft AP) ?

    What is the use of EIN_FEDERAL and EIN_STATE_LOCAL fields in Voucher header record (PeopleSoft AP) ? And where can we check record field related information in PeopleBooks ?

    Hi User,
    The best place to search for questions like this one is OTN, Oracle Technology Network. If you have any question about CLOUD and partnering with Oracle we will be more than glad to help! Thanks.

  • How to use At Selection Screen for fields whiledealing with Multiple Blocks

    Hi Guys,
                In my requirement i am having 4 blocks.1st block with raduio buttons for activating the opther 3 Blocks.
                  In these 3 blocks i am having some fields.
           How to do Validation for these fields.?
    I am using At Selection-screen on S-SCAD1. I am getting error"S_SCACD1 is neither a selection screen nor a Parameter"
    On the top of this" At Selection-screen on S-SCAD1" I am having"AT SELECTION-SCREEN OUTPUT."
                    Can anybody tell me how to solve this error?
    Thanks,
    Gopi.

    If you are using your block name than you should use like:
    AT SELECTION-SCREEN ON BLOCK S-SCAD1.
    Regards,
    Naimesh Patel

  • Hello experts help me in using at selection-screen.

    i am using like ........
    at selection-screen on s_werks.
    then i am checking for another selection screen field like
    if 10 in s_bwart or 20 in s_bwart.
       if 99 not in s_bwart and 191 in s_bwart.
    s_bwart-low = 99.
    append s_bwart.
    s_bwart-low = 191.
    append s_bwart.
    endif.
    endif.
    Eventhough if i inputed bwart value in the selection screen it is not showing while debugging, and results also not comming ie s_bwart  is not populated by the vaules that are entered at the selection screen. If i remove at selection-screen on s_matnr then the s_bwart is having values. so please kindly tell me why it is happening like this . i want to use at selection-screen on field and also like above if 10 in s_bwart ...etc.
    So please tell me what to do. Thank you so much.

    Hi
    At selection-screen On <field> is used to validate the fields and to give some error messages if the condition is not met
    Write the code in the at selection-screen on S_BWART.
    event and see
    here in this case you are appending the values to s_bwart.
    it will come into the field
    Regards
    Anji

  • Regarding At Selection-Screen On field

    Hi..
    When we wil use At Selection-Screen On <Field>
    and  At Selection-Screen On Radiobutton.
    What is the purpose of these events.
    I need samplecode for these events.
    Regards
    Sandeep.

    Hi Sandeep
    hope this will help you.
    REPORT zextest595 .
    *--- Radiobuttons
    PARAMETERS: p_up RADIOBUTTON GROUP a DEFAULT 'X' USER-COMMAND rb,
    p_list RADIOBUTTON GROUP a.
    PARAMETERS: p_pcfile LIKE rlgrap-filename OBLIGATORY DEFAULT 'C:\'
    MODIF ID ccc,
    p_pctype LIKE rlgrap-filetype OBLIGATORY DEFAULT 'ASC'
    MODIF ID ccc,
    p_unix LIKE rlgrap-filename OBLIGATORY DEFAULT '.\'
    MODIF ID ccc.
    PARAMETERS: p_dir LIKE rlgrap-filename OBLIGATORY DEFAULT '.'
    MODIF ID ddd,
    p_fp LIKE rlgrap-filename
    MODIF ID ddd.
    AT SELECTION-SCREEN
    AT SELECTION-SCREEN OUTPUT.
    IF p_up = 'X' .
    LOOP AT SCREEN.
    CASE screen-group1.
    WHEN 'CCC'.
    screen-input = 1. "Enable
    screen-invisible = 0. "Disable
    MODIFY SCREEN.
    WHEN 'DDD'.
    screen-input = 0.
    screen-invisible = 1.
    MODIFY SCREEN.
    ENDCASE.
    ENDLOOP.
    ENDIF.
    IF p_list = 'X'.
    LOOP AT SCREEN.
    CASE screen-group1.
    WHEN 'CCC'.
    screen-input = 0.
    screen-invisible = 1.
    MODIFY SCREEN.
    WHEN 'DDD'.
    screen-input = 1.
    screen-invisible = 0.
    MODIFY SCREEN.
    ENDCASE.
    ENDLOOP.
    ENDIF.

  • At selection-screen on field

    friends can u tell me the difference between atselection-screen and at selection-screen on field?

    First of all the actual order of events
    INITIALIZATION
         AT SELECTION-SCREEN OUTPUT
         AT SELECTION-SCREEN ON <field>
         AT SELECTION-SCREEN     
    START-OF-SELECTION
    INITIALIZATION
    This event occurs before the standard selection screen is called. You can use it, for example, to initialize the input fields of the standard selection screen or you can assign your own default values.
    REPORT EVENT_DEMO.
    PARAMETERS DATUM TYPE SY-DATUM DEFAULT SY-DATUM.
    NODES SPFLI.
    INITIALIZATION.
      CITY_FR = 'NEW YORK'.
      CITY_TO = 'FRANKFURT'.
      CARRID-SIGN   = 'I'.
      CARRID-OPTION = 'EQ'.
      CARRID-LOW    = 'AA'.
      APPEND CARRID.
      DATUM+6(2) = '01'.
    In the PBO of the selection screen, the
    AT SELECTION-SCREEN OUTPUT
    event is triggered. This event block allows you to modify the selection screen directly before it is displayed.
    PARAMETERS: TEST1(10) MODIF ID SC1,
                TEST2(10) MODIF ID SC2,
                TEST3(10) MODIF ID SC1,
                TEST4(10) MODIF ID SC2.
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'SC1'.
        SCREEN-INTENSIFIED = '1'.
        MODIFY SCREEN.
        CONTINUE.
      ENDIF.
      IF SCREEN-GROUP1 = 'SC2'.
        SCREEN-INTENSIFIED = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
    The parameters TEST1 and TEST3 are assigned to the modification group SC1, while TEST2 and TEST4 are assigned to group SC2. During the AT SELECTION-SCREEN OUTPUT event, the INTENSIFIED field of internal table SCREEN is set to 1 or 0, depending on the contents of the GROUP1 field. On the selection screen, the lines for TEST1 and TEST3 are highlighted while those for TEST2 and TEST4 are not.
    In the PAI event of the selection screen, the event
    AT SELECTION-SCREEN ON <field>
    is triggered when the contents of each individual input field are passed from the selection screen to the ABAP program. The input field <field> can be checked in the corresponding event block. If an error message occurs within this event block, the corresponding field is made ready for input again on the selection screen.
    The program below is connected to the logical database F1S:
    REPORT EVENT_DEMO.
    NODES SPFLI.
    AT SELECTION-SCREEN ON CITY_FR.
      IF CARRID-LOW EQ 'AA' AND CITY_FR NE 'NEW YORK'.
        MESSAGE E010(HB).
      ENDIF.
    If the user enters "AA" in the first input field, but not NEW YORK for the departure city, an error message is displayed in the status line until the user enters the correct city.
    The AT SELECTION-SCREEN event is triggered in the PAI of the selection screen once the ABAP runtime environment has passed all of the input data from the selection screen to the ABAP program. If an error message occurs in this processing block, the selection screen is redisplayed with all of its fields ready for input. This allows you to check input values for consistency.
    The program below is connected to the logical database F1S:
    REPORT EVENT_DEMO.
    NODES SPFLI.
    AT SELECTION-SCREEN.
      IF CARRID-LOW IS INITIAL
        OR CITY_FR IS INITIAL
        OR CITY_TO IS INITIAL.
        MESSAGE E000(HB).
      ENDIF.
    If the user does not enter values in all of the fields on the selection screen, an error message appears in the status line. This makes all of the input fields mandatory, even though they are not defined as such in the logical database.
    Reward points, if the issue is resolved.
    Regards,
    Raman
    Message was edited by:
            Raman Vinocha

  • What is the use of additon in up to 1 rows in SELECT statement

    Hi All,
             What is the use of up to 1 rows in select statement.
    for example
    SELECT kostl
          FROM pa0001
          INTO y_lv_kostl UP TO 1 ROWS
          WHERE pernr EQ pernr
          AND endda GE sy-datum.
        ENDSELECT.
    I'm unable to get in wat situations we hav to add up to 1 rows
    please help me out...
    Thanks,
    santosh.

    Hi,
    Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s) you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the second or the third record has the value you are looking for.
    The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS.
    The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.
    Regards,
    Bhaskar

  • How to schedule the background job using current selection screen field val

    Hello Friends,
    How to schedule the background job using current selection screen field values.
    after completion of the job the spool should be sent as a mail to SAP Inbox.
    Is there any way to create the variant dynamically by reading the current selection screen values.
    Thanks,
    Ravi

    Hi,
    To get the variant details you can use teh following FM.
    'RS_VARIANT_CONTENTS'.
    Regards,
    Ankur Parab

  • What is the use of "end of selection" event in report

    Hi all
    As we can display the outputs in the "start-of-selection "using the write statement.
    Then what is the use of "end-of-selection" in reports.
    Please tell me with some real tiem examples.
    God points will be rewarded.
    Thanks

    Hi,
    The END-OF-SELECTION event is triggered in type executable programs once the logical database has finished reading all data and before the list processor is started.
    It tells the server that all the database reading is completed and no further reading is going to take place..
    For more details go through the following link:
    http://help.sap.com/saphelp_me21sp2/helpdata/en/9f/db9aca35c111d1829f0000e829fbfe/content.htm
    END-OF-SELECTION is used mostly when you are using Logical data base in your report. It is triggered when all selection get finished from the data base.
      You can use write statments in start of selection and end of selection also.
      But the one use of end of selection is... if you want to stop the processing of a certain code and directly display some message you can use this.
    start-of-selection.
      select data..
      process data
    if no data .
    stop.
    endif.
    write data
    end-of-selection.
    write : 'No data to display.
    Stop command will take the control to end of selection event.
    thanks,
    mahesh
    Message was edited by:
            I Can Solve It

  • What is the use of for all entries in select statement

    what is the use of for all entries in select statement

    hi,
    FOR ALL ENTRIES is an effective way of doing away with using JOIN on two tables.
    You can check the below code -
    SELECT BUKRS BELNR GJAHR AUGDT
    FROM BSEG
    INTO TABLE I_BSEG
    WHERE BUKRS = ....
    SELECT BUKRS BELNR BLART BLDAT
    FROM BKPF
    INTO TABLE I_BKPF
    FOR ALL ENTRIES IN I_BSEG
    WHERE BUKRS = I_BSEG-BUKRS
    AND BELNR = I_BSEG-BELNR
    AND BLDAT IN SO_BLDAT.
    *******************************8
    look another example
    what is the use of FOR ALL ENTRIES
    1. INNER JOIN
    DBTAB1 <----
    > DBTAB2
    It is used to JOIN two DATABASE tables
    having some COMMON fields.
    2. Whereas
    For All Entries,
    DBTAB1 <----
    > ITAB1
    is not at all related to two DATABASE tables.
    It is related to INTERNAL table.
    3. If we want to fetch data
    from some DBTABLE1
    but we want to fetch
    for only some records
    which are contained in some internal table,
    then we use for alll entries.
    1. simple example of for all entries.
    2. NOTE THAT
    In for all entries,
    it is NOT necessary to use TWO DBTABLES.
    (as against JOIN)
    3. use this program (just copy paste)
    it will fetch data
    from T001
    FOR ONLY TWO COMPANIES (as mentioned in itab)
    4
    REPORT abc.
    DATA : BEGIN OF itab OCCURS 0,
    bukrs LIKE t001-bukrs,
    END OF itab.
    DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
    itab-bukrs = '1000'.
    APPEND itab.
    itab-bukrs = '1100'.
    APPEND itab.
    SELECT * FROM t001
    INTO TABLE t001
    FOR ALL ENTRIES IN itab
    WHERE bukrs = itab-bukrs.
    LOOP AT t001.
    WRITE :/ t001-bukrs.
    ENDLOOP.
    Hope this helps!
    Regards,
    Anver
    <i>if hlped pls mark points</i>

  • What is the use of Lead selection?

    Hi Experts
    i am new to webdynpro.
    i would like to understand what is the use of lead selection and why do we need it?
    Thanks
    Abdul Hakim
    Moderator Message: Basic WDA question. Please search before posting
    Edited by: Suhas Saha on Aug 14, 2011 1:11 PM

    Lead selection is used to set the values to the context element.
    if you have a table and if you use lead selection , it will show that particular record highlighted.
    If you are using a drop down and used a set_lead_selection method for that, you can actually set the desired option in the list of entries.
    Basically you have an option , to set the desired entry in the list of options.
    if you are using a get_lead_selection method, you can get the selected value to the context element.

  • HOW TO PASS THE DATA FROM SELECTION SCREEN TO STANDARD TRANSACTION?

    HI,
    HOW TO PASS THE DATA FROM SELECTION SCREEN TO STANDARD TRANSACTION?
    thanks,
    samba.

    By selection screen, what do you mean?   There is no selection screen in WDA as there was in classic dynpro. Do you mean you are using the Select-Options reusable component?  Are you wanting to call a standard transaction via ITS - SAPGUI for HTML?  Please provide more details to your question.

  • I am dual booting my mackbook pro with windows 7 64 bit. Yesterday it started locking up at the disk drive selections screen, when you hold down the "option" butting when powering on. I have been searching all morning, and so far nothing. Thanks. :)

    Hey folks,
    I have been using bootcamp for months now with windows 7 64 bit, and its been fine, yesterday while I was rebooting to do some gaming, at the hard drive selection screen when you boot holding the "options" butting down, it locks up when I select the windows drive and just sits there for ever. It doesn't throw an error, it boots fine into Lion.
    I searched all morning and didn't find anything, was hoping that someone might have an idea.
    Thanks in advance

    Search again. Microsoft has tips on what to do and Windows has a number of features
    system restore points
    automatic system repair using the Win7 DVD
    system restore image creation
    Just like you would with OS X Lion and Lion Recovery and Repair
    Use WinClone 3 www.twocanoes.com $20 to make an image just like you would with Disk Utility Restore or Carbon Copy Cloner
    rollback to last known good boot check point
    rollback a driver or program or any changes
    clean out temp files
    clean registry
    chkdsk
    https://discussions.apple.com/people/The%20hatter?view=bookmarks

Maybe you are looking for