sap abap alv report fill gap between documents

元气小坏坏 提交于 2020-01-22 02:36:11

问题


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

For example:

last index value: 20012 then next value is: 20014

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

Thanks.


回答1:


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.


来源:https://stackoverflow.com/questions/51317446/sap-abap-alv-report-fill-gap-between-documents

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!