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

Two dif ALV in one screen.

Dear Guru's,

I have requirement where I need to show an Output in the format as in program "HINCLSTR" (Payroll Results) i think its an ALV. I have two queries:

1) How to have 2 ALV's in same screen.

2) depending on the entry I click on the left hand side ALV. I need certain details to be populated on the Right hand side ALv.

3) the p/o fields of the right hand side ALV is dynamic. Can increase or decrease to any number.

How do I do that???

Please help me out here..

Thanks in Advance,

Vijaya Sankar.VJ

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    Posted on Dec 20, 2008 at 07:08 PM

    Hello Vijay

    You may want to have a look at sample report ZUS_SDN_THREE_ALV_GRIDS in thread

    Regards

    Uwe

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 20, 2008 at 11:28 AM

    hi,

    you can use custom container of oops concept to

    achieve your requirement.

    Search in SCN with 2 screens in 1 alv you will get lot of posts.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 20, 2008 at 11:54 AM

    Hi frd,

    try using ALV BLOCK List in that u can have More than one ALV..

    try this one..

    REPORT ZSBN_BLOCK_ALV .

    TYPE-POOLS : SLIS.

    TABLES: PA0001, PA0002.

    DATA : FCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,

    FCAT1 TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,

    ILAYOUT TYPE SLIS_LAYOUT_ALV,

    XS_EVENT TYPE SLIS_ALV_EVENT,

    GT_XEVENTS TYPE SLIS_T_EVENT,

    GT_YEVENTS TYPE SLIS_T_EVENT,

    IT_SORT TYPE SLIS_T_SORTINFO_ALV,

    WA_SORT TYPE SLIS_SORTINFO_ALV.

    DATA : BEGIN OF INT_PA0001 OCCURS 0.

    INCLUDE TYPE PA0001.

    DATA : END OF INT_PA0001.

    DATA : BEGIN OF INT_PA0002 OCCURS 0.

    INCLUDE TYPE PA0002.

    DATA : END OF INT_PA0002.

    && DATA FROM PA0001

    SELECT * FROM PA0001

    UP TO 5 ROWS

    INTO TABLE INT_PA0001.

    && DATA FROM PA0002

    IF NOT INT_PA0001[] IS INITIAL.

    SELECT * FROM PA0002 INTO TABLE INT_PA0002

    FOR ALL ENTRIES IN INT_PA0001

    WHERE

    PERNR EQ INT_PA0001-PERNR.

    ENDIF.

    && LAYOUT DEF

    ILAYOUT-COLWIDTH_OPTIMIZE = 'X'.

    ILAYOUT-ZEBRA = 'X'.

    && FCAT1

    CLEAR FCAT.

    FCAT-FIELDNAME = 'PERNR'.

    FCAT-SELTEXT_M = 'Emp No'.

    FCAT-TABNAME = 'INT_PA0001'.

    APPEND FCAT.

    CLEAR FCAT.

    FCAT-FIELDNAME = 'BEGDA'.

    FCAT-SELTEXT_M = 'St Date'.

    FCAT-TABNAME = 'INT_PA0001'.

    APPEND FCAT.

    CLEAR FCAT.

    FCAT-FIELDNAME = 'ENDDA'.

    FCAT-SELTEXT_M = 'End Date'.

    FCAT-TABNAME = 'INT_PA0001'.

    APPEND FCAT.

    CLEAR FCAT.

    FCAT-FIELDNAME = 'BUKRS'.

    FCAT-SELTEXT_M = 'Comp Code'.

    FCAT-TABNAME = 'INT_PA0001'.

    APPEND FCAT.

    CLEAR FCAT.

    FCAT-FIELDNAME = 'WERKS'.

    FCAT-SELTEXT_M = 'Plant'.

    FCAT-TABNAME = 'INT_PA0001'.

    APPEND FCAT.

    && FCAT2

    CLEAR FCAT1.

    FCAT1-FIELDNAME = 'PERNR'.

    FCAT1-SELTEXT_M = 'Emp No'.

    FCAT-TABNAME = 'INT_PA0002'.

    APPEND FCAT1.

    CLEAR FCAT1.

    FCAT1-FIELDNAME = 'NACHN'.

    FCAT1-SELTEXT_M = 'Emp Name'.

    FCAT-TABNAME = 'INT_PA0002'.

    APPEND FCAT1.

    CLEAR FCAT1.

    FCAT1-FIELDNAME = 'INITS'.

    FCAT1-SELTEXT_M = 'Initial'.

    FCAT-TABNAME = 'INT_PA0002'.

    APPEND FCAT1.

    && FOR EVENTS

    CLEAR XS_EVENT.

    XS_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.

    XS_EVENT-FORM = 'XTOP_OF_PAGE'.

    APPEND XS_EVENT TO GT_XEVENTS.

    CLEAR XS_EVENT.

    CLEAR XS_EVENT.

    XS_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.

    XS_EVENT-FORM = 'YTOP_OF_PAGE'.

    APPEND XS_EVENT TO GT_YEVENTS.

    CLEAR XS_EVENT.

    && FOR SORT

    CLEAR WA_SORT.

    WA_SORT-FIELDNAME = 'PERNR'.

    APPEND WA_SORT TO IT_SORT.

    CLEAR WA_SORT.

    && BLOCK ALV -- INTIALIZATION

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'

    EXPORTING

    I_CALLBACK_PROGRAM = SY-CPROG.

    && APPENDING FIRST FCAT

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

    EXPORTING

    IS_LAYOUT = ILAYOUT

    IT_FIELDCAT = FCAT[]

    I_TABNAME = 'INT_PA0001'

    IT_EVENTS = GT_XEVENTS

    IT_SORT = IT_SORT

    TABLES

    T_OUTTAB = INT_PA0001.

    && APPENDING SECOND FCAT

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

    EXPORTING

    IS_LAYOUT = ILAYOUT

    IT_FIELDCAT = FCAT1[]

    I_TABNAME = 'INT_PA0002'

    IT_EVENTS = GT_YEVENTS

    IT_SORT = IT_SORT

    TABLES

    T_OUTTAB = INT_PA0002.

    && FUN MOD FOR DISPLAY

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.

    && FOR TOP OF PAGE ALV-1

    FORM XTOP_OF_PAGE.

    WRITE : 'ALV 1', 30 SY-DATUM.

    ENDFORM.

    && FOR TOP OF PAGE ALV-2

    FORM YTOP_OF_PAGE.

    WRITE : 'ALV 2', 30 SY-DATUM.

    ENDFORM.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 04:45 AM

    Hello,

    By using Classical Alv methodology, 2 different ALV's cannot be displayed on one screen,

    You Have to create your Alv through OOPS.

    Use Class: CL_GUI_SPLITTER_CONTAINER to split your container into 2 or more cells then on that

    each cell, You can output your ALV's on the same screen.

    Hope It helps You,

    Thanks Mansi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 05:23 AM

    Hi Vijay,

    Write out all the logic in the PBO of the screen for the buttons.

    This might work.

    thanks

    Nitin Sachdeva

    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.