SAP ABAP ALV报告填补文档之间的空白

SAP ABAP 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

last index value: 20012 then next value is: 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.