‎2011 Jan 24 11:37 AM
HI Experts,
I tried to develop one ALV report that contains two blocks, one is PO (Purchase Order) and another is SO ( Sales order )
Selection criteria is based on multiple material..
I/P : Material No is select-options.
O/P : 1st block is PO details for particular material.
2nd Block is SO details for particular Material.
Logic:
With in the Loop i call Block ALV function module...
Loop Material Itab.
IF sy-tabix NE 1.
layout-list_append = 'X'.
ENDIF.
Loop PO ITAB Based on Materil.
Append Final PO Itab.
endloop.
Loop SO ITAB Bassed on Materil.
Append Final SO Itab.
endloop.
Here i call "Block ALV " Function module....
Endloop.
Problem
The Output is not displaying in One Page..
It display 1st material It contains PO and SO Blocks..
when i pressing back Button or cancel button only it shows the second material with its PO and SO
To see all the materials every time we need to press the Back or Cancel button
How to see all the materials in the same page ?
Regards,
Dhina.
Edited by: M.Alagesan on Jan 24, 2011 1:11 PM
Moderator message: please use more descriptive subject lines for your posts.
Edited by: Thomas Zloch on Jan 24, 2011 1:45 PM
‎2011 Jan 25 9:16 AM
hi,
as andrea said use only 'REUSE_ALV_BLOCK_LIST_APPEND inside the loop.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
I_CALLBACK_PROGRAM = G_PROGRAM.
loop at itab.
perform block_append.
endloop.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
IS_PRINT = GT_PRINT.
with regards,
syed
‎2011 Jan 24 3:06 PM
Build a dynpro with 2 alv object oriented in it.
Regards
Andrea
‎2011 Jan 24 5:30 PM
Did you try OO ALV?
Create 2 custom containers for a screen and display the internal tables in each custom container using method set_table_for_first_display.
‎2011 Jan 24 5:48 PM
Hi,
Block ALV should work. Did you try the below FM's?
REUSE_ALV_BLOCK_LIST_INIT
REUSE_ALV_BLOCK_LIST_APPEND
REUSE_ALV_BLOCK_LIST_APPEND
REUSE_ALV_BLOCK_LIST_DISPLAY
Regards,
Senthil
‎2011 Jan 25 8:34 AM
HI senthil,
I used the same FM only. but all the material is not appearing in a single page.
On clicking the back or cancel button one by one material is displaying in Separate page.
I am replicating MB5B tcode with some changes
Input: Plant and Company code and Execute
The output showing all the material & its documents in a single page.
In my case the output is not coming in single page
Regards,
Dhina
Edited by: M.Alagesan on Jan 25, 2011 9:34 AM
‎2011 Jan 25 8:38 AM
Call your funtion module for alv display after the end of the loop.
Regards
Andrea
‎2011 Jan 25 9:16 AM
hi,
as andrea said use only 'REUSE_ALV_BLOCK_LIST_APPEND inside the loop.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
I_CALLBACK_PROGRAM = G_PROGRAM.
loop at itab.
perform block_append.
endloop.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
IS_PRINT = GT_PRINT.
with regards,
syed
‎2011 Jan 25 10:27 AM
Hi,
I used Program like this..
loop at material itab.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
I_CALLBACK_PROGRAM = G_PROGRAM.
perform block_append.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
IS_PRINT = GT_PRINT.
endloop.
because I want to display materialwise PO and SO details.. Ex MB5B transaction Code..
‎2011 Jan 25 10:52 AM
Hi syed,
I tried Your logic.. But it showing error msg.. but it not showing the error msg.. MAXIMUM_OF_APPENDS_REACHED...
Regards,
Dhina....
‎2011 Jan 25 10:54 AM
hi,
you cannot use the init and the display function module inside the loop.
if you know the number of blocks you are going to display put them in separate internal tables and then use block_append function modules that many times (if it is not dynamic),then use the display function module.
regards,
syed
‎2011 Jan 25 11:26 AM
thanks Syed,
I checked there was no init and display function module loop.
What is separate internal table means? If it is dynamic what should i do?
Can you please explain the following in detail ?
if you know the number of blocks you are going to display put them in separate internal tables and then use block_append function modules that many times (if it is not dynamic),then use the display function module.
Regards,
Dhina
‎2011 Jan 25 11:48 AM
hi,
i think you are trying to display block for every material. that could be troicky since you can display only 19 blocks (not sure).
if you do not know the Number of blocks you are going to display, then use field symbols.
regards,
syed