本文介绍了ALV 报告填补了文件之间的空白的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图挑战自己制作一份 ALV 报告,按公司代码显示所有数据.但有些文件编号有差距.

I was trying to challenge myself to make an ALV report that displays all the data by company code. but some document number has a gap.

我想填补缺失号码之间的空白

I want to fill the gap between missing number

例如:

  • 最后一个索引值:20012
  • 那么下一个值是:20014

如果报表使用内部表中存在的所有数据,我如何能够在网格中插入 20013?

How do I able to insert 20013 in the grid if the report is using all the data that exist in internal tables?

谢谢.

推荐答案

这只是盲文,但我希望你能理解它......应该很简单.不要期望完整的代码,除非您甚至没有提供任何代码.

This is just blind text typing, but I hope you are able to understand it ... should be quite simple. Dont expect complete code, unless your are not even providing ANY code.

DATA: lv_current type i,
      lv_next type i.

SORT lt_internalTable by BUKRS ascending.

LOOP AT lt_internalTable into ls_internalTable.
MOVE sy-tabix to lv_current.
READ TABLE lt_internalTable into ls_tempinternalTable INDEX sy-tabix + 1.
MOVE sy-tabix to lv_next.

IF (lv_next - lv_current) > 1.
 ... do your stuff
ENDIF.

CLEAR: ls_internalTable, lv_current, lv_next.
ENDLOOP.

这篇关于ALV 报告填补了文件之间的空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 21:11