Skip to Content
author's profile photo Former Member
Former Member

ALV Pop up

i want that if i click on any row in ALV Grid then pop up shud come on the basis of the selection from that pop up new report shud come (just like drill down)....

abhishek suppal

Add a comment
10|10000 characters needed characters exceeded

Related questions

5 Answers

  • Posted on Oct 20, 2005 at 11:50 AM

    Pls check this.

    Using AT LINE-SELECTION in an ALV

    ALV select line

    Message was edited by: Vinod C

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2005 at 11:50 AM

    hi,

    use this REUSE_ALV_POPUP_TO_SELECT

    cheers,

    sasi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2005 at 11:57 AM

    hi try this code.

    REPORT zdemo_alvgrid .

    TABLES: ekko.

    TYPE-POOLS: slis. "ALV Declarations

    *Data Declaration

    *----


    TYPES: BEGIN OF t_ekko,

    ebeln TYPE ekpo-ebeln,

    ebelp TYPE ekpo-ebelp,

    statu TYPE ekpo-statu,

    aedat TYPE ekpo-aedat,

    matnr TYPE ekpo-matnr,

    menge TYPE ekpo-menge,

    meins TYPE ekpo-meins,

    netpr TYPE ekpo-netpr,

    peinh TYPE ekpo-peinh,

    END OF t_ekko.

    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,

    wa_ekko TYPE t_ekko.

    *ALV data declarations

    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,

    gd_tab_group TYPE slis_t_sp_group_alv,

    gd_layout TYPE slis_layout_alv,

    gd_repid LIKE sy-repid.

    ************************************************************************

    *Start-of-selection.

    START-OF-SELECTION.

    PERFORM data_retrieval.

    PERFORM build_fieldcatalog.

    PERFORM build_layout.

    PERFORM display_alv_report.

    FORM user_command USING r_ucomm LIKE sy-ucomm

    rs_selfield TYPE slis_selfield.

    • Check function code

    CASE r_ucomm.

    WHEN '&IC1'.

    • Check field clicked on within ALVgrid report

    IF rs_selfield-fieldname = 'EBELN'.

    • Read data table, using index of row user clicked on

    READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.

    • Set parameter ID for transaction screen field

    SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.

    • Sxecute transaction ME23N, and skip initial data entry screen

    CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.

    ENDIF.

    ENDCASE.

    ENDFORM.

    &----


    *& Form BUILD_FIELDCATALOG

    &----


    • Build Fieldcatalog for ALV Report

    ----


    FORM build_fieldcatalog.

    • There are a number of ways to create a fieldcat.

    • For the purpose of this example i will build the fieldcatalog manualy

    • by populating the internal table fields individually and then

    • appending the rows. This method can be the most time consuming but can

    • also allow you more control of the final product.

    • Beware though, you need to ensure that all fields required are

    • populated. When using some of functionality available via ALV, such as

    • total. You may need to provide more information than if you were

    • simply displaying the result

    • I.e. Field type may be required in-order for

    • the 'TOTAL' function to work.

    fieldcatalog-fieldname = 'EBELN'.

    fieldcatalog-seltext_m = 'Purchase Order'.

    fieldcatalog-col_pos = 0.

    fieldcatalog-outputlen = 10.

    fieldcatalog-emphasize = 'X'.

    fieldcatalog-key = 'X'.

    • fieldcatalog-do_sum = 'X'.

    • fieldcatalog-no_zero = 'X'.

    APPEND fieldcatalog TO fieldcatalog.

    CLEAR fieldcatalog.

    fieldcatalog-fieldname = 'EBELP'.

    fieldcatalog-seltext_m = 'PO Item'.

    fieldcatalog-col_pos = 1.

    APPEND fieldcatalog TO fieldcatalog.

    CLEAR fieldcatalog.

    fieldcatalog-fieldname = 'STATU'.

    fieldcatalog-seltext_m = 'Status'.

    fieldcatalog-col_pos = 2.

    APPEND fieldcatalog TO fieldcatalog.

    CLEAR fieldcatalog.

    fieldcatalog-fieldname = 'AEDAT'.

    fieldcatalog-seltext_m = 'Item change date'.

    fieldcatalog-col_pos = 3.

    APPEND fieldcatalog TO fieldcatalog.

    CLEAR fieldcatalog.

    fieldcatalog-fieldname = 'MATNR'.

    fieldcatalog-seltext_m = 'Material Number'.

    fieldcatalog-col_pos = 4.

    APPEND fieldcatalog TO fieldcatalog.

    CLEAR fieldcatalog.

    fieldcatalog-fieldname = 'MENGE'.

    fieldcatalog-seltext_m = 'PO quantity'.

    fieldcatalog-col_pos = 5.

    APPEND fieldcatalog TO fieldcatalog.

    CLEAR fieldcatalog.

    fieldcatalog-fieldname = 'MEINS'.

    fieldcatalog-seltext_m = 'Order Unit'.

    fieldcatalog-col_pos = 6.

    APPEND fieldcatalog TO fieldcatalog.

    CLEAR fieldcatalog.

    fieldcatalog-fieldname = 'NETPR'.

    fieldcatalog-seltext_m = 'Net Price'.

    fieldcatalog-col_pos = 7.

    fieldcatalog-outputlen = 15.

    fieldcatalog-datatype = 'CURR'.

    APPEND fieldcatalog TO fieldcatalog.

    CLEAR fieldcatalog.

    fieldcatalog-fieldname = 'PEINH'.

    fieldcatalog-seltext_m = 'Price Unit'.

    fieldcatalog-col_pos = 8.

    APPEND fieldcatalog TO fieldcatalog.

    CLEAR fieldcatalog.

    ENDFORM. " BUILD_FIELDCATALOG

    &----


    *& Form BUILD_LAYOUT

    &----


    • Build layout for ALV grid report

    ----


    FORM build_layout.

    gd_layout-no_input = 'X'.

    gd_layout-colwidth_optimize = 'X'.

    gd_layout-totals_text = 'Totals'(201).

    • gd_layout-totals_only = 'X'.

    • gd_layout-f2code = 'DISP'. "Sets fcode for when double

    • "click(press f2)

    • gd_layout-zebra = 'X'.

    • gd_layout-group_change_edit = 'X'.

    • gd_layout-header_text = 'helllllo'.

    ENDFORM. " BUILD_LAYOUT

    &----


    *& Form DISPLAY_ALV_REPORT

    &----


    • Display report using ALV grid

    ----


    FORM display_alv_report.

    gd_repid = sy-repid.

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    i_callback_program = gd_repid

    • i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM

    i_callback_user_command = 'USER_COMMAND'

    • i_callback_html_end_of_list = 'END_OF_LIST_HTML'

    • i_grid_title = outtext

    is_layout = gd_layout

    it_fieldcat = fieldcatalog[]

    • it_special_groups = gd_tabgroup

    • IT_EVENTS = GT_XEVENTS

    i_save = 'X'

    • is_variant = z_template

    TABLES

    t_outtab = it_ekko

    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.

    ENDFORM. " DISPLAY_ALV_REPORT

    &----


    *& Form DATA_RETRIEVAL

    &----


    • Retrieve data form EKPO table and populate itab it_ekko

    ----


    FORM data_retrieval.

    SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh

    UP TO 10 ROWS

    FROM ekpo

    INTO TABLE it_ekko.

    ENDFORM. " DATA_RETRIEVAL

    REGARDS,

    KARTIKEY

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2005 at 12:58 PM

    Hi,

    u can try like this,

    In order to add user command functioality to the ALV grid you need to perform the following steps:

    1. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include 'USER_COMMAND' FORM

    2. Create 'USER_COMMAND' FORM

    call function 'REUSE_ALV_GRID_DISPLAY'

    exporting

    i_callback_program = gd_repid

    i_callback_top_of_page = 'TOP-OF-PAGE'

    I_callback_user_command = 'USER_COMMAND' "see FORM

    is_layout = gd_layout

    it_fieldcat = fieldcatalog[]

    i_save = 'X'

    tables

    t_outtab = it_ekko

    exceptions

    program_error = 1

    others = 2.

    ----


    • FORM USER_COMMAND *

    ----


    • --> R_UCOMM *

    • --> RS_SELFIELD *

    ----


    FORM user_command USING r_ucomm LIKE sy-ucomm

    rs_selfield TYPE slis_selfield.

    • Check function code

    CASE r_ucomm.

    WHEN '&IC1'.

    • Check field clicked on within ALVgrid report

    IF rs_selfield-fieldname = 'EBELN'.

    • Read data table, using index of row user clicked on

    READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.

    • Set parameter ID for transaction screen field

    SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.

    • Sxecute transaction ME23N, and skip initial data entry screen

    CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.

    ENDIF.

    ENDCASE.

    ENDFORM.

    Thanks,

    Ruthra

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      You can use POPUP_TO_DECIDE_LIST for Radio Buttons.

      For example,

      DATA: l_answer,

      t_spopli LIKE spopli OCCURS 0 WITH HEADER LINE.

      t_spopli-varoption = 'Option1'.

      APPEND t_spopli.

      t_spopli-varoption = 'Option2'.

      APPEND t_spopli.

      CALL FUNCTION 'POPUP_TO_DECIDE_LIST'

      EXPORTING

      • CURSORLINE = 1

      • MARK_FLAG = ' '

      • MARK_MAX = 1

      START_COL = 15

      START_ROW = 6

      textline1 = 'Hello'

      • TEXTLINE2 = ' '

      • TEXTLINE3 = ' '

      titel = 'Test'

      • DISPLAY_ONLY = ' '

      IMPORTING

      ANSWER = l_answer

      tables

      t_spopli = t_spopli

      EXCEPTIONS

      NOT_ENOUGH_ANSWERS = 1

      TOO_MUCH_ANSWERS = 2

      TOO_MUCH_MARKS = 3

      OTHERS = 4.

      IF sy-subrc <> 0.

      • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

      • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      ENDIF.

      IF l_answer EQ '2'. "Continue

      READ TABLE t_spopli WITH KEY selflag = 'X'.

      IF sy-subrc EQ 0.

      WRITE: t_spopli-varoption.

      ENDIF.

      ELSEIF l_answer EQ 'A'. "Cancel

      ENDIF.

      So call this fm first for Radio Button Options and then based on user action call your ALV report..

      Hope this helps..

      Sri

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2005 at 06:52 AM

    Hi,

    Just try the function POPUP_TO_DECIDE - This Provides the user with several choices as radio buttons

    Hope it helps u.

    Thanks&Regards,

    Ruthra

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.