抑制表中的重复条目 [英] Suppress duplicated entries in a table

查看:32
本文介绍了抑制表中的重复条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何抑制经典(写入)和 ALV 报告中的重复条目?我的任务是用这个标准写一份简单的报告.我试图用谷歌搜索,但他们的任何解决方案都无法成功,需要帮助.以下是预期的结果.

How do i suppress duplicate entries in both classical (write) and ALV report? I was given a task to write a simple report with this criteria. I tried to google but could not succeed with any of their solutions and need help. Below is the expected result.

原始报告:

--------------------------------------
|Sales Org | Dist.Channel | Division | 
--------------------------------------
|1000      |10            |00        |
|1000      |10            |00        |
|1000      |10            |00        |
|1020      |22            |00        |
|1020      |22            |00        |
--------------------------------------

预期输出:

--------------------------------------
|Sales Org | Dist.Channel | Division |
--------------------------------------
|1000      |10            |00        |
|          |              |          |
|          |              |          |
|1020      |22            |00        |
|          |              |          |
--------------------------------------

需要帮助.谢谢.

推荐答案

假设您使用内部表来存储将要显示的数据,您可以使用 从 itab 中删除相邻的重复条目.

Assuming you are using an internal table to store data that is going to be displayed, you can use DELETE ADJACENT DUPLICATE ENTRIES FROM itab.

对于 ALV 网格,您必须使用内部表.对于WRITE语句,即使直接从数据库表中读取也可以缓冲内表中的条目,使用上述语句删除重复项,然后显示内表中的结果.

For ALV grid you have to use an internal table. For WRITE statement, even if you read directly from a database table you can buffer the entries in an internal table, use the above statement to delete duplicates and then display results from internal table.

问候,塞尔吉乌

这篇关于抑制表中的重复条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆