Application Development 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: 

Displaying internal table as a field in ALV

Former Member
0 Kudos

Hello,

I defined an internal table as a field of another internal table which is to be dispalyed with fm REUSE_ALV_GRID_DISPLAY. Nothing for this field is displayed. There is nothing for this field even in the fieldcataloque. How can I do it?

The declarations for internal tables are as follows:

DATA: BEGIN OF str OCCURS 0,

text(20),

END OF str.

    • internal table definition

DATA: BEGIN OF itab OCCURS 0,

  • pernr LIKE pernr-pernr,

  • ename LIKE p0001-ename,

name LIKE hap_s_body_elements-name,

trfs1 LIKE hrp1005-trfs1,

stell LIKE p0001-stell, "job

jf LIKE hrp1000-stext, "job family

group LIKE hrp1000-stext,

direct LIKE hrp1000-stext,

dept LIKE hrp1000-stext,

div LIKE hrp1000-stext,

funct LIKE hrp1000-stext,

<b> line type str occurs 0,</b>

value0 TYPE p DECIMALS 2, "

value1 TYPE p DECIMALS 2, "

value2 TYPE p DECIMALS 2, "

value3 TYPE p DECIMALS 2, "

value4 TYPE p DECIMALS 2, "

value5 TYPE p DECIMALS 2, "

total TYPE p DECIMALS 2,

END OF itab.

**

Thx in advance,

Ali

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Ali,

I'm afraid that these function modules for ALV do not have the functionality to display the contents of an internal table as a field of a record into another internal table. Instead, you could do several approaches:

1. Show an icon for this field, so that the user presses it, and then you could show a detail list for the contents of this itab for that particular record, or

2. Manually create records in the 'external' itab, replicating the contents of the another fields in every record.

I hope this helps. Best regards,

Alvaro

5 REPLIES 5

Former Member
0 Kudos

Hi Ali,

I'm afraid that these function modules for ALV do not have the functionality to display the contents of an internal table as a field of a record into another internal table. Instead, you could do several approaches:

1. Show an icon for this field, so that the user presses it, and then you could show a detail list for the contents of this itab for that particular record, or

2. Manually create records in the 'external' itab, replicating the contents of the another fields in every record.

I hope this helps. Best regards,

Alvaro

Former Member
0 Kudos

Hi,

The internal table you define for the field catalog

should not have deep structures.so define it as individual fields.

Regards,

Bindu.

Former Member
0 Kudos

Hi ali,

If you have two internal tables and relation b/w them is header and item type then use 'REUSE_ALV_HIERSEQ_LIST_DISPLAY' FM.

Regards,

Sachin.

0 Kudos

Hello,

Thx for all answers. I would like to give more detail about my problem. I want to display a long text of data with ALV. I thought it could be better to display it as multiple lines, that is why I defined the related field as an internal table. Double clicking and displaying a popup is not a very good solution because the user will lose the general view. Is it not possible to have multiple lines in an ALV cell, can I insert carriage return/line feed within a long text line?

regards,

Ali

0 Kudos

Hi Ali,

in that case, <b>I agree with Sachin</b>. A hierarchical list could be more suitable for your needs. At the header level, you should place all fields (except the long text); at the item level, you could place the long text, split into several records, one per line, and all these linked to the corresponding header record.

I hope it helps. Best regards,

Alvaro