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

interactive reports

1)How to move from any list to any list ?

2)when v r calling a transaction from report in interactive report, will it be counted as a secondary list?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Posted on Nov 30, 2007 at 10:46 AM

    Hi,

    1)set the value of SY-LSIND manually to change from one list to another.

    2)Its not considered as a secondary list.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2007 at 10:48 AM

    Hi

    1.

    AT LINE-SELECTION.

    AT USER-COMMAND.

    By using these events you can move form one list to another.

    for example..

    CASE SY-LSIND.

    WHEN '1'. "list number

    "do something

    WHEN '2'.

    " do something

    ENDCASE.

    2. NO ..it'll not be counted as secondarylist

    Message was edited by:

    Perez C

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2007 at 10:53 AM

    Hi

    1.

    AT LINE-SELECTION. : event to trigger by double click

    AT USER-COMMAND. event to trigger by function code

    these are the commands to trigger secondary lists

    if u r already in the secondary list then use sy-lsind to move to the list of u r wish

    By using these events you can move form one list to another.

    2. No it will not be treated as seondary list at all.

    PlZZZZZZZZZZZZZZZZZZ REWARD IF USEFULL.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2007 at 10:56 AM

    Hi thank u , but my 1st question is: if i am in 15 th list i want to move to any list whether it can be 16 or 1 or 9 any thing?

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2007 at 10:58 AM

    Hi,

    You can move backward to any list.if you want to move forward you should go one by one.You set list index number in sy-lsind.

    L.Velu

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 30, 2007 at 10:58 AM

    Hi,

    IF SY-LSIND = 15.

    sy-lsind = 4.

    ENDIF.

    This brings the control from 14th list directly to 4th list.

    Try using like this.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 02, 2007 at 07:22 AM

    hI

    BY USEING SY-LSIND WE CAN MOVE FROM ONE LIST TO ANOTHER LIST LIKE THSI

    case sy-lsind.

    when 1.

    ...

    when 2.

    ....

    when 3.

    ......

    when 4.

    ...

    when 5.

    sy-lsind = 3.

    when others.

    ....

    endcase.

    YES WHEN WE ARE CALLING A TRANSACTION AS THE LIST IT WILL ACT LIKE AS A SECONDARY LIST

    EXAMPE

    &----


    *& Report ZTEST_ALV_LOGO

    *&

    &----


    *&

    *&

    &----


    REPORT ztest_alv_logo.

    TYPE-POOLS : slis.

    *ALV Formatting tables /structures

    DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.

    DATA: gt_events TYPE slis_t_event.

    DATA: gs_layout TYPE slis_layout_alv.

    DATA: gt_page TYPE slis_t_listheader.

    DATA: gs_page TYPE slis_listheader.

    DATA: v_repid LIKE sy-repid.

    *ALV Formatting work area

    DATA: w_fieldcat TYPE slis_fieldcat_alv.

    DATA: w_events TYPE slis_alv_event.

    DATA: gt_bsid TYPE TABLE OF bsid WITH HEADER LINE.

    INITIALIZATION.

    PERFORM build_events.

    PERFORM build_page_header.

    START-OF-SELECTION.

    *perform build_comment. "top_of_page - in initialization at present

    SELECT * FROM bsid INTO TABLE gt_bsid UP TO 10 ROWS.

    *perform populate_for_fm using '1' '3' 'BUKRS' '8' 'GT_BSID' 'Whee'.

    *USING = Row, Column, Field name, display length, table name, heading

    *OR

    PERFORM build_fieldcat.

    gs_layout-zebra = 'X'.

    *top of page event does not work without I_callback_program

    v_repid = sy-repid.

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    i_callback_program = v_repid

    i_structure_name = 'BSID'

    • i_background_id = 'ALV_BACKGROUND'

    i_grid_title = 'This is the grid title'

    • I_GRID_SETTINGS =

    is_layout = gs_layout

    it_fieldcat = gt_fieldcat[]

    it_events = gt_events[]

    TABLES

    t_outtab = gt_bsid.

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

    • Form..............: populate_for_fm

    • Description.......: Populates fields for function module used in ALV

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

    FORM populate_for_fm USING p_row

    p_col

    p_fieldname

    p_len

    p_table

    p_desc.

    w_fieldcat-row_pos = p_row. "Row Position

    w_fieldcat-col_pos = p_col. "Column Position

    w_fieldcat-fieldname = p_fieldname. "Field name

    w_fieldcat-outputlen = p_len. "Column Lenth

    w_fieldcat-tabname = p_table. "Table name

    w_fieldcat-reptext_ddic = p_desc. "Field Description

    w_fieldcat-input = '1'.

    APPEND w_fieldcat TO gt_fieldcat.

    CLEAR w_fieldcat.

    ENDFORM. " populate_for_fm

    &----


    *& Form build_events

    &----


    FORM build_events.

    DATA: ls_event TYPE slis_alv_event.

    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

    EXPORTING

    i_list_type = 0

    IMPORTING

    et_events = gt_events.

    READ TABLE gt_events

    WITH KEY name = slis_ev_user_command

    INTO ls_event.

    IF sy-subrc = 0.

    MOVE slis_ev_user_command TO ls_event-form.

    APPEND ls_event TO gt_events.

    ENDIF.

    READ TABLE gt_events

    WITH KEY name = slis_ev_top_of_page

    INTO ls_event.

    IF sy-subrc = 0.

    MOVE slis_ev_top_of_page TO ls_event-form.

    APPEND ls_event TO gt_events.

    ENDIF.

    ENDFORM. " build_events

    &----


    *& Form USER_COMMAND

    &----


    • When user command is called it uses 2 parameters. The itab

    • passed to the ALV is in whatever order it currently is on screen.

    • Therefore, you can read table itab index rs_selfield-tabindex to get

    • all data from the table. You can also check r_ucomm and code

    • accordingly.

    &----


    FORM user_command USING r_ucomm LIKE sy-ucomm

    rs_selfield TYPE slis_selfield.

    READ TABLE gt_bsid INDEX rs_selfield-tabindex.

    • error checking etc.

    SET PARAMETER ID 'KUN' FIELD gt_bsid-kunnr.

    CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.

    ENDFORM. "user_command

    &----


    *& Form top_of_page

    &----


    • Your own company logo can go here if it has been saved (OAOR)

    • If the logo is larger than the size of the headings in gt_page,

    • the window will not show full logo and will have a scroll bar. Thus,

    • it is a good idea to have a standard ALV header if you are going to

    • use logos in your top of page.

    &----


    FORM top_of_page.

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

    EXPORTING

    it_list_commentary = gt_page

    i_logo = 'ENJOYSAP_LOGO'.

    ENDFORM. "top_of_page

    &----


    *& Form build_fieldcat

    &----


    *Many and varied fields are available here. Have a look at documentation

    *for FM REUSE_ALV_LIST_DISPLAY and REUSE_ALV_FIELDCATALOG_MERGE

    ----


    FORM build_fieldcat.

    w_fieldcat-fieldname = 'BUDAT'.

    w_fieldcat-seltext_m = 'Dte pst'.

    w_fieldcat-ddictxt(1) = 'M'.

    w_fieldcat-edit = 'x'.

    • Can change the position of fields if you do not want them in order

    • of the DDIC or itab

    • w_fieldcat-row_pos = '1'.

    • w_fieldcat-col_pos = '10'.

    APPEND w_fieldcat TO gt_fieldcat.

    CLEAR w_fieldcat.

    ENDFORM. " build_fieldcat

    &----


    *& Form build_page_header

    &----


    • gt_page is used in top of page (ALV subroutine - NOT event)

    • *H = Header, S = Selection, A = Action

    ----


    FORM build_page_header.

    • For Headers, Key is not printed and is irrelevant. Will not cause

    • a syntax error, but is not used.

    gs_page-typ = 'H'.

    gs_page-info = 'Header 1'.

    APPEND gs_page TO gt_page.

    gs_page-typ = 'H'.

    gs_page-info = 'Header 2'.

    APPEND gs_page TO gt_page.

    • For Selections, the Key is printed (bold). It can be anything up to 20

    • bytes. It gets printed in order of code here, not by key value.

    gs_page-typ = 'S'.

    gs_page-key = 'And the winner is:'.

    gs_page-info = 'Selection 1'.

    APPEND gs_page TO gt_page.

    gs_page-typ = 'S'.

    gs_page-key = 'Runner up:'.

    gs_page-info = 'Selection 2'.

    APPEND gs_page TO gt_page.

    • For Action, Key is also irrelevant.

    gs_page-typ = 'A'.

    gs_page-info = 'Action goes here'.

    APPEND gs_page TO gt_page.

    ENDFORM. " build_page_header

    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.