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 Grid with table type structure

Former Member
0 Likes
5,340

I created a structure with a table type in it. I want to display an ALV Grid report with that structure. Is it even possible. If yes, can someone please provide some reference. Thanks.

Edited by: Sreekanth Nadella on Sep 4, 2010 2:29 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,113

yes you can display ALV with your table. Do you know anything about how to use ALV reuse library? You can refer package SLIS by SE80. You can find a lot of example about how to use ALV.

regards,

yes you can display ALV with your table. Do you know anything about how to use ALV reuse library? You can refer package SLIS by SE80. You can find a lot of example about how to use ALV.

regards,

12 REPLIES 12
Read only

Former Member
0 Likes
3,114

yes you can display ALV with your table. Do you know anything about how to use ALV reuse library? You can refer package SLIS by SE80. You can find a lot of example about how to use ALV.

regards,

Read only

0 Likes
3,113

Hi Thien,

I have used ALV in many reports and also have used many features of ALV. This specific layout with a table type in it is what I am not able to find. If you can point me to a specific program in the SLIS package, it would be helpful.

Thanks,

Sreekanth.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
3,113

Hello Sreekanth,

If you read the documentation of the REUSE* function modules, it states:

The function module outputs an internal table with whatever structure in the form of a formatted single- oder multi-line list.

So displaying the output is possible. Have you given a try before posting the question ?

BR,

Suhas

Read only

0 Likes
3,113

Hi Suhas,

Yes I did try. It is not showing any of the fields in the table type in the output. It shows all the fields in the structure but excludes the table type in the output.

Thanks,

Sreekanth.

Read only

0 Likes
3,113

Hello

A structure containing a field representing a table type is a DEEP structure. However, ALV grids can only display flat structures. Thus, you will never see such a field in your ALV.

Regards

Uwe

Read only

Former Member
0 Likes
3,113

Hi Thien,

I have used ALV in many reports and also have used many features of ALV. This specific layout with a table type in it is what I am not able to find. If you can point me to a specific program in the SLIS package, it would be helpful.

Thanks,

Sreekanth.

Read only

Clemenss
Active Contributor
0 Likes
3,113

Hi sreekanth,

forget about fieldcat, assuming your data are in gt_outtab (regardless what structure or type) just use

data: 
  gr_table type ref to cl_salv_table.

*... Create Instance
   call method cl_salv_table=>factory
      IMPORTING 
         R_SALV_TABLE = gr_table
      changing
         t_table = gt_outtab.
*... Display Table
   gr_table->display( ).

If your question means you have a table with a field that is an internal table itself, what do you think the ALV should look like? If you have clear imagination, let me know. Try to find a solution. Possibly you can define a dropdown event to show the values...

Regards,

Clemens

Read only

Former Member
0 Likes
3,113

Hi Clemens,

It is not displaying the fields in the table type. Probably it is not possible to display deep structures in ALV reports as replied above.

Thanks.

Read only

Clemenss
Active Contributor
0 Likes
3,113

Hi,

again,

what do you think the ALV should look like?

Regards,

Clemens

Read only

Former Member
0 Likes
3,113

Hi Clemens,

The output should like a normal ALV Grid report. Just like a deep structure, one of the cell will have multiple row/value just like table. So you are looking at something like this.

A B C 1 2 3 D E

4 5 6

7 8 9

F G H 1 2 3 I J

4 5 6

7 8 9

Thanks.

Read only

Former Member
0 Likes
3,113

the output is not formatted on screen as I thought. Please put the numbers below each other.

Read only

Clemenss
Active Contributor
0 Likes
3,113

Hi Sreekanth,

just format code-like

A B C 1 2 3 D E
      4 5 6
      7 8 9
F G H 1 2 3 I J
      4 5 6
      7 8 9

to get this result visible.

SAP standard does not provide such a functionality, it can display only flat structures. One reason for this is that if you have a deep structure with a field which is an internal table itself, this may be structured with more than one field. This would change the column structure. And, possibly, you could have inside the internal-table-column again more internal tables, ...

But with no big effort you can create a flat table with some more records for the additional data.

Regards,

Clemens