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

HEADER AND ITEM REPORT IN SAME SCREEN

hi

i have requirement that i retrived data from header table vbak i half part of screen

and when user click on any header line item than in the lower half of same screen item data display of that particular header...i think this can be done through container and classes but i am new to containers and abap classes ...plz explain how can i do that

Regards,

Taran

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 05:59 AM

    also if any one has documents on this than mail me

    taran.bhatia@gmail.com

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 06:10 AM

    Hi,

    The simplest way to acheive your objective is to use screen programming.

    Use a Call Screen to make a screen on which you can have the header fields as an ALV grid in one container on the top half of the screen.

    Once any line is clicked, get that line number, read its details and show the item lines selected in an ALV grid in the second container on the bottom half of the screen.

    For reference you can see the system defined programs BCALV_GRID_* and BCALV_EDIT_* programs to learn Object Oriented ALV(alv using class).

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 11, 2007 at 06:15 AM

    hi

    u can display header data and corresponding item data by using tab strips in module pool programing

    whenever u choose tab1 call sub screen

    so that u can display u r desired data

    reward if u find use ful

    Regards Nagesh.Paruchuri

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 06:23 AM

    Hi,

    We can do it using ALV Block report, in the same screen we can display 2 block wise. here i am sending sample code test in ur system.

    &----


    *& Report ZBLOCK *

    *& *

    &----


    *& *

    *& *

    &----


    REPORT ZBLOCK .

    type-pools : slis.

    TABLES : VBAK , VBAP.

    DATA : BEGIN OF itab OCCURS 0,

    VBELN LIKE VBAK-VBELN,

    ERDAT LIKE VBAK-ERDAT,

    END OF itab.

    DATA : BEGIN OF ptab OCCURS 0,

    POSNR LIKE VBAP-POSNR,

    MATNR LIKE VBAP-MATNR,

    END OF ptab.

    data : alvfc type slis_t_fieldcat_alv ."WITH HEADER LINE.

    data : alvly type slis_layout_alv.

    data : alvev type slis_t_event .

    DATA : W_ALVFC LIKE LINE OF ALVFC.

    data : alvfc1 type slis_t_fieldcat_alv ."WITH HEADER LINE.

    data : alvly1 type slis_layout_alv.

    data : alvev1 type slis_t_event .

    DATA : W_ALVFC1 LIKE LINE OF ALVFC1.

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

    *for sorting

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

    data : LT_SORT TYPE SLIS_T_SORTINFO_ALV,

    LS_SORT TYPE SLIS_SORTINFO_ALV.

    perform get_data.

    *perform print_data.

    *----


    *PARAMETERS : a TYPE c.

    *----


    *----


    SELECT DATA

    start-of-selection.

    *SELECT VBELN ERDAT FROM VBAK into table itab up to 20 rows.

    *select POSNR MATNR FROM VBAP into table ptab up to 20 rows.

    *

    *ALVFC-COL_POS = '1'.

    W_ALVFC-FIELDNAME = 'VBELN'.

    W_ALVFC-TABNAME = 'ITAB'.

    W_ALVFC-SELTEXT_M = 'SO_NO'.

    APPEND W_ALVFC TO ALVFC.

    *REFRESH ALVFC.

    *ALVFC-COL_POS = '2'.

    W_ALVFC-FIELDNAME = 'ERDAT'.

    W_ALVFC-TABNAME = 'ITAB'.

    W_ALVFC-SELTEXT_M = 'SO_DATE'.

    APPEND W_ALVFC TO ALVFC.

    *REFRESH ALVFC.

    *ALVFC-COL_POS = '3'.

    W_ALVFC1-FIELDNAME = 'POSNR'.

    W_ALVFC1-TABNAME = 'PTAB'.

    W_ALVFC1-SELTEXT_M = 'POSNR'.

    APPEND W_ALVFC1 TO ALVFC1.

    *REFRESH ALVFC1.

    *ALVFC-COL_POS = '4'.

    W_ALVFC1-FIELDNAME = 'MATNR'.

    W_ALVFC1-TABNAME = 'PTAB'.

    W_ALVFC1-SELTEXT_M = 'MAT_NO'.

    APPEND W_ALVFC1 TO ALVFC1.

    *REFRESH ALVFC1.

    *----


    INIT BLOCK ALV

    *form print_data.

    LS_SORT-FIELDNAME = 'POSNR'.

    LS_SORT-UP = 'X'.

    ls_sort-group = ''."using this you get new pages

    APPEND LS_SORT TO LT_SORT.

    DATA : REPORT LIKE SY-REPID.

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'

    EXPORTING

    i_callback_program = REPORT.

    *----


    ADD INTERNAL TABLE ITAB

    *CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

    *EXPORTING

    **I_PROGRAM_NAME = REPORT

    *I_INTERNAL_TABNAME = 'ITAB'

    **I_INCLNAME = REPORT

    *CHANGING

    *CT_FIELDCAT = X_ALVFC.

    *

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

    EXPORTING

    is_layout = alvly

    it_fieldcat = ALVFC

    i_tabname = 'ITAB'

    it_events = alvev

    TABLES

    t_outtab = ITAB

    EXCEPTIONS

    program_error = 1

    maximum_of_appends_reached = 2

    OTHERS = 3.

    *----


    ADD INTERNAL TABLE PTAB

    REFRESH ALVFC[].

    *CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

    *EXPORTING

    **I_PROGRAM_NAME = report

    *I_INTERNAL_TABNAME = 'PTAB'

    **I_INCLNAME = report

    *CHANGING

    *CT_FIELDCAT = X_ALVFC.

    *

    *CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

    *EXPORTING

    *is_layout = alvly1

    *it_fieldcat = alvfc1

    *i_tabname = 'PTAB'

    *it_events = alvev1

    *TABLES

    *t_outtab = PTAB

    *EXCEPTIONS

    *program_error = 1

    *maximum_of_appends_reached = 2

    *OTHERS = 3.

    **********

    *test

    ********

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

    EXPORTING

    is_layout = alvly1

    it_fieldcat = alvfc1

    i_tabname = 'PTAB'

    it_events = alvev1

    IT_SORT = lt_sort

    • I_TEXT = ' '

    tables

    t_outtab = PTAB.

    • EXCEPTIONS

    • PROGRAM_ERROR = 1

    • MAXIMUM_OF_APPENDS_REACHED = 2

    • OTHERS = 3

    IF sy-subrc <> 0.

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

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

    ENDIF.

    *----


    DISPLAY

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'

    • EXPORTING

    • I_INTERFACE_CHECK = ' '

    • IS_PRINT =

    • I_SCREEN_START_COLUMN = 0

    • I_SCREEN_START_LINE = 0

    • I_SCREEN_END_COLUMN = 0

    • I_SCREEN_END_LINE = 0

    • IMPORTING

    • E_EXIT_CAUSED_BY_CALLER =

    • ES_EXIT_CAUSED_BY_USER =

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

    form get_data.

    SELECT VBELN ERDAT FROM VBAK INTO TABLE ITAB UP TO 20 ROWS .

    SELECT POSNR MATNR FROM VBAP INTO TABLE PTAB UP TO 20 ROWS.

    endform.

    <b>reward me if it is use full answer</b>

    praveen

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2008 at 01:56 PM

    done by own

    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.