通过查询底表,看到哪些smartforms没有生成对应的程序判断smartforms需要调整
*&---------------------------------------------------------------------*
*& Report ZMIGR_SEL_SMARTFORMS
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT ZMIGR_SEL_SMARTFORMS.
TYPES:BEGIN OF OUTPUT.
INCLUDE TYPE STXFADM.
TYPES: TDSFNAME TYPE RS38L_FNAM.
TYPES:END OF OUTPUT.
DATA:GO_ALV TYPE REF TO CL_SALV_TABLE.
DATA: GT_OUTPUT TYPE TABLE OF OUTPUT,
GS_OUTPUT TYPE OUTPUT.
DATA: LV_NAME TYPE TDSFNAME.
START-OF-SELECTION.
SELECT * FROM STXFADM INTO CORRESPONDING FIELDS OF TABLE GT_OUTPUT
WHERE FORMNAME LIKE 'Z%'.
LOOP AT GT_OUTPUT ASSIGNING FIELD-SYMBOL(<FS_OUTPUT>).
IF <FS_OUTPUT>-FORMNAME IS NOT INITIAL.
LV_NAME = <FS_OUTPUT>-FORMNAME.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = LV_NAME
IMPORTING
FM_NAME = <FS_OUTPUT>-TDSFNAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3
.
ENDIF.
ENDLOOP.
TRY.
CL_SALV_TABLE=>FACTORY(
IMPORTING
R_SALV_TABLE = GO_ALV
CHANGING
T_TABLE = GT_OUTPUT ).
CATCH CX_SALV_MSG.
ENDTRY.
"自动列宽
go_alv->get_columns( )->set_optimize( 'X' ).
"斑马线
go_alv->get_display_settings( )->set_striped_pattern( 'X').
"使用自己定义的9000状态
go_alv->set_screen_status(
pfstatus = '9000'
report = sy-repid "'ZLIMF_SALV' "程序名
set_functions = go_alv->c_functions_all ).
"显示
go_alv->display( ).