2009 May 05 10:19 PM
I have not been ABAPing long so primarily have been using keyword help...
I am trying to loop round an itab and only select and process unique keys from within the table!
However the table I am using to obtain the records has multiple records with the same reference and I am only interested in each unique occurrence of the IBASE_COMPONENT_GUID field.
So there could be four items for one Appliance and four for another one. So of the eight records, I would only need to loop round and select the unique GUIDS.
So there would only be two unique appliances I need to extract the records for.
Basically I am trying to do something like this:
LOOP AT GT_ITEM_DATA INTO GS_ITEM_DATA WITH UNIQUE KEY IBASE_COMPONENT_GUID. Is there a way to select each unique occurrence?
I have not been ABAPing long so primarily have been using keyword help...
I am trying to loop round an itab and only select and process unique keys from within the table!
However the table I am using to obtain the records has multiple records with the same reference and I am only interested in each unique occurrence of the IBASE_COMPONENT_GUID field.
So there could be four items for one Appliance and four for another one. So of the eight records, I would only need to loop round and select the unique GUIDS.
So there would only be two unique appliances I need to extract the records for.
Basically I am trying to do something like this:
LOOP AT GT_ITEM_DATA INTO GS_ITEM_DATA WITH UNIQUE KEY IBASE_COMPONENT_GUID. Is there a way to select each unique occurrence?
2009 May 05 10:24 PM
Basically, I use the COLLECT statement when I need to get the unique field (character only) field from the internal table.
Create a table with only one field, GUID.
LOOP through your main table, assign its GUID to new table's field GUID
Use COLLECT new_table.
Other option is,
Sort the table by GUID
Loop through it and use AT NEW GUID or AT END OF GUID
Fill out the table with this GUID.
Regards,
Naimesh Patel
2009 May 05 10:27 PM
>
> Other option is,
> Sort the table by GUID
> Loop through it and use AT NEW GUID or AT END OF GUID
> Fill out the table with this GUID.
Bear in mind that GUID has to be the first field of the table.
Rob
2009 May 15 12:35 PM
i went for the option DELETE ADJACENT DUPLICATES before hitting the loop and that does the trick! :o]
thank you!
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |