BAPI:BAPI_ACC_STAT_KEY_FIG_POST
HEAD表:COBK
DATA: LS_DOC_HEADER TYPE BAPIDOCHDRP,
LV_DOC_NO TYPE BAPIDOCHDRP-DOC_NO,
LT_DOC_ITEMS TYPE STANDARD TABLE OF BAPISKFITM WITH HEADER LINE,
LT_RETURN TYPE STANDARD TABLE OF BAPIRET2 WITH HEADER LINE,
LV_MESSAGE TYPE STRING,
LV_MSG TYPE STRING,
LV_ICON TYPE CHAR04.
DATA(LT_DATA) = GT_DATA.
DELETE LT_DATA WHERE BOX NE 'X' OR CELLTAB IS NOT INITIAL.
DATA(LV_LINES) = LINES( LT_DATA ).
DATA(LV_TIME) = LV_LINES / 999.
DATA(LV_DIFF) = LV_LINES MOD 999.
IF LV_DIFF NE 0.
LV_TIME = LV_TIME + 1.
ENDIF.
DO LV_TIME TIMES.
CLEAR: LS_DOC_HEADER,LV_DOC_NO,LT_DOC_ITEMS[],LT_RETURN[],LV_MESSAGE,LV_ICON.
DATA(LV_FROM) = ( SY-INDEX - 1 ) * 999 + 1.
DATA(LV_TO) = SY-INDEX * 999.
LS_DOC_HEADER-CO_AREA = P_KOKRS. " 控制范围
LS_DOC_HEADER-VAL_PERIOD = P_MONTH
标签:LV,DOC,指标,HEADER,LT,KB31N,TYPE,DATA,统计
From: https://blog.csdn.net/twins622/article/details/145061389