Skip to Content
avatar image
Former Member

"AT SELECTION-SCREEN ON " events abap

execution sequence of "AT SELECTION-SCREEN ON " events in abap program

on select screen i have 2 radio buttons

rb_unix and rb_prest

and have one parameter p_infile which has on value request written for it..

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_infile.

IF rb_unix EQ 'X'.

PERFORM value_req_from_unix CHANGING p_infile.

ENDIF.

IF rb_prest EQ 'X'.

PERFORM value_req_from_front_end CHANGING p_infile.

ENDIF.

but i m not getting the sequence of events to use to make this work

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

9 Answers

  • avatar image
    Former Member
    Jun 24, 2008 at 03:14 PM

    u have to use two parameter.... and u put an user command for the radio-button

    Edited by: Amitava De on Jun 24, 2008 8:44 PM

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      PARAMETERS: p_outfl TYPE localfile MODIF ID o1, "Data file name

      p_o_pc TYPE localfile MODIF ID o2, "PC file name

      p_pc_o RADIOBUTTON GROUP out

      USER-COMMAND ucomm, "Prsntation srvr

      p_srv_o RADIOBUTTON GROUP out "Applicatn srvr

      DEFAULT 'X'.

      at selection output

      LOOP AT SCREEN.

      • If PC file chosen then set p_o_pc otherwise p_outfl

      IF screen-group1 = c_mo1.

      IF p_pc_o = c_check.

      screen-active = 0.

      ENDIF.

      ELSEIF screen-group1 = c_mo2.

      IF p_srv_o = c_check.

      screen-active = 0.

      ENDIF.

      endloop.

      AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_f_pc.

      • Provide a F4 help for source file

      PERFORM sub_pcfile_f4 USING p_f_pc.

      AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.

      • Provide a F4 help for source file

      PERFORM sub_server_file_f4 USING p_fname.

  • avatar image
    Former Member
    Jun 24, 2008 at 03:15 PM

    hi,

    Press F4 button on p_infile field to trigger the event ..

    Regards,

    Santosh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 24, 2008 at 03:16 PM

    hiiii

    you refer following program..its same as yours.so it will solve your problem..see the events

    PARAMETERS:
      p_pfile TYPE rlgrap-filename OBLIGATORY.
    " File Name
    
    
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS p_rad1 TYPE c RADIOBUTTON GROUP gr  DEFAULT 'X' USER-COMMAND usr .
    SELECTION-SCREEN COMMENT 3(16) text-005.
    SELECTION-SCREEN END OF LINE.
    
    
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS p_rad2 TYPE c RADIOBUTTON GROUP gr.
    SELECTION-SCREEN COMMENT 3(16) text-006.
    SELECTION-SCREEN END OF LINE.
    
    PARAMETERS p_docno(11) TYPE c .
    " Document Number
    
    
    AT SELECTION-SCREEN OUTPUT .
    
      IF p_rad2 IS INITIAL .
        LOOP AT SCREEN.
          IF screen-name CS 'p_docno'.
            screen-active = 0.
            MODIFY SCREEN.
          ENDIF.                           " IF screen-name CS 'p_docno'.
        ENDLOOP.                           " LOOP AT SCREEN.
    
      ELSE.
        LOOP AT SCREEN .
          IF screen-name CS 'p_docno'.
            screen-active = 1.
            screen-input = 1.
            MODIFY SCREEN.
          ENDIF.                           " IF screen-name CS 'p_docno'.
        ENDLOOP.                           " LOOP AT SCREEN .
      ENDIF.                               " IF p_rad2 IS INITIAL .
    
      w_docno = p_docno.
    
    *----------------------------------------------------------------------*
    *         A T   S E L E C T I O N     S C R E E N                      *
    *----------------------------------------------------------------------*
    
    
    
    
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_pfile.
      CALL FUNCTION 'F4_FILENAME'
       EXPORTING
         program_name        = syst-cprog
         dynpro_number       = syst-dynnr
    *   FIELD_NAME          = ' '
       IMPORTING
         file_name           = p_pfile.
    
    
    *AT SELECTION-SCREEN ON p_docno.
    *  IF p_rad2 EQ 'X'.
    *    IF p_docno IS INITIAL.
    *      MESSAGE 'Please enter Document Number' TYPE 'E'.
    *    ELSE.
    *      PERFORM get_excel_data_create.
    *    ENDIF.
    *  ENDIF.
    
    
    START-OF-SELECTION.
    
      IF p_rad1 EQ 'X'.
    
        PERFORM create_change_document.    " For Creating Change Document
    
      ELSEIF p_rad2 EQ 'X'.
    
        PERFORM change_change_document.    " For Changing in Change Document
    
    
      ENDIF.                               " IF p_rad1 EQ 'X'.

    <removed_by_moderator_together_with_some points>

    thx

    twinkal

    Edited by: Julius Bussche on Jun 24, 2008 6:56 PM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 24, 2008 at 03:17 PM

    hiiii

    you refer following program..its same as yours.so it will solve your problem..see the events

    PARAMETERS:
      p_pfile TYPE rlgrap-filename OBLIGATORY.
    " File Name
    
    
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS p_rad1 TYPE c RADIOBUTTON GROUP gr  DEFAULT 'X' USER-COMMAND usr .
    SELECTION-SCREEN COMMENT 3(16) text-005.
    SELECTION-SCREEN END OF LINE.
    
    
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS p_rad2 TYPE c RADIOBUTTON GROUP gr.
    SELECTION-SCREEN COMMENT 3(16) text-006.
    SELECTION-SCREEN END OF LINE.
    
    PARAMETERS p_docno(11) TYPE c .
    " Document Number
    
    
    AT SELECTION-SCREEN OUTPUT .
    
      IF p_rad2 IS INITIAL .
        LOOP AT SCREEN.
          IF screen-name CS 'p_docno'.
            screen-active = 0.
            MODIFY SCREEN.
          ENDIF.                           " IF screen-name CS 'p_docno'.
        ENDLOOP.                           " LOOP AT SCREEN.
    
      ELSE.
        LOOP AT SCREEN .
          IF screen-name CS 'p_docno'.
            screen-active = 1.
            screen-input = 1.
            MODIFY SCREEN.
          ENDIF.                           " IF screen-name CS 'p_docno'.
        ENDLOOP.                           " LOOP AT SCREEN .
      ENDIF.                               " IF p_rad2 IS INITIAL .
    
      w_docno = p_docno.
    
    *----------------------------------------------------------------------*
    *         A T   S E L E C T I O N     S C R E E N                      *
    *----------------------------------------------------------------------*
    
    
    
    
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_pfile.
      CALL FUNCTION 'F4_FILENAME'
       EXPORTING
         program_name        = syst-cprog
         dynpro_number       = syst-dynnr
    *   FIELD_NAME          = ' '
       IMPORTING
         file_name           = p_pfile.
    
    
    *AT SELECTION-SCREEN ON p_docno.
    *  IF p_rad2 EQ 'X'.
    *    IF p_docno IS INITIAL.
    *      MESSAGE 'Please enter Document Number' TYPE 'E'.
    *    ELSE.
    *      PERFORM get_excel_data_create.
    *    ENDIF.
    *  ENDIF.
    
    
    START-OF-SELECTION.
    
      IF p_rad1 EQ 'X'.
    
        PERFORM create_change_document.    " For Creating Change Document
    
      ELSEIF p_rad2 EQ 'X'.
    
        PERFORM change_change_document.    " For Changing in Change Document
    
    
      ENDIF.                               " IF p_rad1 EQ 'X'.

    reward if useful

    thx

    twinkal

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 24, 2008 at 03:17 PM

    Hi

    Enter like this:

    PARAMETERS : rb_unix RADIOBUTTON GROUP grp USER-COMMAND rb.

    PARAMETERS: rb_prest RADIOBUTTON GROUP grp .

    Regards,

    Subramanian

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 24, 2008 at 03:19 PM

    Hi,

    SELECTION-SCREEN
      BEGIN OF BLOCK bookid
                WITH FRAME.
    
    PARAMETERS:
      p_ccf1 TYPE c                        " Carrid Connid Fldate
             RADIOBUTTON GROUP rad2
             MODIF ID 002,
      p_ccfb TYPE c                        " Carrid Connid Fldate Bookid
             RADIOBUTTON GROUP rad2
             MODIF ID 002.
    
    SELECT-OPTIONS:
      s_bookid FOR sbook-bookid            " Booking Id Range
               MODIF ID 002.
    
    SELECTION-SCREEN
      END OF BLOCK bookid.

    Put parameters under selection screen block ,

    and use Selection screen on block event.

    Regards,

    Nisrin.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 24, 2008 at 03:21 PM
    • i_dynptab LIKE dynpread OCCURS 0

    REFRESH i_dynptab.

    MOVE 'P_AS' TO i_dynptab-fieldname.

    APPEND i_dynptab.

    • FM to Read screen field values before PAI field transport

    CALL FUNCTION 'DYNP_VALUES_READ'

    EXPORTING

    dyname = sy-cprog

    dynumb = sy-dynnr

    TABLES

    dynpfields = i_dynptab

    EXCEPTIONS

    invalid_abapworkarea = 1

    invalid_dynprofield = 2

    invalid_dynproname = 3

    invalid_dynpronummer = 4

    invalid_request = 5

    no_fielddescription = 6

    invalid_parameter = 7

    undefind_error = 8

    double_conversion = 9

    stepl_not_found = 10

    OTHERS = 11.

    IF sy-subrc NE 0.

    MESSAGE i999(zz) WITH 'Could not read Screen Values'(004).

    ENDIF. " IF sy-subrc ne 0.

    READ TABLE i_dynptab INDEX 1.

    IF sy-subrc EQ 0.

    IF i_dynptab-fieldvalue EQ 'X'.

    • Download file to Application Server

    MOVE 'X' TO p_as.

    CLEAR p_ps.

    ELSE.

    • Download file to Presentation Server

    MOVE 'X' TO p_ps.

    CLEAR p_as.

    ENDIF. " IF i_dynptab-fieldvalue EQ 'X'

    ENDIF. " IF sy-subrc EQ 0

    • Get the input file path from Presentation Serv. or Appl. Serv.

    • depending on the Radio Button selected

    IF p_as EQ c_true_x. " Application Server

    • Application Server

    CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'

    EXPORTING

    directory = './'

    IMPORTING

    serverfile = p_path

    EXCEPTIONS

    canceled_by_user = 1

    OTHERS = 2.

    IF sy-subrc NE 0.

    MESSAGE i999(zz) WITH 'F4 Help Error'(005).

    ENDIF. " IF SY-SUBRC NE 0.

    ELSE.

    • Presentation Server

    CALL FUNCTION 'F4_FILENAME'

    EXPORTING

    program_name = syst-cprog

    dynpro_number = syst-dynnr

    field_name = ' '

    IMPORTING

    file_name = p_path.

    ENDIF. " IF p_as EQ 'X'

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 24, 2008 at 05:32 PM

    I used similar logic for a project with different radiobuttons and entry fields.

    Selection-screen begin of block blk.

    Parameters: rb_1 RADIOBUTTON GROUP rad1,

    rb_2 RADIOBUTTON GROUP rad2 default 'X',

    p_file type C.

    Selecion-screen end of block blk.

    At selection-screenoutput.

    Start-of-selection.

    IF p_file is not initial.

    If rb_1 EQ 'X'.

    Perfom rb_1_p_file.

    Else.

    Perform rb_2_p_file.

    Endif.

    else.

    Message e000(00) with text-001. "error for no entry in p_file.

    endif.

    Regards,

    C

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 25, 2008 at 05:53 AM

    Hai Neha !!

    If u observe ur code, U have placed the validations for radio buttons under the event

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_infile. Instead if u have another event called AT SELECTION-SCREEN ON radiobutton group. Try to keep the code for radio buttons under this event.

    The event AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_infile. Will get u the F4 help for the field p_infile.

    The execution sequence will be the sequence in which u place the fields on the selection-screen. But the events AT SELECTION-SCREEN ON HELP/VALUE REQUEST triggers when u press F1 or F4 keys .

    Reward if useful.

    Regards,

    Swapna.

    Add comment
    10|10000 characters needed characters exceeded