Application Development and Automation 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: 
Read only

SAP Query - delete adjacent duplicates

Former Member
0 Likes
4,764

Hello,

I'm trying do delete adjacent duplicates from a result table of a query.

%dtab (result table) is filled by generated function /1BCDWB/IQG000000000025EXTR.

Coding within END-OF-SELECTION is as follows:

FIELD-SYMBOLS: <itab> type ANY.
ASSIGN '(/1BCDWB/SAPLIQG000000000025)%dtab' TO <itab>.
delete adjacent duplicates from <itab>.

Error message: "<itab> is not an internal table"

PS: I took /1BCDWB/SAPLIQG000000000025 as this is the program name generated by SAP query.

Can somebody help me? Thx in advance.

Hello,

I'm trying do delete adjacent duplicates from a result table of a query.

%dtab (result table) is filled by generated function /1BCDWB/IQG000000000025EXTR.

Coding within END-OF-SELECTION is as follows:

FIELD-SYMBOLS: <itab> type ANY.
ASSIGN '(/1BCDWB/SAPLIQG000000000025)%dtab' TO <itab>.
delete adjacent duplicates from <itab>.

Error message: "<itab> is not an internal table"

PS: I took /1BCDWB/SAPLIQG000000000025 as this is the program name generated by SAP query.

Can somebody help me? Thx in advance.

4 REPLIES 4
Read only

GauthamV
Active Contributor
0 Likes
1,715

Hi,

Similar problem is solved below by defining the code in Data section of infoset.

http://scn.sap.com/thread/1297078

Read only

Former Member
0 Likes
1,715

Hi,
did the following:

DATA constants : wk_table(7) VALUE '%dtab[]'.
FIELD-SYMBOLS : <t1> TYPE table.
END-OF-SELECTION ASSIGN (wk_table) TO <t1>.
CHECK <t1> IS ASSIGNED.
SORT <t1>.
DELETE ADJACENT DUPLICATES FROM <t1>.

=> as %dtab[] is not known in DATA section I put the coding to END-OF-SELECTION.

Result: No change! Duplicate rows still exist.

Any idea?

Read only

Former Member
0 Likes
1,715

use the sy-repid , instead of the generated program name, also concentrate on the join, rather than coding. that way you can avoid the duplicates with out writing the code in infoset.

Read only

0 Likes
1,715

Hi Vijay,

I have a join on VBRK and VBRP. Let's say 5 field from VBRK and 1 field from VBRP.
The selected field from VBRP has same content for each position/item.
So the result is 5 same rows when I have i.e. 5 positions/items in the invoice.

Any idea how do get a distinct result?