Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV problem

former_member494495
Active Contributor
0 Likes
1,215

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

1 ACCEPTED SOLUTION
Read only

syed_ibrahim5
Active Participant
0 Likes
1,177

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

11 REPLIES 11
Read only

Former Member
0 Likes
1,177

Build a dynpro with 2 alv object oriented in it.

Regards

Andrea

Read only

Former Member
0 Likes
1,177

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.

Read only

Former Member
0 Likes
1,177

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

Read only

0 Likes
1,177

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

Read only

0 Likes
1,177

Call your funtion module for alv display after the end of the loop.

Regards

Andrea

Read only

syed_ibrahim5
Active Participant
0 Likes
1,178

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

Read only

0 Likes
1,177

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

Read only

0 Likes
1,177

Hi syed,

I tried Your logic.. But it showing error msg.. but it not showing the error msg.. MAXIMUM_OF_APPENDS_REACHED...

Regards,

Dhina....

Read only

0 Likes
1,177

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

Read only

0 Likes
1,177

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

Read only

0 Likes
1,177

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