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

Interactive Reports & End-of -selection

Hi,

First is it possible to open two secondary list at a time on the click of one event.For eq. I click in the 3rd list is it possible that on its click 5 and 7 list opens .If possible then provide with some code.

Second question When the END of Selection Event is fired.What we actually write in the end of selection event.

regards

harpreet

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 20, 2006 at 11:29 AM

    Hai

    go through the following Code

    &----


    *& Report ZSSSS1 *

    *& *

    &----


    *& *

    *& *

    &----


    REPORT ZSSSS1 LINE-SIZE 120

    LINE-COUNT 25(3)

    MESSAGE-ID ZSAN.

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

    *Program Desc: INTERACTIVE REPORT FOR PURCHASE ORDER DETAILS

    • BASIC LIST CONTAINS HEADER DETAILS

    • SECONDARY LIST CONTAINS ITEM DETAILS

    • AND CONDETION RECORD DETAILS

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

    • T A B L E S U S E D *

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

    TABLES: EKKO,EKPO,KONV,LFA1,T001.

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

    • S E L E C T I O N S C R E E N *

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

    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.

    SELECT-OPTIONS:

    S_LIFNR FOR EKKO-LIFNR,

    S_BUKRS FOR EKKO-BUKRS.

    SELECTION-SCREEN END OF BLOCK B1.

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

    • D A T A D E C L A R A T I O N S *

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

    DATA: BEGIN OF IT_EKKO OCCURS 0,

    BUKRS LIKE EKKO-BUKRS,

    LIFNR LIKE EKKO-LIFNR,

    EBELN LIKE EKKO-EBELN,

    KNUMV LIKE EKKO-KNUMV,

    END OF IT_EKKO.

    DATA: BEGIN OF IT_EKPO OCCURS 0,

    EBELN LIKE EKPO-EBELN,

    EBELP LIKE EKPO-EBELP,

    MATNR LIKE EKPO-MATNR,

    INFNR LIKE EKPO-INFNR,

    MENGE LIKE EKPO-MENGE,

    MEINS LIKE EKPO-MEINS,

    NETPR LIKE EKPO-NETPR,

    END OF IT_EKPO.

    DATA: BEGIN OF IT_KONV OCCURS 0,

    KNUMV LIKE KONV-KNUMV,

    KSCHL LIKE KONV-KSCHL,

    KAWRT LIKE KONV-KAWRT,

    KBETR LIKE KONV-KBETR,

    KPOSN LIKE KONV-KPOSN,

    END OF IT_KONV.

    DATA: BEGIN OF IT_LFA1 OCCURS 0,

    LIFNR LIKE LFA1-LIFNR,

    NAME1 LIKE LFA1-NAME1,

    STRAS LIKE LFA1-STRAS,

    ORT01 LIKE LFA1-ORT01,

    PSTLZ LIKE LFA1-PSTLZ,

    LAND1 LIKE LFA1-LAND1,

    END OF IT_LFA1.

    DATA: V_BUTXT LIKE T001-BUTXT,

    FNAM(20) TYPE C,

    FVAL(20) TYPE C.

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

    • A T S E L E C T I O N - S C R E E N O N <FIELD> *

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

    AT SELECTION-SCREEN ON S_BUKRS.

    PERFORM VALIDATE.

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

    • S T A R T - O F - S E L E C T I O N *

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

    START-OF-SELECTION.

    PERFORM SELECT_DATA. " SELECTION OF ALL DATA

    PERFORM DISPLAY_DATA. " DISPLAY OF BASIC LIST

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

    • A T L I N E S E L E C T I O N *

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

    AT LINE-SELECTION.

    GET CURSOR FIELD FNAM VALUE FVAL.

    CASE FNAM.

    WHEN 'IT_EKKO-EBELN'.

    PERFORM DISPLAY_SEC1.

    WHEN 'IT_EKKO-LIFNR'.

    PERFORM DISPLAY_SEC2.

    WHEN OTHERS.

    PERFORM DISPLAY_SEC3.

    ENDCASE.

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

    • T O P - O F - P A G E *

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

    TOP-OF-PAGE.

    PERFORM WRITE_HEADER.

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

    • T O P - O F - P A G E D U R I N G L I N E S E L *

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

    TOP-OF-PAGE DURING LINE-SELECTION.

    PERFORM WRITE_HEADER2.

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

    • E N D - O F - P A G E *

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

    END-OF-PAGE.

    PERFORM WRITE_FOOTER.

    &----


    *& Form SELECT_DATA

    &----


    • THIS FORM CONTAINS ALL SELECTION OF DATA STATEMENTS

    ----


    form SELECT_DATA.

    SELECT BUKRS LIFNR EBELN KNUMV

    FROM EKKO

    INTO TABLE IT_EKKO

    WHERE LIFNR IN S_LIFNR

    AND BUKRS IN S_BUKRS.

    IF NOT IT_EKKO[] IS INITIAL.

    SELECT EBELN EBELP MATNR INFNR MENGE MEINS NETPR

    FROM EKPO

    INTO TABLE IT_EKPO

    FOR ALL ENTRIES IN IT_EKKO

    WHERE EBELN = IT_EKKO-EBELN.

    IF SY-SUBRC = 0.

    LOOP AT IT_EKKO.

    LOOP AT IT_EKPO.

    SELECT KNUMV KSCHL KAWRT KBETR KPOSN

    FROM KONV

    INTO IT_KONV

    WHERE KNUMV = IT_EKKO-KNUMV

    AND KPOSN = IT_EKPO-EBELP.

    APPEND IT_KONV.

    ENDSELECT.

    ENDLOOP.

    ENDLOOP.

    ENDIF." END OF IF FOR CHECK OF SY-SUBRC

    SELECT LIFNR NAME1 STRAS ORT01 PSTLZ LAND1

    INTO TABLE IT_LFA1

    FROM LFA1

    FOR ALL ENTRIES IN IT_EKKO

    WHERE LIFNR = IT_EKKO-LIFNR.

    ENDIF." END OF IF FOR IT_EKKO IS NOT INITIAL

    endform. " SELECT_DATA

    &----


    *& Form DISPLAY_DATA

    &----


    • DISPLAY THE BASIC DATA

    ----


    form DISPLAY_DATA.

    DATA: LINNO TYPE I.

    SORT IT_EKKO BY BUKRS LIFNR EBELN.

    LOOP AT IT_EKKO.

    READ TABLE IT_LFA1 WITH KEY LIFNR = IT_EKKO-LIFNR.

    SELECT SINGLE BUTXT

    FROM T001

    INTO (V_BUTXT)

    WHERE BUKRS = IT_EKKO-BUKRS.

    WRITE:/1 SY-VLINE,

    (10) IT_EKKO-EBELN HOTSPOT ON,

    SY-VLINE,

    (10) IT_EKKO-LIFNR HOTSPOT ON,

    SY-VLINE,

    (15) IT_LFA1-NAME1 HOTSPOT ON,

    SY-VLINE,

    (10) IT_EKKO-BUKRS HOTSPOT ON,

    SY-VLINE,

    (15) V_BUTXT,

    75 SY-VLINE.

    HIDE: IT_EKKO-EBELN,

    IT_EKKO-LIFNR.

    WRITE:/1(75) SY-ULINE.

    AT END OF LIFNR.

    LINNO = SY-LINCT - SY-LINNO - 1.

    SKIP LINNO.

    ENDAT.

    ENDLOOP.

    endform. " DISPLAY_DATA

    &----


    *& Form DISPLAY_SEC3

    &----


    form DISPLAY_SEC3.

    LOOP AT IT_EKPO.

    CLEAR: IT_EKPO, IT_KONV.

    READ TABLE IT_EKPO WITH KEY EBELN = IT_EKKO-EBELN.

    IF SY-SUBRC = 0.

    FORMAT COLOR 3.

    WRITE:/1 SY-VLINE,

    (10) IT_EKPO-EBELN,

    SY-VLINE,

    (10) IT_EKPO-EBELP,

    SY-VLINE,

    (18) IT_EKPO-MATNR,

    SY-VLINE,

    (10) IT_EKPO-INFNR,

    SY-VLINE,

    (15) IT_EKPO-MENGE,

    SY-VLINE,

    (10) IT_EKPO-MEINS,

    SY-VLINE,

    (12) IT_EKPO-NETPR,

    105 SY-VLINE.

    FORMAT COLOR OFF.

    WRITE:/1(105) SY-ULINE.

    FORMAT COLOR 4.

    READ TABLE IT_KONV WITH KEY KPOSN = IT_EKPO-EBELP.

    IF SY-SUBRC = 0.

    WRITE:/1 SY-VLINE,

    (10) IT_KONV-KNUMV,

    SY-VLINE,

    (10) IT_KONV-KSCHL,

    SY-VLINE,

    (15) IT_KONV-KAWRT,

    SY-VLINE,

    (12) IT_KONV-KBETR,

    SY-VLINE.

    WRITE:/1(95) SY-ULINE.

    FORMAT COLOR OFF.

    ENDIF.

    ENDIF.

    ENDLOOP.

    endform. " DISPLAY_SEC3

    &----


    *& Form DISPLAY_SEC1

    &----


    • TO CALL TRANSACTION ME23

    ----


    form DISPLAY_SEC1.

    SET PARAMETER ID 'BES' FIELD IT_EKKO-EBELN.

    CALL TRANSACTION 'ME23' AND SKIP FIRST SCREEN.

    endform. " DISPLAY_SEC1

    &----


    *& Form WRITE_HEADER

    &----


    • HEADER DISPLAY

    ----


    form WRITE_HEADER.

    FORMAT COLOR 3.

    WRITE:/1 SY-VLINE,

    (10) 'PUR.ORDER',

    SY-VLINE,

    (10) 'VENDOR',

    SY-VLINE,

    (15) 'NAME',

    SY-VLINE,

    (10) 'COMP.CODE',

    SY-VLINE,

    (15) 'COMP.DESC',

    75 SY-VLINE.

    WRITE:/1(75) SY-ULINE.

    FORMAT COLOR OFF.

    endform. " WRITE_HEADER

    &----


    *& Form WRITE_FOOTER

    &----


    • FOOTER OF LIST

    ----


    form WRITE_FOOTER.

    FORMAT COLOR 4.

    WRITE: /1 'USER:',SY-UNAME,

    45 'DATE:', SY-DATUM.

    FORMAT COLOR OFF.

    endform. " WRITE_FOOTER

    &----


    *& Form WRITE_HEADER2

    &----


    • HEADER FOR SECONDARY LIST

    ----


    form WRITE_HEADER2.

    FORMAT COLOR 4.

    WRITE: /30 'INTELLIGROUP ASIA PVT LTD' CENTERED.

    WRITE:/50 'HYDERABAD' CENTERED.

    FORMAT COLOR 5.

    WRITE:/1 SY-VLINE,

    (10) 'PUR.ORDR',

    SY-VLINE,

    (10) 'ITEM',

    SY-VLINE,

    (18) 'MATERIAL NUMBER',

    SY-VLINE,

    (10) 'INFO.RECD',

    SY-VLINE,

    (15) 'QUANTITY',

    SY-VLINE,

    (10) 'UNITS',

    SY-VLINE,

    (12) 'NETPRICE',

    105 SY-VLINE.

    FORMAT COLOR OFF.

    WRITE:/1(105) SY-ULINE.

    FORMAT COLOR 6.

    WRITE:/1 SY-VLINE,

    (10) 'COND.RECD',

    SY-VLINE,

    (10) 'TYPE',

    SY-VLINE,

    (15) 'BASE VALUE',

    SY-VLINE,

    (12) 'AMOUNT',

    SY-VLINE.

    FORMAT COLOR OFF.

    WRITE:/1(95) SY-ULINE.

    endform. " WRITE_HEADER2

    &----


    *& Form DISPLAY_SEC2

    &----


    • TO DISPLAY VENDOR DETAILS IN POP UP WINDOW

    ----


    form DISPLAY_SEC2.

    READ TABLE IT_LFA1 WITH KEY LIFNR = IT_EKKO-LIFNR.

    IF SY-SUBRC = 0.

    WRITE:/ 'NAME IS:' , IT_LFA1-NAME1,

    / 'STREET IS:', IT_LFA1-STRAS,

    / 'CITY IS:', IT_LFA1-ORT01,

    / 'POSTEL CODE IS:',IT_LFA1-PSTLZ,

    / 'COUNTRY IS: ', IT_LFA1-LAND1.

    WINDOW STARTING AT 1 15

    ENDING AT 50 20.

    ENDIF.

    endform. " DISPLAY_SEC2

    &----


    *& Form VALIDATE

    &----


    • VALIDATE BUKRS

    ----


    form VALIDATE.

    SELECT SINGLE *

    FROM T001

    WHERE BUKRS IN S_BUKRS.

    IF SY-SUBRC <> 0.

    MESSAGE E001.

    ENDIF.

    endform. " VALIDATE

    Thanks & regards

    Sreenivasulu P

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 20, 2006 at 11:30 AM

    Hi Harpeet,

    1)<b>It is not possible</b> to display two lists on click of a event.You can go through only ONE list at a time.

    2)<b>The END-OF-SELECTION</b> is usally used to display report summary information.The output of report is usually displayed over here as per requirement of user.

    Thanks,

    Vinay

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 20, 2006 at 11:31 AM

    Hi,

    It is not possible to display 2 lists in the sametime.

    In end-of-selection event will be triggered only atfer all the processed completed. i.e 'Any Summary details'

    Ex:

    in the ALV,

    call these FMs REUSE_ALV_LIST_DISPLAY and REUSE_ALV_GRID_DISPLAY in End of selection event .

    In call transaction method

    Sumary details like

    No of Successful records,No of Error records

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 20, 2006 at 11:33 AM

    Harpreet,

    Its not possible to open multiple lists.

    END-OF-SELECTION, will fire only when you actually write it after the selection of the data is over. Usually between the START and END OF SELECTION you fetch the data and after the END OF SELECTION, you process the data and write that as output as display the same as ALV.

    Regards,

    Ravi

    Note : Please mark the helpful answers

    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.