How to Add Push Button On Selection Screen

Hi Experts,
How to add Push button on Selection Screen.
Points will b rewarded for useful help.
Bohra.

Hi,
To create a pushbutton on the selection screen, 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-SCREENevent.
Ex.
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.
Regards,
Bhaskar

Similar Messages

  • ADD push button in selection-screen

    Hi Guys,
    I have a requirement.
    In the selection screen on the report, I need a push button "Click".
    When i "Click"  First Time this it should display all the selection screen Blocks B1,B2,B3 from my selection screen.
    For second "Click" it should Hide the Blocks B1,B2,B3.
    I am doing the following code in my report:
    But for first Click it is displaying the Blocks.And for the Second click it is not Hiding.
    Please suggest on this.....
    initialization.
      if screen-group1 = 'A1' .
                screen-active = 0.
                modify screen.
              endif.
            endloop.
            loop at screen.
              if screen-group1 = 'A2' .
                screen-active = 0.
                modify screen.
              endif.
            endloop.
            loop at screen.
              if screen-group1 = 'A3' .
                screen-active = 0.
                modify screen.
              endif.
            endloop.
    I am using " At selection screen:
    at selection-screen.
    if gv_flag = space.
            loop at screen.
              if screen-group1 = 'A1' .
                screen-active = 1.
                modify screen.
              endif.
            endloop.
            loop at screen.
              if screen-group1 = 'A2' .
                screen-active = 1.
                modify screen.
              endif.
            endloop.
            loop at screen.
              if screen-group1 = 'A3' .
                screen-active = 1.
                modify screen.
              endif.
            endloop.
            gv_flag = 'X'.
          elseif gv_flag = 'X'.
                  loop at screen.
              if screen-group1 = 'A1' .
                screen-active = 0.
                modify screen.
              endif.
            endloop.
            loop at screen.
              if screen-group1 = 'A2' .
                screen-active = 0.
                modify screen.
              endif.
            endloop.
            loop at screen.
              if screen-group1 = 'A3' .
                screen-active = 0.
                modify screen.
              endif.
            endloop.
            gv_flag = space.
    endif.

    You are hiding it in INITIALIZATION block which means it hides only once before PBO. If you want to show/hide it in turn simply place all your code in PAI, not just part of it.
    Regards
    Marcin
    Sorry didn't notice part of the code in the bottom
    The logic should go like
    at selection-screen.
    if gv_flag = space.
    loop at screen.
      case screen-group1.
         when 'A1' or 'A2' or 'A3'    
            screen-active = 1.
            modify screen.
         when others.
       endcase.
    endloop.
    gv_flag = 'X'.
    elseif gv_flag = 'X'.
       loop at screen.
          case screen-group1.
               when 'A1' or 'A2' or 'A3'.
                screen-active = 0.
                modify screen.
             when others.
        endcase.
    endloop.
      gv_flag = space.
    endif.
    Regards
    Marcin
    Edited by: Marcin Pciak on Apr 1, 2011 12:33 PM

  • How to add push buttons in out put screen of ALV

    Hai,
    How to add push buttons in out put screen of ALV (tool bar) with out using classes or methods .I want to know using normal ALV .
    Thanks in advance .
    kiran

    Hi Kiran,
    Here is the sample code.If you are using reuse_alv_grid_display, no need to write code in PBO.
    Just double click the 'TEST' which is written in code.Then create a GUI Status.In Application toolbar,type the name of the button you want(say BUTTON).Then double click that name.Then enter the ICON name and function text.Activate it.This itself will work.If you want all the functionalities,then try to do as Vinod told.
    TYPE-POOLS: slis.
    DATA: i_qmel LIKE qmel OCCURS 0.
    data v_repid type repid.
    SELECT * FROM qmel INTO TABLE i_qmel.
    v_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = v_repid
       I_CALLBACK_PF_STATUS_SET          = 'SET_PF_STATUS'
       I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
       i_structure_name                  = 'QMEL'
      TABLES
        t_outtab                          = i_qmel
      EXCEPTIONS
        program_error                     = 1
        OTHERS                            = 2.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    form set_pf_status using rt_extab type slis_t_extab.
    set pf-status '<b>TEST</b>'.
    endform.
    FORM user_command USING ucomm LIKE sy-ucomm
                             selfield TYPE slis_selfield.
    data lv_ucomm type sy-ucomm.
    lv_ucomm
    = sy-ucomm.                                        
      CASE lv_ucomm.
        WHEN 'BUTTON'.                              "Double Click line Item
          call transaction 'MM01'.
      endcase.
    endform.

  • Push button on selection screen

    Hi,
    I have provided push button on selection screen after input fields I mean just below to input fields by using the syntax selection screen pushbutton…..   And it is appearing on the selection screen.  As per the requirement I need to enter material number on the selection screen and if I press corresponding push button I need to call one transaction using bdc program.  I wrote case sy-comm and corresponding user command ( whatever is there in the selection screen syntax) in when condition under start of selection event.
    But the control is not going to that place after I press push button. If I put that code inside of at selection screen it is going. But I can not write all the bdc program and select queries inside of at selection screen event if so please suggest me how I can proceed.
    I will give the points.
    Thanks a lot in advance.

    Hi,
    SELECTION-SCREEN BEGIN OF BLOCK b_2 WITH FRAME TITLE text-018.
    SELECT-OPTIONS s_fields FOR qpmk-mkmnr NO-DISPLAY.
    SELECTION-SCREEN PUSHBUTTON /1(24) name USER-COMMAND flds.
    SELECTION-SCREEN END OF BLOCK b_2.
    AT SELECTION-SCREEN.
    IF sscrfields-ucomm = 'FLDS'.
        PERFORM display_fields.
      ENDIF.

  • How to add push button in alv display with out class or method

    Hai,
    How to add push buttons in out put screen of ALV (tool bar) with out using classes or methods .I want to know using normal ALV .
    Thanks in advance .
    kiran

    You should post your question in the ABAP forum.
    ABAP Development

  • Error during creation of push button on selection screen

    Hi,
    I wanted to create push buttons on selection screen,
    Code:
    DATA DB1 TYPE VBAP-WERKS.
    DATA DB2 TYPE MARA-MATNR.
    SELECT-OPTIONS : SPLANT FOR DB1,
                                    SCLASS FOR DB2.
    SELECTION-SCREEN:  FUNCTION KEY 1,
                                        FUNCTION KEY 2,
                                        FUNCTION KEY 3.
    INITIALIZATION.
    DATA FUNCTXT TYPE SMP_DYNTXT.
    CLEAR FUNCTXT.
    DATA: FUNCTXT_01 TYPE SSCRFIELDS-FUNCTXT_01.
    FUNCTXT-TEXT = 'DEL'.
    SSCRFIELDS-FUNCTXT_01 = FUNCTXT.
    CLEAR FUNCTXT.
    FUNCTXT-TEXT = 'EDIT'.
    SSCRFIELDS-FUNCTXT_02 = FUNCTXT.
    CLEAR FUNCTXT.
    FUNCTXT-TEXT = 'CRE'.
    SSCRFIELDS-FUNCTXT_03 = FUNCTXT.
    But during activating, I'm getting the error as : Field "SSCRFIELDS-FUNCTXT_01" is unknown. It is neither in one of the specified tables nor defined by "DATA" statement.
    Please suggest solutions to overcome this error.
    Regards
    Darshan MS

    Hi,
    trans. for examples of selection screen : BIBS
    regards
    Fred

  • Creating push button on Selection screen application toolbar

    Hi Friends,
    this is a HR-ABAP report. I have to create a push button on Selection screen. when user clicks on that push button 'MODAL DIALOG BOX' has to be displayed containing some data.
    plz kindly give some sample code to do this.
    Regards,
    Radhika Dasharatha.

    Hi,
    1)Use SELECTION-SCREEN  PUSHBUTTON /10(20) PUSH USER-
      COMMAND 'ABC'. in selection screen.
    2) Give the static name to button in INITIALIZATION event like PUSH = 'PRESS'.
    3) At selection screen.
      if sy-ucomm eq 'ABC'.
    call FM HR_BE_GE_MODAL_DIALOG
    endif.
    Thanks
    Sandeep
    Reward if useful

  • How to disable save button on selection screen (1000) run from other report

    Hi Experts,
    Can any one let me know how to disable save button on selection screen (1000) run from other report.
    Say I am running from report R1 which submits report R2, but the save button should be disabled on
    report R2(selection screen 100).
    Thanks in advance.
    Regards
    RP.

    Hi RPReddy16 ,
    Try this:
    DATA :BEGIN OF t_extab occurs 0,
                     fcode like rsmpe-func,
                 END OF t_extab.
    REFRESH T_EXTAB.
    MOVE 'SAVE' TO T_EXTAB-FCODE.
    APPEND T_EXTAB.
    CLEAR T_EXTAB.
    SET PF-STATUS 'STATUS' EXCLUDING T_EXTAB.
    Regards,
    José

  • How to add push button in application tool bar in SAP transaction VA01

    How to add push button in application tool bar in SAP standard transaction VA01 and how to implement the code for that function code.

    There is no scope to create a push button in application tool bar. Instead of that we can add in a menu bar.

  • How to add push button in function module

    I want to add Push button( yes/no) in same screen. I used POPUP_TO_CONFIRM,
    but this popup is coming on next screen when I click on cancel button.

    There is no scope to create a push button in application tool bar. Instead of that we can add in a menu bar.

  • In table view, how to add one button for selecting page?

    Hi Experts,
    In the OBIEE 11.1.1.6, we have one uncommon requirement that customers want to randomly select actual page to view expected data in table view.
    For example:
    We make use of some columns to create one report in table view, and set 'Rows per Page' equal to '5',
    if this report contains 60 rows, it will have 12 pages, so customers want to select sepcial page number to view the some data. Is it possible to implement this requirement? Maybe we should write JS code.
    Note: Below table view, it has four buttons: First Row, Previous Row, Next Row and Display (500) rows in per page. So we want to add one button to select per page.
    We look at orgnial codes in WebBrowse, but do not know the following codes derive from which JS file.
    Could you please tell me how to find this file?
    <td class="TapeDeckCell"><img class="TapeDeckImage" onclick="" onkeypress="" src="res/s_blafp/viewui/pivot/first_dis.png" title="" alt="" ><img class="TapeDeckImage" onclick="" onkeypress="" src="res/s_blafp/viewui/pivot/previous_dis.png" title="" alt="" ><img class="TapeDeckImageEna" onclick="PTRowScroll('saw_5083_b','5','5', event)" onkeypress="PTRowScroll('saw_5083_b','5','5', event)" src="res/s_blafp/viewui/pivot/next_ena.png" tabIndex="0" onmouseover="PTTD(event, 'res/s_blafp/viewui/pivot/next_ovr.png');" onmouseout="PTTDO(event)" onmousedown="PTTD(event, 'res/s_blafp/viewui/pivot/next_dwn.png');" title="Next 5 Rows" alt="Next 5 Rows" ><img class="TapeDeckImageEna" onclick="*PTRowScroll*('saw_5083_b','-1)', event)" onkeypress="PTRowScroll('saw_5083_b','-1)', event)" src="res/s_blafp/viewui/pivot/showallrows_ena.png" tabIndex="0" onmouseover="PTTD(event, 'res/s_blafp/viewui/pivot/showallrows_ovr.png');" onmouseout="PTTDO(event)" onmousedown="PTTD(event, 'res/s_blafp/viewui/pivot/showallrows_dwn.png');" title="Display maximum (500) rows per page" alt="Display maximum (500) rows per page" > <Span class="TapeDeckRecords">Rows 1 - 5</Span></td>

    Hi Kobe,
    Thanks for listening me.
    I agree 11g have some issues unlike 10g. I've tried the same by creating a measure rcount(1) and name it as Page in RPD. I just pulled column Page in pivot table section 'Pivot Table Prompts' it is working but this may not answer your requirements.
    I would suggest to use the column in Prompt and go by between operator to allow user to select the rows between.
    In the report make Page as prompted.
    If you are okay with this can look forward to tweak it further, like values in the prompt multiple of 5 or 10s some thing like that.
    let me know updates on the same.

  • How to disable execute button in selection-screen

    Hi,
    I have already placed a execute button in selection screen but now I want to diable
         1. All std  buttons including F8
         2.   but excluding F1
    regards
    paul

    Hi
    Check this FM : RS_SET_SELSCREEN_STATUS
    sample code :
    DATA: BEGIN OF i_exc OCCURS 0,
           code LIKE sy-ucomm,
       END OF i_exc.
      DATA: ws_repid like sy-repid.
      CLEAR i_exc.
      i_exc-code = 'ONLI'.
      APPEND i_exc.
      MOVE: sy-repid TO ws_repid .
      CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
        EXPORTING
          p_status  = ' '
          p_program = ws_repid
        TABLES
          p_exclude = i_exc.
    Laxman
    Message was edited by: Laxmana Kumar

  • How to add push button in report.

    Hi,
    how to add a push button in the standard list report and on clicking which the line-size of the screen should reduce from 300 to 100.
    how to proceed.
    Can anyone help me.
    Regards
    Guhapriyan

    Hii Guhapriyam,
    You can ceate PUSHBUTTON in selection-screen like Below
    SELECTION-SCREEN PUSHBUTTON 2(10) text-004 USER-COMMAND CL1.
    Create a variable to hold the processed PUSHBUTTON value like
    DATA v_flag TYPE flag.
    The PUSHBUTTON will be processed at the event AT SELECTION-SCREEN. So write your code like below
    AT SELECTION-SCREEN.
       IF sy-ucomm EQ 'CL1'.
         v_flag = 1.          "Buttob clicked
       ENDIF.
    START-OF-SELECTION.
    IF v_flag EQ 1.
         NEW-PAGE LINE-SIZE 100.
    ENDIF.
    OR
    The best way of doing this by setting PF-STATUS like
    START-OF-SELCTION.
    SET PF-STATUS 'ZSTATUS'.  "Double click on this and set the pushButton in standard toolbar option and in function key specify the BACK, EXIT and CANCEL button .
    Then write your logic at the event AT USER-COMMAND.
    AT USER-COMMAND.
       CASE sy-ucomm.
         WHEN 'RED'.
           NEW-PAGE LINE-SIZE 100.
         WHEN 'BACK' OR 'CANCEL' OR 'EXIT'.
           LEAVE SCREEN.
         WHEN OTHERS.
       ENDCASE.
    regards
    Syed

  • How to add push button on UI?

    Hi,
    I would like to add a push button 'PROCESS' on one assignment block. When user selects the pushbutton I would like to execute some custom functionality. How do I achieve this?
    Regards,
    Akash

    Hi,
      Please add the below code in the htm page of your view
    <thtmlb: button id = Search
    on Click = Search
    text = Search
    tooltip = Search />
    Regards,
    Lakshmi.Y
    Edited by: Lakshmi Soujanya on Jun 7, 2011 11:09 AM
    Edited by: Lakshmi Soujanya on Jun 7, 2011 11:11 AM

  • How to hide  gui buttons in selection screen

    In Selection screen how to hide buttons like back, exit,cancel buttons.
    can any  one help.

    Hi,
    Create a new GUI Status for your program.. put whatever button you require for it..
    In the AT SELECTION-SCREEN OUTPUT event..
    SET pf-status xxx.
    Regards,
    Anand

Maybe you are looking for

  • "Item 000010 does not exist" During VA01 save

    Hi all, I have performed a validation to throw a error message if the validation fails. The code is written in side userexit_save_document, I get my error message which is correct. After my message gets triggered SAP standard popup error messgae "Ite

  • 11.2.0.3 Windows DB install of dbconsole , repos and service creation error

    Hello all, I am stumped at this error when recreating the repository on a windows 2008 server install of the dbconsole for a active database. It seems that it's not able to create or delete the service even after deconfiguring it. any ideas ? the ins

  • Install ARD 1.2 Admin on Tiger

    I have the ARD 1.0 Install CD which I have used to install ARD 1.0 on to my Tiger-enable Mac. However when I launch ARD I get the message "The Remote Desktop software doesn't appear to be installed correctly. Please verify it is installed and restart

  • BAPI_PO_GETDETAIL1 issue.

    Hi, all. I meet a runtime error after using the below function in my program. I totally dun know how to start to solve it   CALL FUNCTION 'BAPI_PO_GETDETAIL1'     EXPORTING       PURCHASEORDER            = PO_NUMBER      DELIVERY_ADDRESS         = 'X

  • Web form taking too long to generate

    Hello I have a Data Form issue, My webform contains more than a 1000 CCenters in the page view. When selecting any of the CCenters the Data Form generates perfectly, all accept one of them!! Once a user selects that Center, it takes about 2.5 hours t