12-22-2008 6:49 AM
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.
12-22-2008 8: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
12-22-2008 7: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
12-22-2008 7: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
12-22-2008 8: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