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

REUSE_ALV_HIERSEQ_LIST_DISPLAY

Hi all,

I am using REUSE_ALV_HIERSEQ_LIST_DISPLAY for alv list display.

In this I am using 2 internal table like w_vbap for header line and w_vbak for details.

I want to delete header line data which has no details.

Plz help me...

Thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Dec 22, 2008 at 08:00 AM

    Hi ankita,

    Use below logic:

    Loop at w_vbap.
       read table w_vbak where key_fields = w_vbap-key_fields.  "provide your key fields here
       if sy-subrc = 0.
          continue.   "details exists, go to another entry
       else.   "no details
          delete table w_vbap.  "remove current entry
       endif.
    endloop.
    

    Regards

    Marcin

    Generaly this is similar to what Joe wrote, but without setting a flag.

    Edited by: Marcin Pciak on Dec 22, 2008 9:01 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 07:13 AM

    Hi,

    The function module needs both internal tables - one for header data and the other for item data.

    Probably the header table can be copied to another internal table of same structure without considering the no-details records and this new header table can be be passed to the Function module as header table.

    For this, u have to loop in through the table, check if the entries are not initail and append the required values to the new header table.

    Thanks,

    Saipriya

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 07:36 AM

    Hi ,

    You can do one thing .take a flag in header structure

    Loop header table w_vbak into ws_vbak .

    Read item table w_vbap with key vbeln = w_vbap-vbeln.

    If sy-subrc not equal to 0 .

    Set a flag in header table using modify statement .

    endif.

    Delete from w_vbak where flag is 'X' .

    This will remove all your records which doesn't have item details ..

    Edited by: Joe rehan on Dec 22, 2008 8:38 AM

    Edited by: Joe rehan on Dec 22, 2008 8:39 AM

    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.