Skip to Content
avatar image
Former Member

Selection Screen

Hi friends ,

How to create a button on selection screen.

what is the use of at selection-screen output event ?

regards,

sekhar

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Nov 14, 2007 at 05:02 AM

    Hi,

    Check this link for how to create a push button in the selection-screen.

    http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba81635c111d1829f0000e829fbfe/content.htm

    <b>at selection-screen output</b> is used to disable or enable fields for input...by using

    LOOP AT SCREEN..

    IF SCREEN-GROUP1 = 'M1'.

    SCREEN-INPUT = 0.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    Thanks

    Naren

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 14, 2007 at 05:03 AM

    Hi,

    Use this

    SELECTION-SCREEN PUSHBUTTON fmt name USER-COMMAND ucom.

    SELECT-OPTIONS NAME FOR SY-REPID MODIF ID XYZ.

    ...

    AT SELECTION-SCREEN OUTPUT.

    LOOP AT SCREEN.

    CHECK SCREEN-GROUP1 = 'XYZ'.

    SCREEN-INTENSIFIED = '1'.

    MODIFY SCREEN.

    ENDLOOP.

    The addition MODIF ID XYZ to the key word SELECT-OPTIONS assigns all fields of the selection option NAME to a group you can read in the field SCREEN-GROUP1. At PBO of the selection screen, all these fields are then set to highlighted.

    Regards,

    Prashant

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 14, 2007 at 05:13 AM

    Pushbuttons on the Selection Screen

    To create a pushbutton on the selection screen (similar to pushbuttons on screens), you use:

    SELECTION SCREEN PUSHBUTTON [/]<pos(len)> <push>

    USER-COMMAND <ucom> [MODIF ID <key>].

    The [/]<pos(len)> parameters and the MODIF IF addition have the same function as for the formatting options for underlines and comments.

    <push> determines the pushbutton text. For <push>, you can specify a text symbol or a field name with a maximum length of eight characters. This character field must not be declared with the DATA statement, but is generated automatically with length <len>. The field must be filled before the selection screen is called.

    For <ucom>, you must specify a code of up to four characters. When the user clicks the pushbutton on the selection screen, <ucom> is entered in the UCOMM of the SSCRFIELDS interface work area. You must use the TABLES statement to declare the SSCRFIELDS structure. The contents of the SSCRFIELDS-UCOMM field can be processed during the AT SELECTION-SCREEN event.

    REPORT DEMO.

    TABLES SSCRFIELDS.

    DATA FLAG.

    SELECTION-SCREEN:

    BEGIN OF SCREEN 500 AS WINDOW TITLE TIT,

    BEGIN OF LINE,

    PUSHBUTTON 2(10) BUT1 USER-COMMAND CLI1,

    PUSHBUTTON 12(10) TEXT-020 USER-COMMAND CLI2,

    END OF LINE,

    BEGIN OF LINE,

    PUSHBUTTON 2(10) BUT3 USER-COMMAND CLI3,

    PUSHBUTTON 12(10) TEXT-040 USER-COMMAND CLI4,

    END OF LINE,

    END OF SCREEN 500.

    AT SELECTION-SCREEN.

    CASE SSCRFIELDS.

    WHEN 'CLI1'.

    FLAG = '1'.

    WHEN 'CLI2'.

    FLAG = '2'.

    WHEN 'CLI3'.

    FLAG = '3'.

    WHEN 'CLI4'.

    FLAG = '4'.

    ENDCASE.

    START-OF-SELECTION.

    TIT = 'Four Buttons'.

    BUT1 = 'Button 1'.

    BUT3 = 'Button 3'.

    CALL SELECTION-SCREEN 500 STARTING AT 10 10.

    CASE FLAG.

    WHEN '1'.

    WRITE / 'Button 1 was clicked'.

    WHEN '2'.

    WRITE / 'Button 2 was clicked'.

    WHEN '3'.

    WRITE / 'Button 3 was clicked'.

    WHEN '4'.

    WRITE / 'Button 4 was clicked'.

    WHEN OTHERS.

    WRITE / 'No Button was clicked'.

    ENDCASE.

    This example defines four pushbuttons on a selection screen that is displayed as a dialog box. The selection screen is defined in a statement chain for keyword SELECTION-SCREEN.

    If the text symbols TEXT-020 and TEXT-040 are defined as 'Button 2' and 'Button 4', the four pushbuttons appear as follows on the selection screen displayed as a dialog box.

    CLI1, CLI2, CLI3 and CLI4 are used for <ucom>. When the user clicks one of the pushbuttons, the AT SELECTION-SCREEN event is triggered, and the FLAG field is set. The FLAG field can be further processed during subsequent program flow after the user has chosen Execute.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 14, 2007 at 05:15 AM

    Hi

    TABLES sscrfields.

    TYPE-POOLS icon.

    SELECTION-SCREEN:

    BEGIN OF SCREEN 500 AS WINDOW TITLE title,

    PUSHBUTTON 2(10) but1 USER-COMMAND cli1,

    PUSHBUTTON 12(30) but2 USER-COMMAND cli2

    VISIBLE LENGTH 10,

    END OF SCREEN 500.

    AT SELECTION-SCREEN.

    CASE sscrfields.

    WHEN 'CLI1'.

    ...

    WHEN 'CLI2'.

    ...

    ENDCASE.

    START-OF-SELECTION.

    title = 'Push button'.

    but1 = 'Button 1'.

    CALL FUNCTION 'ICON_CREATE'

    EXPORTING

    name = icon_information

    text = 'Button 2'

    info = 'My Quickinfo'

    IMPORTING

    RESULT = but2

    EXCEPTIONS

    OTHERS = 0.

    CALL SELECTION-SCREEN '0500' STARTING AT 10 10.

    check this link

    http://www.planetsap.com/howdo_a.htm#PBUTTON

    <b>AT SELECTION-SCREEN OUTPUT</b>

    This event is triggered at the screen event PBO of a selection screen. In the event block, the selection screen can be prepared through assignments to the data objects of parameters and selection criteria and through dynamic screen modifications.

    The assignments to input fields in the event block AT SELECTION-SCREEN OUTPUT always affect the selection screen and overwrite the user inputs from previous displays of the same selection screen. Assignments in the event blocks LOAD-OF-PROGRAM oder INITIALIZATION, on the other hand, only have an effect at first program start.

    <b>Reward if useful</b>

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 14, 2007 at 06:46 AM

    Hi

    Check Demo program

    DEMO_SEL_SCREEN_PUSHBUTTON

    In your system .

    Hope this Helps .

    Praveen

    Add comment
    10|10000 characters needed characters exceeded