问题就是,内表的数据没刷新出来
代码如下:
FORM frm_command USING i_ucomm TYPE sy-ucomm
selfield TYPE slis_selfield.
DATA: ls_stbl TYPE lvc_s_stbl.
ls_stbl-row = 'X'. "基于行的稳定刷新
ls_stbl-col = 'X'. "基于列稳定刷新
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = lr_grid.
CALL METHOD lr_grid->check_changed_data.
selfield-refresh = 'X'. "刷新数据
CASE i_ucomm.
WHEN '&IC1'.
READ TABLE lt_item INTO ls_item INDEX selfield-tabindex.
IF sy-subrc EQ 0.
"IF ls_item-ebeln IS NOT INITIAL.
"
" CALL FUNCTION 'ME_DISPLAY_PURCHASE_DOCUMENT'
" EXPORTING
" i_ebeln = ls_item-ebeln
" EXCEPTIONS
" not_found = 1
" no_authority = 2
" invalid_call = 3
" preview_not_possible = 4
" OTHERS = 5.
"ENDIF.
ENDIF.
WHEN 'SEL'. "全选。
CLEAR ls_item.
ls_item-zcheck = 'X'.
MODIFY lt_item FROM ls_item TRANSPORTING zcheck WHERE zcheck = ''.
WHEN 'DSEL'. "取消全选
CLEAR ls_item.
ls_item-zcheck = ''.
MODIFY lt_item FROM ls_item TRANSPORTING zcheck WHERE zcheck = 'X'.
WHEN 'SAVE'.
WHEN 'CDO'.
READ TABLE lt_item TRANSPORTING NO FIELDS WITH KEY zcheck = 'X' zvdo = ''.
IF sy-subrc EQ 0.
PERFORM frm_cdo.
ELSE.
MESSAGE w001(00) WITH 'Please Check DATA'.
ENDIF.
WHEN 'CQR'.
WHEN OTHERS.
ENDCASE.
CALL METHOD lr_grid->refresh_table_display
EXPORTING
is_stable = ls_stbl.
ENDFORM.
图:
设计的,就是创建了DN ,这里要出来DN的号码,
但是,不知道为什么不出来,
DEBUG后,发现,MESSAGE之后,就没再执行,所以后面的refresh_table_display其实没执行
把MESSAGE 这里 的W001(00) 使用的W (警告)改成S(成功)。就解决了。
想不到,居然是W的问题
然后就搞定了。