Output screen basic list buttons

Hi frnds,
               what are the steps to create buttons in the application toolbar in our output screen.
like i m getting sales header data in my basic list so in the output i m having a button which i press then i will get sales item details.
so can anyone help me how to create that button there in the ouput screen.
regards,
sanjay

Hi,
You can copy the GUI STATUS  STANDARD of the program SAPLKKBL in SE41 and create a new one..
in that add a button in the application toolbar section..
Then use call back pf status parameter to pass the subroutine to display the gui status..
Then use call back subroutine parameter in the alv function module to give the subroutine name..
check this example for using double click to get the item details.
TYPE-POOLS: slis.
DATA: BEGIN OF itab1 OCCURS 0,
        vbeln TYPE vbeln,
        bstnk TYPE vbak-bstnk,
        erdat TYPE vbak-erdat,
        kunnr TYPE vbak-kunnr,
      END OF itab1.
DATA: BEGIN OF itab2 OCCURS 0,
        vbeln  TYPE vbeln,
        matnr  TYPE vbap-matnr,
        netpr  TYPE vbap-netpr,
        kwmeng TYPE vbap-kwmeng,
      END OF itab2.
DATA: t_fieldcatalog1 TYPE slis_t_fieldcat_alv.
DATA: t_fieldcatalog2 TYPE slis_t_fieldcat_alv.
DATA: v_repid         TYPE syrepid.
v_repid = sy-repid.
* Get the fieldcatalog1
PERFORM get_fieldcat1.
* Get the fieldcatalog2
PERFORM get_fieldcat2.
SELECT vbeln bstnk erdat kunnr UP TO 10 ROWS
       INTO TABLE itab1
       FROM vbak.
IF NOT itab1[] IS INITIAL.
  SELECT vbeln matnr netpr kwmeng UP TO 10 ROWS
         INTO TABLE itab2
         FROM vbap
         FOR ALL ENTRIES IN itab1
         WHERE vbeln = itab1-vbeln.
ENDIF.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
     EXPORTING
          i_callback_program      = v_repid
          i_callback_user_command = 'DISPLAY_DETAIL'
          it_fieldcat             = t_fieldcatalog1
     TABLES
          t_outtab                = itab1.
*       FORM display_detail                                           *
*  -->  UCOMM                                                         *
*  -->  SELFIELD                                                      *
FORM display_detail USING ucomm LIKE sy-ucomm
                        selfield TYPE slis_selfield.
  DATA: itab2_temp LIKE itab2 OCCURS 0 WITH HEADER LINE.
  IF ucomm = '&IC1'.
    READ TABLE itab1 INDEX selfield-tabindex.
    IF sy-subrc = 0.
      LOOP AT itab2 WHERE vbeln = itab1-vbeln.
        MOVE itab2 TO itab2_temp.
        APPEND itab2_temp.
      ENDLOOP.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                i_callback_program = v_repid
                it_fieldcat        = t_fieldcatalog2
           TABLES
                t_outtab           = itab2_temp.
    ENDIF.
  ENDIF.
ENDFORM.
*       FORM GET_FIELDCAT1                                            *
FORM get_fieldcat1.
  DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
  s_fieldcatalog-col_pos = '1'.
  s_fieldcatalog-fieldname = 'VBELN'.
  s_fieldcatalog-tabname   = 'ITAB1'.
  s_fieldcatalog-rollname  = 'VBELN'.
  s_fieldcatalog-hotspot   = 'X'.
  APPEND s_fieldcatalog TO t_fieldcatalog1.
  CLEAR s_fieldcatalog.
  s_fieldcatalog-col_pos = '2'.
  s_fieldcatalog-fieldname = 'BSTNK'.
  s_fieldcatalog-tabname   = 'ITAB1'.
  s_fieldcatalog-rollname  = 'BSTNK'.
  APPEND s_fieldcatalog TO t_fieldcatalog1.
  CLEAR s_fieldcatalog.
  s_fieldcatalog-col_pos = '3'.
  s_fieldcatalog-fieldname = 'ERDAT'.
  s_fieldcatalog-tabname   = 'ITAB1'.
  s_fieldcatalog-rollname  = 'ERDAT'.
  APPEND s_fieldcatalog TO t_fieldcatalog1.
  CLEAR s_fieldcatalog.
  s_fieldcatalog-col_pos = '4'.
  s_fieldcatalog-fieldname = 'KUNNR'.
  s_fieldcatalog-tabname   = 'ITAB1'.
  s_fieldcatalog-rollname  = 'KUNNR'.
  APPEND s_fieldcatalog TO t_fieldcatalog1.
  CLEAR s_fieldcatalog.
ENDFORM.
*       FORM GET_FIELDCAT2                                            *
FORM get_fieldcat2.
  DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
  s_fieldcatalog-col_pos = '1'.
  s_fieldcatalog-fieldname = 'VBELN'.
  s_fieldcatalog-tabname   = 'ITAB2'.
  s_fieldcatalog-rollname  = 'VBELN'.
  APPEND s_fieldcatalog TO t_fieldcatalog2.
  CLEAR s_fieldcatalog.
  s_fieldcatalog-col_pos = '2'.
  s_fieldcatalog-fieldname = 'MATNR'.
  s_fieldcatalog-tabname   = 'ITAB2'.
  s_fieldcatalog-rollname  = 'MATNR'.
  APPEND s_fieldcatalog TO t_fieldcatalog2.
  CLEAR s_fieldcatalog.
  s_fieldcatalog-col_pos = '3'.
  s_fieldcatalog-fieldname = 'NETPR'.
  s_fieldcatalog-tabname   = 'ITAB2'.
  s_fieldcatalog-rollname  = 'NETPR'.
  APPEND s_fieldcatalog TO t_fieldcatalog2.
  CLEAR s_fieldcatalog.
  s_fieldcatalog-col_pos = '4'.
  s_fieldcatalog-fieldname = 'KWMENG'.
  s_fieldcatalog-tabname   = 'ITAB2'.
  s_fieldcatalog-rollname  = 'KWMENG'.
  APPEND s_fieldcatalog TO t_fieldcatalog2.
  CLEAR s_fieldcatalog.
ENDFORM.
Thanks
Naren

Similar Messages

  • How to enable 'SAVE' button and trigger and event on output screen.

    Hello, in the output screen, the save button is disabled .I need to activate the button and when the user clicks on it another process must be triggered. Anyone worked on something similar before.thanks.

    Your problem description is too vague, and the problem itself seems very basic. Please read about [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers] before posting again.
    Thread locked.
    Thomas

  • How to display mutilpe list in a screen ( ALV list)

    Hello,
    Could you please help me the source code sample for displaying many list in an ALV screen (Basic list)
    For example : I 've 2 table with different information.
    Table A  Col A1 col A2 Col A3
    Table B Col B1 B2 B3 B4 B5
    Now I need to display them in only 1 screen like :
    List of record in table A
         Col A1 Col A2 Col A3
    List of record in table B
        B1 B2 B3 B4 B5
    Thanks,

    for this kind of requirement use the LIst ALV.
    The below sample code might help you
    DATA : g_t_print TYPE slis_print_alv.
    Initialize ALV
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
        EXPORTING
          i_callback_program = sy-repid.
    ADD first ALC
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          is_layout                  = g_t_layout
          it_fieldcat                 =  g_t_fieldcat[]
          i_tabname                = 'g_t_strans'
          it_events                 = g_t_events_strans
        TABLES
          t_outtab                   = g_t_strans
        EXCEPTIONS
          program_error              = 1
          maximum_of_appends_reached = 2.
      IF sy-subrc NE 0.
        MESSAGE s999 WITH 'Error in ''REUSE_ALV_LIST_DISPLAY'' FM'.
        STOP.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          is_layout                   = g_t_layout
          it_fieldcat                  = g_t_fieldcat[]
          i_tabname                 = 'g_t_sretrev'
          it_events                   = g_t_events_sretrev
        TABLES
          t_outtab                     = g_t_sretrev
        EXCEPTIONS
          program_error              = 1
          maximum_of_appends_reached = 2.
      IF sy-subrc NE 0.
        MESSAGE s999 WITH 'Error in ''REUSE_ALV_LIST_DISPLAY'' FM'.
        STOP.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          is_layout                  = g_t_layout
          it_fieldcat                = g_t_fieldcat[]
          i_tabname                  = 'g_t_stransrev'
          it_events                  = g_t_events_stransrev
        TABLES
          t_outtab                   = g_t_stransrev
        EXCEPTIONS
          program_error              = 1
          maximum_of_appends_reached = 2.
      IF sy-subrc NE 0.
        MESSAGE s999 WITH 'Error in ''REUSE_ALV_LIST_DISPLAY'' FM'.
        STOP.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          is_layout                  = g_t_layout
          it_fieldcat                = g_t_fieldcat[]
          i_tabname                  = 'g_t_sret'
          it_events                  = g_t_events_sret
        TABLES
          t_outtab                   = g_t_sret
        EXCEPTIONS
          program_error              = 1
          maximum_of_appends_reached = 2.
      IF sy-subrc NE 0.
        MESSAGE s999 WITH 'Error in ''REUSE_ALV_LIST_DISPLAY'' FM'.
        STOP.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
        EXPORTING
          is_print = g_t_print.

  • Push buttons in output screen

    Hi all
    Is this possible display the push buttons in output screen (not in selection screen).
    ex:
    write:/ 'name'.
    output:
    name       [here i want to display the push button]
    regards
    Prajwal.

    Hi
    we can put like thsi
    We can Get this using READ LINE and MODIFY LINE statements.
    Check the code below.
    Execute it and Double click on the Basic list to see the effect.
    data box.
    do 5 times.
    write: / box as checkbox, 'Hello click on me' .
    enddo.
    AT LINE-SELECTION.
    IF SY-LSIND = 1.
    SY-LSIND = 0.
    DO.
    READ LINE SY-INDEX FIELD VALUE BOX.
    IF SY-SUBRC NE 0.
    EXIT.
    ENDIF.
    BOX = 'X'.
    MODIFY LINE SY-INDEX FIELD VALUE BOX.
    ENDDO.
    ENDIF.
    <b>Reward if usefull</b>

  • I want push button on output screen

    Hi friends,
                   I want push button on toolbar output screen. After choosing this push button it will display one screen it having data below like this.
              .Division channel
              .Division
              .Sales organization
              .Sales Document
              .Sales Document Type
              .Sales Group
              .Sales office
              .Month
    Plz help me

    hi sreerama,
    to have a push button in ur report, u have to create a GUI status with command.
    u can create gui status using command SET PF-STATUS 'XXXX'.
    Create a button in GUI status, assign the function code for that button. Example FCODE.
    After creating GUI status, u have to use AT USER-COMMAND event for button of GUI status in report program.
    Then in ur report program, write like this.
    AT USER-COMMAND.
    CASE SY-UCOMM.
    WHEN 'FCODE'.
    ........................... " Your Logic to display what ever u want
    ENDCASE.
    sy-ucomm catches all the function codes of the system.
    For further reference, check these links.
    To create GUI status:
    http://help.sap.com/saphelp_47x200/helpdata/en/d1/801d43454211d189710000e8322d00/frameset.htm
    For List Events:
    http://help.sap.com/saphelp_47x200/helpdata/en/9f/dba3ae35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/9f/dba2c435c111d1829f0000e829fbfe/frameset.htm
    <b><REMOVED BY MODERATOR></b>
    Harimanjesh AN
    Message was edited by:
            Alvaro Tejada Galindo

  • Push Button on Output Screen

    Hi,
    I am having a requirement in which, I need to display the report, in the output screen I should  have a push button which when pressed the report output should be stored in the Application Layer.
    Thanks and Regards,
      V.K.

    HI Vikram,
    You can create push button in the output list. You have to use SET PF-STATUS statement.
    Just follow these stepts for creation of PUSH BUTTON.
    1. write SET PF-STATUS 'TEST'.
    2. double click on TEST.
    3. It will ask you to create status object. click on YES.
    4. give the short description and press enter.
    5. next screen you will find three things like... MENU BAR, APPLICATION TOOL BAR and FUNCTION KEYS.
    6. click on the down arrow that appears next to APPLICATION TOOL BAR.
    7. in the items, in first box write your name and press down the text. one popup box will come. press enter.
    8. give the function text and press enter.
    9. assign key for your push button. and press enter.
    10. press enter and activate.
    and run your program. you will get push button on output list.
    Adding event for the PUSHBUTTON
    For the pushbutton use an sy-ucomm ie SAVE to appln toolbar
    AT USER-COMMAND.
    CASE sy-ucomm.
    WHEN 'SAVE'.
    write your code here to save in the appln server
    Edited by: Raj on Jun 26, 2008 7:32 PM

  • Button in basic list

    Hi
    I want to set a button in basic list of a transaction,not an ALV.
    I don't want to see the button in the detail list. How should i set this and where. Ideally where should  pf-status  be set in ?.
    Answers will be  rewarded.
    Thanks
    Varun Mathur
    Edited by: Varun Mathur on Feb 12, 2008 7:42 AM

    HI,
       check this program. in this the basic list has the gui and not the detail list...here the detail list is done using alv..dont worry abt that.
    report  z_banks1_rp1.
    TABLE
    tables : zacc_master2.
    TYPE-POOLS
    type-pools slis.
    *INTERNAL TABLE
    data : itab like zacc_master2 occurs 0 with header line.
    data : itab1 like zacc_master2 occurs 0 with header line.
    DATA
    data : gt_fcat type slis_t_fieldcat_alv,
           fcat like line of gt_fcat.
    data : check type c length 1,
           wa type c length 20.
    select * from zacc_master2 into table itab.
    write : '       ACCOUNT NUMBER' intensified color 3.
    loop at itab.
    write: / check as checkbox, itab-zaccno.
    endloop.
    hide : itab.
    START OF SELECTION
    start-of-selection.
    set pf-status 'ZMBANKS1'.
    AT LINE SELECTION
    at line-selection.
    AT USER-COMMAND
    at user-command.
    case sy-ucomm.
    when 'SUBMIT'.
    do.
    read line sy-index field value check itab-zaccno into wa.
    if sy-subrc <> 0.
    exit.
    elseif check = 'X'.
    read table itab with key zaccno = wa.
    if sy-subrc eq 0.
    move-corresponding itab to itab1.
    append itab1.
    endif.
    endif.
    enddo.
    CALLING SUB-ROUTINE
    perform fieldcatalog.
    CALLING FUNCTION MODULE
    call function 'REUSE_ALV_LIST_DISPLAY'
    exporting
    it_fieldcat = gt_fcat[]
    tables
    t_outtab = itab1.
    when 'BACK'.
    call screen 0002.
    *WHEN 'BACK1'.
    *CALL SCREEN 0002.
    endcase.
    SUB ROUTINE DECLARATION
    form fieldcatalog.
    fcat-seltext_l = 'ACCOUNT NUMBER'.
    fcat-fieldname = 'ZACCNO'.
    fcat-tabname = 'ITAB1'.
    append fcat to gt_fcat.
    fcat-seltext_l = 'CUSTOMER ID'.
    fcat-fieldname = 'ZCUSTID'.
    fcat-tabname = 'ITAB1'.
    append fcat to gt_fcat.
    fcat-seltext_l = 'ACCOUNT TYPE'.
    fcat-fieldname = 'ZACCTYPE'.
    fcat-tabname = 'ITAB1'.
    append fcat to gt_fcat.
    fcat-seltext_l = 'ACCOUNT BALANCE'.
    fcat-fieldname = 'ZBAL'.
    fcat-tabname = 'ITAB1'.
    append fcat to gt_fcat.
    fcat-seltext_l = 'ACCOUNT CREATED DATE'.
    fcat-fieldname = 'ZACCDATE'.
    fcat-tabname = 'ITAB1'.
    append fcat to gt_fcat.
    fcat-seltext_l = 'STATUS'.
    fcat-fieldname = 'ZSTAT'.
    fcat-tabname = 'ITAB1'.
    append fcat to gt_fcat.
    endform.
    Please reward if it is helpful.
    regards,
    sri

  • Refreshing Basic list when i press Refresh button

    My Requirement is that when i move from the Basic list to interactive list. i am going to make some changes to internal table.
    when i came back to basic list. and when i press 'REFRESH' button in the Application Tool Bar. screen has to refresh  and display with modified data.

    Hi,
    When you press Back button you can call this method REFRESH_TABLE_DISPLAY which refresh the data in the screen in basic list if you are using the ALV Classes.

  • Refresh basic list Output

    Hi,
    I am displaying a BASIC LIST. I have to place a   u2018Refreshu2019 icon to refresh / re-execute the program from the output screen with the previously selected criteria. How can this be acheived?

    For using TOP-OF-PAGE while refreshing, you will have to do the following:
    START-OF-SELECTION.
       PERFORM DISPLAY_REPORT.
    TOP-OF-PAGE.
       PERFORM TOP_PAGE.
    AT USER-COMMAND.
       CASE SY-UCOMM.
          WHEN 'REFR'.
             PERFORM DISPLAY_REPORT.
          WHEN OTHERS.
       ENDCASE.
    TOP-OF-PAGE DURING LINE-SELECTION.
       CASE SY-LSIND.
          WHEN '1'.  
    *         Note: Though you are setting SY-LSIND = 0, it will only take effect *after* this code is executed
             PERFORM TOP_PAGE.
          WHEN OTHERS.
       ENDCASE.

  • FI Report Painter (FGI1) - add new button in output screen

    Hi all,
    I have a report created by tcode FGI1 (Create Drill-down Report) which bases on form 0SAPBSPL-01 (Fin. Statement: Actual/Actual Comparison). I wanna know if there are any ways to add a new button in output screen after report execution (i.e to print the content into smartforms).
    Thanks in advance.
    Solaris.

    Instead of creating after the output you can add the button to create the form on the main screen itself i.e. program SAPMKCEE screen1125. Either on the application tool bar or on the screen 1125.

  • How to add user command to drop down list in output screen for OALV Report

    Hi Experts,
    I have created a report by using OALV.
    in Output screen i have  added drop down for one filed with 2 values.
    when i select  value from the drop down list the  program should trigger and the next field should be update.
    so it is possiable to add a user command for the drop down list in output screen.
    if so please help me .
    Regards,
    Rathan

    HI,
    Check the Demo program BCALV_EDIT_06 with having the DATA_CHANGED event still you can capture the changed data. This event will help you.
    or you can go for this code..
    data: it_f4 type lvc_t_f4,
            wa_f4 type lvc_s_f4.
            wa_f4-FIELDNAME = 'CONNID'.
            wa_f4-REGISTER = 'X'.
            wa_f4-GETBEFORE = 'X'.
            wa_f4-CHNGEAFTER = 'X'.
            append wa_f4 to it_f4.
    "register F4 event
      CALL METHOD g_alv_grid_ref->register_f4_for_fields
        EXPORTING
          it_f4  = it_f4.
    "Once you try to pick the value HANDLE_DATA_CHANGED event will be triggered
    "Definition
         methods:
         handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid
                                  IMPORTING er_data_changed e_onf4 e_onf4_before e_onf4_after,
    "Implementation
    METHOD handle_data_changed .
        DATA: ls_mod_cells TYPE lvc_s_modi.
        IF e_onf4_before = 'X'.
          MESSAGE 'Data changed before F4' TYPE 'I'.
        ENDIF.
        IF e_onf4 = 'X'.   "if event triggered by F4
          MESSAGE 'Data changed on F4' TYPE 'I'.
        ENDIF.
        IF e_onf4_after = 'X'.
          MESSAGE 'Data changed after F4' TYPE 'I'.
        ENDIF.
       "here you know which cell was modified
        LOOP AT er_data_changed->mt_mod_cells INTO ls_mod_cells.
         "just example test case, here you can implement your code for modified cells
          IF ls_mod_cells-value >=5.
            CALL METHOD er_data_changed->add_protocol_entry
              EXPORTING
                i_msgid     = 'SABAPDOCU'
                i_msgty     = 'E'
                i_msgno     = '888'
                i_msgv1     = 'Only numbers below 5 are possibe'
                i_msgv2     = 'Please correct'
                i_fieldname = ls_mod_cells-fieldname
                i_row_id    = ls_mod_cells-row_id.
            CALL METHOD er_data_changed->modify_cell
              EXPORTING
                i_fieldname = ls_mod_cells-fieldname
                i_row_id    = ls_mod_cells-row_id
                i_value     = space.
          ENDIF.
        ENDLOOP.
      ENDMETHOD.                    "handle_data_changed
    Edited by: sum_it2 on Nov 21, 2011 10:07 AM

  • Can we control the output screen area of alv grid list

    Hi All,
    can we control the screen area of grid control in alv's , not using ooalv's. By default grid list is displaying in the whole screen, but i want  to display this grid list in specific area in output screen , not in full screen, how to set these screen area for this grid control. Please let me know.

    Hi,
    If you use the following parameters
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
    you will get the output in the size expected but it will be in the form of a pop up box and a blank screen at the back and user action like cancel etc will take you back to the selection screen.

  • Regarding Push Buttons in Output Screen

    Hi All,
    I want to add to buttons in the output screen(not in the selection-screen). I used the below code, but it was showing those buttons in selection screen. can any one help me how to get these two buttons in the output screen.
    INITIALIZATION.
      sscrfields-functxt_01 = 'AUTO POPULATE'.
      sscrfields-functxt_02 = 'SAVE'.
    AT SELECTION-SCREEN.
      CASE sscrfields-ucomm.
        WHEN 'FC01'.
        WHEN 'FC02'.
      ENDCASE.
    Thanks in advance.
    Regards,
    Ramana Prasad. T

    hi
    good
    go through this code,which ll give you brief idea about create the button in output screen
    *& Report ZSSCRBUTTON *
    *& Adds buttons to selection screen. *
    *& Demonstrates alteration of selection screen layout depending on *
    *& which button is pressed. *
    REPORT zsscrbutton NO STANDARD PAGE HEADING.
    TABLES: t030, skat, sscrfields.
    SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME
    TITLE text-001.
    SELECT-OPTIONS: p_ktopl FOR t030-ktopl,
    p_komok FOR t030-komok,
    p_ktosl FOR t030-ktosl.
    SELECTION-SCREEN SKIP.
    *SELECTION-SCREEN FUNCTION KEY 1. “Adds button to application toolbar
    Declaration of sel screen buttons
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN PUSHBUTTON (20) w_button USER-COMMAND BUT1.
    SELECTION-SCREEN PUSHBUTTON (25) w_but2 USER-COMMAND BUT2.
    SELECTION-SCREEN END OF LINE.
    SELECT-OPTIONS: p_konts FOR t030-konts,
    p_bklas FOR t030-bklas.
    PARAMETER: gd_ucomm like sy-ucomm default ‘BUT1&#8242; no-display.
    SELECTION-SCREEN END OF BLOCK block1.
    TYPES: BEGIN OF t_t030,
    ktopl TYPE t030-ktopl,
    konts TYPE t030-konts,
    txt20 TYPE skat-txt20,
    bklas TYPE t030-bklas,
    bkbez TYPE t025t-bkbez,
    END OF t_t030.
    DATA: it_t030 TYPE STANDARD TABLE OF t_t030 INITIAL SIZE 0,
    wa_t030 TYPE t_t030.
    DATA: gd_repsize TYPE i VALUE ‘83&#8242;.
    *INITIALIZATION.
    INITIALIZATION.
    Add displayed text string to buttons
    w_button = ‘GL account selection’.
    w_but2 = ‘Valuation class selection’.
    *AT SELECTION-SCREEN.
    AT SELECTION-SCREEN.
    Check if buttons have been
    if sscrfields-ucomm eq ‘BUT1&#8242;.
    gd_ucomm = ‘BUT1&#8242;.
    clear: p_BKLAS.
    refresh: p_BKLAS.
    elseif sscrfields-ucomm eq ‘BUT2&#8242;.
    clear: p_KONTS.
    refresh: p_KONTS.
    gd_ucomm = ‘BUT2&#8242;.
    endif.
    *AT SELECTION-SCREEN OUTPUT.
    AT SELECTION-SCREEN OUTPUT.
    if gd_ucomm eq ‘BUT1&#8242;.
    loop at screen.
    if screen-name CS ‘P_KONTS’.
    screen-active = 1.
    elseif screen-name CS ‘P_BKLAS’.
    screen-active = 0.
    endif.
    modify screen.
    endloop.
    elseif gd_ucomm eq ‘BUT2&#8242;.
    loop at screen.
    if screen-name CS ‘P_KONTS’.
    screen-active = 0.
    elseif screen-name CS ‘P_BKLAS’.
    screen-active = 1.
    endif.
    modify screen.
    endloop.
    endif.
    thanks
    mrutyun^

  • Need push button in output screen

    Hi Friends,
    I need to have a pushbutton in the output screen,how can i display it ? and if that push button is pressed ,it should perform an operation and display the output in next screen.
    I have a condition that the select-option should act as parameter,How can I get it.
    Thank you.
    I Promise to Reward.

    Hi
    See this code.
    SELECTION-SCREEN  BEGIN OF SCREEN 1001.
    SELECTION-SCREEN: BEGIN OF BLOCK BL WITH FRAME TITLE TIT,
                      COMMENT /30(30) WEL,
                      SKIP 3.
      PARAMETERS : FLIGHTNO  LIKE ZFLIGHT-FNO,
                   FNAME LIKE ZFLIGHT-FNAME.
      SELECTION-SCREEN: SKIP 2,
    END OF BLOCK BL.
      SELECTION-SCREEN : PUSHBUTTON 15(10) SH USER-COMMAND SHOW1,
                         PUSHBUTTON 30(10) IN USER-COMMAND INS1,
                         PUSHBUTTON 45(10) CL USER-COMMAND CLR1,
                        PUSHBUTTON  60(10) EX USER-COMMAND EX1,
                        PUSHBUTTON  73(10) NE USER-COMMAND NE1,
        END OF SCREEN 1001.
    INITIALIZATION.
    TIT = 'WELCOME TO BLOCK'.
    WEL = 'WELCOME TO SELECTION SCREEN'.
    SH = 'SHOW'.
    IN = 'INSERT'.
    CL = 'CLEAR'.
    EX = 'EXIT'.
    NE = 'NEXT SCREEN'.
    NEX = 'NEXT SCREEN1'.
    CALL SELECTION-SCREEN 1001.
    AT SELECTION-SCREEN.
    CASE SY-UCOMM.
       WHEN 'SHOW1'.
              SELECT * FROM ZFLIGHT WHERE FNO = FLIGHTNO.
              FNAME = ZFLIGHT-FNAME.
              ENDSELECT.
       WHEN 'INS1'.
             ZFLIGHT-FNO = FLIGHTNO.
             ZFLIGHT-FNAME = FNAME.
             INSERT  ZFLIGHT.
             MESSAGE  'RECORD INSERTED' TYPE  'S'.
       WHEN 'CLR1'.
             FLIGHTNO = ' '.
             FNAME = ' '.
       WHEN 'EX1'.
           LEAVE PROGRAM.
       WHEN 'NE1'.
            CALL SELECTION-SCREEN 1002.
       WHEN 'NE2'.
            CALL SELECTION-SCREEN 1001.
        ENDCASE.

  • Selection screen with radio button groups

    hi experts,
    i have 3 frames in selection screen. in first frame i have two radio buttons. if i select 1st radio button 2nd  frame should be in active and  3rd frame should be disable mode. if i select 2nd radio button then 3rd  frame should be in active and other 2nd frame should be disable mode. in which event  i need to write the code.
    can any one help me regarding this and give some sample code.
    rgds,
    nag.

    Here is the example which will explain it completely :
    *& Report  Z_sscr                                                 *
    *  Published at ****************
    *&DYNAMIC Selection screen based on user clicks on the radiobutton*
    REPORT  zsscr.
    *TYPE POOLS DECLARATIONS FOR VALUE REQUEST MANAGER AND ICONS
    TYPE-POOLS : vrm,
                 icon.
    *SELECTION SCREEN FIELDS
    TABLES : sscrfields.
    *GLOBAL DECLARATIONS
    DATA : flag TYPE c,
          tablename(10),
          mmtable LIKE dd02l-tabname,
          sdtable LIKE dd02l-tabname,
          hrtable LIKE dd02l-tabname.
    *DECLARATIONS FOR SELECTION SCREEN STATUS
    DATA it_ucomm TYPE TABLE OF sy-ucomm.
    ***********SELECTION-SCREENS**********************
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.
    *FOR DYNAMIC DISPLAY OF MODULES
    PARAMETERS :  pa RADIOBUTTON GROUP rad USER-COMMAND com MODIF ID mod,
                  pb RADIOBUTTON GROUP rad MODIF ID rad,
                  pc RADIOBUTTON GROUP rad MODIF ID cad.
    SELECTION-SCREEN SKIP.
    **TO INCLUDE DYNAMIC ICONS
    SELECTION-SCREEN COMMENT 2(6) text_001.
    *DYNAMIC LIST BOX BASED ON USER SELECTIONS
    PARAMETERS one AS LISTBOX VISIBLE LENGTH 20  MODIF ID mod.
    PARAMETERS two AS LISTBOX VISIBLE LENGTH 20   MODIF ID rad.
    PARAMETERS three AS LISTBOX VISIBLE LENGTH 20 MODIF ID cad.
    SELECTION-SCREEN END OF BLOCK blk1.
    *DISPLAY DYNAMIC PUSHBUTTON ON APP TOOLBAR ON USER CLICKS
    SELECTION-SCREEN: FUNCTION KEY 1,
                      FUNCTION KEY 2,
                      FUNCTION KEY 3.
    **EVENT ON SELECTION SCREEN FOR OUTPUT DISPLAY
    AT SELECTION-SCREEN OUTPUT.
    *CLICK OF FIRST RADIO BUTTON
      IF pa = 'X'.
        sscrfields-functxt_01 = 'Materials Management'.
        WRITE icon_plant AS ICON TO text_001.
    *CODE TO GET DYNAMICS BASED ON THE SELECTED RADIO
        LOOP AT SCREEN.
          IF screen-group1 = 'MOD'.
            screen-intensified = '1'.
            screen-active = 1.
            screen-display_3d = '1'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'RAD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'CAD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    *CLICK OF SECOND RADIO
      IF pb = 'X'.
        sscrfields-functxt_02 = 'Sales And Distribution'.
        WRITE icon_ws_ship AS ICON TO text_001.
        LOOP AT SCREEN.
          IF screen-group1 = 'RAD'.
            screen-intensified = '1'.
            screen-active = 1.
            screen-display_3d = '1'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'MOD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'CAD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    *CLICK OF THIRD RADIO
      IF pc = 'X'.
        sscrfields-functxt_03 = 'Human Resources'.
        WRITE icon_new_employee AS ICON TO text_001.
        LOOP AT SCREEN.
          IF screen-group1 = 'RAD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'MOD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'CAD'.
            screen-intensified = '1'.
            screen-active = 1.
            screen-display_3d = '1'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    *CUSTOMISING THE TOOLBARS OF THE SELECTION SCREEN
    *WITH F8 BUTTON DISABLED
      APPEND :  'PRIN' TO it_ucomm,
                'SPOS' TO it_ucomm,
                'ONLI' TO it_ucomm.
      CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
        EXPORTING
          p_status  = sy-pfkey
        TABLES
          p_exclude = it_ucomm.
    **EVENT ON THE SELECTION
    AT SELECTION-SCREEN.
    * LIST BOX ONE VALUES
      CASE one.
        WHEN '1'.
          mmtable = 'MARC'.
        WHEN '2'.
          mmtable = 'MARA'.
        WHEN '3'.
          mmtable = 'MARD'.
        WHEN '4'.
          mmtable = 'MARM'.
      ENDCASE.
    * LIST BOX TWO VALUES
      CASE two.
        WHEN '1'.
          sdtable = 'VBAK'.
        WHEN '2'.
          sdtable = 'VBAP'.
        WHEN '3'.
          sdtable = 'VBUK'.
        WHEN '4'.
          sdtable = 'VBUP'.
      ENDCASE.
    * LIST BOX THREE VALUES
      CASE three.
        WHEN '1'.
          hrtable = 'PA0001'.
        WHEN '2'.
          hrtable = 'PA0006'.
        WHEN '3'.
          hrtable = 'PA0022'.
        WHEN '4'.
          hrtable = 'PA0008'.
      ENDCASE.
    *VALUES FOR CLICK OF THE PUSHBUTTON ON APP TOOLBAR
    *AND ENABLING THE BUTTONS TO PERFORM F8
      CASE sscrfields-ucomm.
        WHEN 'FC01'.
          tablename = mmtable.
          sscrfields-ucomm = 'ONLI'.
        WHEN 'FC02'.
          tablename = sdtable.
          sscrfields-ucomm = 'ONLI'.
        WHEN 'FC03'.
          tablename = hrtable.
          sscrfields-ucomm = 'ONLI'.
      ENDCASE.
    *INITIALIZATION EVENT
    INITIALIZATION.
    *VALUES ASSIGNED TO DROPDOWNLISTS IN THE SUBROUTINES
      PERFORM f4_value_request_pa.
      PERFORM f4_value_request_pb.
      PERFORM f4_value_request_pc.
    *START OF SELECTION EVENT
    START-OF-SELECTION.
    *SUBROUTINE FOR OUTPUT
      PERFORM output.
    *&      Form  f4_value_request_PA
    *       text
    *SUBROUTINE TO PROVIDE DROPDOWN VALUES TO LIST1
    FORM f4_value_request_pa.
      DATA: l_name TYPE vrm_id,
            li_list TYPE vrm_values,
            l_value LIKE LINE OF li_list.
      l_value-key = '1'.
      l_value-text = 'Plant Data for Material'.
      APPEND l_value TO li_list.
      CLEAR l_value.
      l_value-key = '2'.
      l_value-text = 'General Material Data'.
      APPEND l_value TO li_list.
      CLEAR l_value.
      l_value-key = '3'.
      l_value-text = 'Storage Location Data for Material'.
      APPEND l_value TO li_list.
      CLEAR l_value.
      l_value-key = '4'.
      l_value-text = 'Units of Measure for Material'.
      APPEND l_value TO li_list.
      CLEAR l_value.
      l_name = 'ONE'.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = l_name
          values          = li_list
        EXCEPTIONS
          id_illegal_name = 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.
    ENDFORM. " f4_value_request_tabname
    *&      Form  f4_value_request_PB
    *       text
    *SUBROUTINE TO PROVIDE DROPDOWN VALUES TO LIST2
    FORM f4_value_request_pb.
      DATA: l_name TYPE vrm_id,
            li_list TYPE vrm_values,
            l_value LIKE LINE OF li_list.
      l_value-key = '1'.
      l_value-text = 'Sales Document: Header Data'.
      APPEND l_value TO li_list.
      CLEAR l_value.
      l_value-key = '2'.
      l_value-text = 'Sales Document: Item Data'.
      APPEND l_value TO li_list.
      CLEAR l_value.
      l_value-key = '3'.
      l_value-text = 'Sales Document:Header Status'.
      APPEND l_value TO li_list.
      CLEAR l_value.
      l_value-key = '4'.
      l_value-text = 'Sales Document: Item Status'.
      APPEND l_value TO li_list.
      CLEAR l_value.
      l_name = 'TWO'.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = l_name
          values          = li_list
        EXCEPTIONS
          id_illegal_name = 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.
    ENDFORM. " f4_value_request_PB
    *&      Form  f4_value_request_PC
    *       text
    *SUBROUTINE TO PROVIDE DROPDOWN VALUES TO LIST3
    FORM f4_value_request_pc.
      DATA: l_name TYPE vrm_id,
            li_list TYPE vrm_values,
            l_value LIKE LINE OF li_list.
      l_value-key = '1'.
      l_value-text = 'HR Master :Infotype 0001 (Org. Assignment)'.
      APPEND l_value TO li_list.
      CLEAR l_value.
      l_value-key = '2'.
      l_value-text = 'Address Infotype 0006'.
      APPEND l_value TO li_list.
      CLEAR l_value.
      l_value-key = '3'.
      l_value-text = 'Education Infotype 0022'.
      APPEND l_value TO li_list.
      CLEAR l_value.
      l_value-key = '4'.
      l_value-text = 'Basic Pay Infotype 0008'.
      APPEND l_value TO li_list.
      CLEAR l_value.
      l_name = 'THREE'.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = l_name
          values          = li_list
        EXCEPTIONS
          id_illegal_name = 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.
    ENDFORM. " f4_value_request_PC
    *&      Form  OUTPUT
    *       text
    *      -->P_TABLENAME  text
    *fINAL OUTPUT
    FORM output.
      DATA p_table(10).
      p_table = tablename.
    *popup to display teh selected table and
    *Continue button is clicked
      CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
        EXPORTING
          titel        = 'User Selections '
          textline1    = p_table
          textline2    = 'is the Selected table'
          start_column = 25
          start_row    = 6.
    *assigning the table value in p_table to the
    * Table in SE16 transaction by explicitly calling
      SET PARAMETER ID 'DTB' FIELD p_table.
      CALL TRANSACTION 'SE16'.
    ENDFORM.                    "OUTPUT
    Reward If found Helpful.

Maybe you are looking for