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

Field Merging in ALV

Hi,

How to merge the repetitive entries of field, while displaying in ALV.

For example:

In my internal table ITAB has 3 fields, VBELN, POSNR, AMOUNT. If ITAB contains 1 record say 100 with 4 line items 10, 20, 30 & 40. I need to display it as

VBELN POSNR AMT

100 10 2500

20 1500

30 2600

40 5680

I do want to display VBELN value only once, since it is same.

I tried using sort option in ALV and also populated the cell_merge value in layout with value 'X'. But it is not working as desired.

I am using the FM 'Reuse_alv_grid_display. Can anyone help me out.

PS: In the ITAB, VBELN is the second field. First is the indicator field (MARK).

With Regards,

NL

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 09:08 AM

    i dont know if you comment spos whether it will work or not ?

    otherwise format your itab like that

    data : v_vbeln like vbap-vbeln.

    sort itab by vbeln.

    loop at itab.

    on change of itab-vbeln.

    v_vbeln = itab-vbeln.

    endon.

    itab-vbeln = v_vbeln.

    modify itab.

    clear v_vbeln.

    endloop.

    regards

    shiba dutta

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 08:55 AM

    you have already said you have used sort option in that whether you have only used up = 'X' and group = 'UL'. or not ?

    try to comment cell_merge.

    please let me know.

    regards

    shiba dutta

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 08:57 AM

    define your vbeln as char and dont use the original data type from table.

    Thanks.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 09:02 AM

    The sort table is populated as follows. Also ITAB contains more than 20 fields.

    WA_SORT-FIELDNAME = 'VBELN'.

    WA_SORT-SPOS = '1'.

    WA_SORT-UP = 'X'.

    WA_SORT-group = 'UL'.

    APPEND WA_SORT TO I_SORT.

    Still i could not get the desired result.

    With Regards,

    NL

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 09:10 AM

    Hi Naveen,

    Well you can modify your table by other records vbeln as space and printing checking based on vbeln is repeating or not .

    If useful reward .

    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.