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: 

REUSE_ALV_HIERSEQ_LIST_DISPLAY

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

MarcinPciak
Active Contributor
0 Kudos

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

3 REPLIES 3

Former Member
0 Kudos

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

Former Member
0 Kudos

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

MarcinPciak
Active Contributor
0 Kudos

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