2012 Mar 15 9:26 AM
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.
2012 Mar 15 9:37 AM
Hi,
Similar problem is solved below by defining the code in Data section of infoset.
2012 Mar 15 10:18 AM
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?
2012 Mar 15 9:50 AM
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.
2012 Mar 15 10:22 AM
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?
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |