*&---------------------------------------------------------------------*
*& Report Z_SALAH_SC05
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT Z_SALAH_SC05.
**********************************************************************
*REPORT DESCRIBE:语言字段分组
*DEVELOPER:SALAH
*DEVELOP DATE:20190912PM
*MODIFY DATE:
*FUNCTION SPEC:
*KEY USER:
**********************************************************************
TYPE-POOLS:SLIS.
TYPE-POOLS:ICON.
TYPES:BEGIN OF TYP_01.
INCLUDE STRUCTURE MAKT.
TYPES:STATUS TYPE STRING,
END OF TYP_01.
DATA GT_01 TYPE STANDARD TABLE OF TYP_01.
DATA GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA GS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA GS_LAYOUT TYPE SLIS_LAYOUT_ALV.
DEFINE FIELDCAT.
CLEAR GS_FIELDCAT.
GS_FIELDCAT-COL_POS = &1.
GS_FIELDCAT-FIELDNAME = &2.
GS_FIELDCAT-SELTEXT_L = &3.
APPEND GS_FIELDCAT TO GT_FIELDCAT.
END-OF-DEFINITION.
START-OF-SELECTION.
SELECT *
FROM MAKT
INTO CORRESPONDING FIELDS OF TABLE GT_01.
END-OF-SELECTION.
IF GT_01 IS NOT INITIAL.
PERFORM FRM_ALV_SHOW.
ELSE.
MESSAGE '无符合要求的数据' TYPE 'E'.
ENDIF.
*&---------------------------------------------------------------------*
*& Form FRM_ALV_SHOW
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM FRM_ALV_SHOW .
PERFORM FRM_CHANDATA.
PERFORM FRM_FIELDCAT.
PERFORM FRM_DISPLAY.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form FRM_FIELDCAT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM FRM_FIELDCAT .
FIELDCAT '1' 'MATNR' '物料编号'.
FIELDCAT '2' 'MAKTX' '物料描述'.
FIELDCAT '3' 'SPRAS' '语言代码'.
FIELDCAT '4' 'status' '状态'.
LOOP AT GT_FIELDCAT INTO GS_FIELDCAT .
IF GS_FIELDCAT-fieldname = 'STATUS'.
GS_FIELDCAT-ICON = 'X'.
MODIFY GT_FIELDCAT FROM GS_FIELDCAT INDEX SY-TABIX.
ENDIF.
ENDLOOP.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form FRM_DISPLAY
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM FRM_DISPLAY .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-CPROG
* I_CALLBACK_PF_STATUS_SET = ''
* I_CALLBACK_USER_COMMAND = ' '
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
* IS_LAYOUT =
IT_FIELDCAT = GT_FIELDCAT
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
* IT_EVENTS =
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* I_HTML_HEIGHT_TOP = 0
* I_HTML_HEIGHT_END = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* IR_SALV_FULLSCREEN_ADAPTER =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = GT_01
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form FRM_LAYOUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*