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

how can i use two list screens in Classical report.

Dear Sir,

In My Report in First screen i am taking the GR details and Display In it_final By Check Box Wise.

Based On The Check Box selection in First screen In Second Screen i want The Challan Details Based On Some In Puts In First Field.

so how can I call The second Screen In Classial report Plz Help Me.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 12:20 PM

    check this report

    REPORT ZNNR_ALVOOPS_SCREEN.

    tables: mara,spfli.

    types: begin of ty_tab,

    matnr type mara-matnr,

    ernam type mara-ernam,

    ersda type mara-ersda,

    end of ty_tab.

    DATA ITAB1 TYPE TABLE OF SPFLI.

    DATA WA1 LIKE LINE OF ITAB1.

    DATA IO1 TYPE SPFLI-CARRID VALUE 'AA'.

    data itab type table of ty_tab.

    data wa like line of itab.

    DATA OK_CODE TYPE SY-UCOMM.

    DATA: GRID TYPE REF TO CL_GUI_ALV_GRID,

    CONT TYPE REF TO CL_GUI_CUSTOM_CONTAINER.

    DATA: GRID1 TYPE REF TO CL_GUI_ALV_GRID,

    CONTA TYPE REF TO CL_GUI_CUSTOM_CONTAINER.

    CREATE OBJECT CONT EXPORTING CONTAINER_NAME = 'CONT1' .

    CREATE OBJECT GRID EXPORTING I_PARENT = CONT .

    CREATE OBJECT CONTA EXPORTING CONTAINER_NAME = 'CONT2' .

    CREATE OBJECT GRID1 EXPORTING I_PARENT = CONTA .

    selection-screen begin of block b1 with frame title text-100.

    select-options: s_matnr for mara-matnr.

    selection-screen end of block b1.

    select matnr ernam ersda from mara into corresponding fields of table itab up to 15 rows

    where matnr in s_matnr .

    call selection-screen 100.

    &----


    *& Module USER_COMMAND_0100 INPUT

    &----


    • text

    ----


    MODULE USER_COMMAND_0100 INPUT.

    if ok_code = 'PB1'.

    leave to screen 0.

    else.

    leave to screen 100.

    endif.

    ENDMODULE. " USER_COMMAND_0100 INPUT

    &----


    *& Module STATUS_0100 OUTPUT

    &----


    • text

    ----


    MODULE STATUS_0100 OUTPUT.

    • SET PF-STATUS 'xxxxxxxx'.

    • SET TITLEBAR 'xxx'.

    SELECT * FROM SPFLI INTO

    CORRESPONDING FIELDS OF TABLE ITAB1 WHERE CARRID = IO1.

    CALL METHOD grid->SET_TABLE_FOR_FIRST_DISPLAY

    EXPORTING

    • I_BUFFER_ACTIVE =

    • I_BYPASSING_BUFFER =

    • I_CONSISTENCY_CHECK =

    I_STRUCTURE_NAME = 'MARA'

    • IS_VARIANT =

    • I_SAVE =

    • I_DEFAULT = 'X'

    • IS_LAYOUT =

    • IS_PRINT =

    • IT_SPECIAL_GROUPS =

    • IT_TOOLBAR_EXCLUDING =

    • IT_HYPERLINK =

    • IT_ALV_GRAPHICS =

    • IT_EXCEPT_QINFO =

    • IR_SALV_ADAPTER =

    CHANGING

    IT_OUTTAB = itab.

    • IT_FIELDCATALOG =

    • IT_SORT =

    • IT_FILTER =

    • EXCEPTIONS

    • INVALID_PARAMETER_COMBINATION = 1

    • PROGRAM_ERROR = 2

    • TOO_MANY_LINES = 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.

    CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY

    EXPORTING

    I_STRUCTURE_NAME = 'SPFLI'

    CHANGING

    IT_OUTTAB = ITAB1.

    ENDMODULE. " STATUS_0100 OUTPUT

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 04, 2007 at 09:12 PM

    If you need to create another screen in Classical Reporting, the issue is simply solved:

    1. Define your own GUI-Status and set it before the list display

    SET PF-STATUS 'MAIN001'

    2. In the new status, add a new function 'MYFN'.

    <b>Note that the new function will set sy-ucomm with it's name</b>

    3. In the main program, at event

    AT USER-COMMAND

    write your code, for example:

    save_ok = sy-ucomm.
    CLEAR sy-ucomm.
    CASE save_ok.
      WHEN 'MYFN'.
         PERFORM show_second_list USING my_parm1 my_parm2.
      WHEN OTHERS.
    ENDCASE.
    

    You can output a new list normally, simply using

    WRITE

    or any FM you want.

    Hope this helps.

    R.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      AT USER-COMMAND.

      CASE SY-UCOMM.

      WHEN 'GETCHLNO'.

      • SET PF-STATUS 'St' EXCLUDING 'GETCHLNO'.

      SET PF-STATUS 'ST'.

      *Reading Values from List screen

      CLEAR IT_FINAL.

      DO.

      READ LINE sy-index FIELD VALUE IT_FINAL-CH

      IT_FINAL-BELNR

      IT_FINAL-GJAHR

      IT_FINAL-MATNR

      IT_FINAL-LIFNR

      IT_FINAL-WERKS

      IT_FINAL-BUDAT.

      IF sy-subrc <> 0.

      EXIT.

      ENDIF.

      SIR I AM WRITING THIS IN MY COADING BUT IT NOT WORING PLZ RECTIFY WHERE I WILL DO THE MISSTAKE.

      IF ( IT_FINAL-CH = 'X' ).<<<< GR DETAILS COMMING IN IT_FINAL TABLE FOR FIRST SCREEN.

      IF IT_FINAL-BELNR NE space.

      PERFORM CHLN_LIST_DISPLAY. <<<<CHALAN DETAILS DISPLAY IN SECOND LIST SCREEN

      ENDIF.

      CLEAR : IT_FINAL-BELNR.

      ENDIF.

      ENDDO.

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.