Code: Alles auswählen.
IF <t_dyn_table> IS ASSIGNED.
DATA: lt_fieldcat_tmp TYPE slis_t_fieldcat_alv,
ls_fieldcat_tmp TYPE LINE OF slis_t_fieldcat_alv.
DATA: l_tabname TYPE slis_tabname.
LOOP AT it_fieldcat INTO wa_fieldcat.
CLEAR counter.
LOOP AT it_tfeatures INTO ls_tfeatures.
ADD 1 TO counter.
CONCATENATE 'AUSP1_' counter INTO lv_field.
* CONCATENATE ls_tfeatures-atnam counter INTO lv_field.
READ TABLE it_tfeatures INTO ls_tfeatures
WITH KEY atnam = ls_objectdata-atnam.
* READ TABLE lt_fieldcat_tmp INTO ls_fieldcat_tmp WITH KEY fieldname =
* lv_field.
* wa_fieldcat-coltext.
IF sy-subrc = 0.
ls_fieldcat_tmp-seltext_s = ls_fieldcat_tmp-seltext_m =
ls_fieldcat_tmp-seltext_l = ls_fieldcat_tmp-reptext_ddic = ls_tfeatures-atbez.
MODIFY lt_fieldcat_tmp FROM ls_fieldcat_tmp INDEX sy-tabix.
ENDIF.
ENDLOOP.
MOVE-CORRESPONDING wa_fieldcat TO ls_fieldcat_tmp.
APPEND ls_fieldcat_tmp TO lt_fieldcat_tmp.
ENDLOOP.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
* I_CALLBACK_PROGRAM = ' '
* 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 = 'ZRPMM_EQUIPMENT_INSPECTION_3'
* I_BACKGROUND_ID = ' '
i_grid_title = 'Equipmentlist Inspection'
* I_GRID_SETTINGS =
is_layout = ls_layout
it_fieldcat = lt_fieldcat_tmp
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
i_save = 'X'
is_variant = lv_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
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* I_HTML_HEIGHT_TOP =
* I_HTML_HEIGHT_END =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = <t_dyn_table>
EXCEPTIONS
program_error = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
Code: Alles auswählen.
LOOP AT it_tfeatures INTO ls_tfeatures.
IF ls_tfeatures-atfor = 'NUM' AND ls_tfeatures-anzdz = '0'.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = ls_tfeatures-atnam.
wa_fieldcat-inttype = 'I'.
wa_fieldcat-outputlen = ls_tfeatures-anzst.
wa_fieldcat-coltext = ''.
wa_fieldcat-seltext = wa_fieldcat-coltext.
ELSE.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = ls_tfeatures-atnam.
wa_fieldcat-inttype = 'C'.
wa_fieldcat-outputlen = '30'.
wa_fieldcat-coltext = ''.
wa_fieldcat-seltext = wa_fieldcat-coltext.
ENDIF.
wa_fieldcat-seltext_s = wa_fieldcat-seltext_m =
wa_fieldcat-seltext_l = wa_fieldcat-reptext_ddic = ls_tfeatures-atbez.
APPEND wa_fieldcat TO it_fieldcat.
ENDLOOP
Code: Alles auswählen.
IF <t_dyn_table> IS ASSIGNED.
DATA: lt_fieldcat_tmp TYPE slis_t_fieldcat_alv,
ls_fieldcat_tmp TYPE LINE OF slis_t_fieldcat_alv.
DATA: l_tabname TYPE slis_tabname.
LOOP AT it_fieldcat INTO wa_fieldcat.
CLEAR ls_fieldcat_tmp.
MOVE-CORRESPONDING wa_fieldcat TO ls_fieldcat_tmp.
READ TABLE it_tfeatures INTO ls_tfeatures
WITH KEY atnam = wa_fieldcat-fieldname.
IF sy-subrc = 0.
ls_fieldcat_tmp-seltext_s = ls_fieldcat_tmp-seltext_m =
ls_fieldcat_tmp-seltext_l = ls_fieldcat_tmp-reptext_ddic = ls_tfeatures-atbez.
ELSE.
ls_fieldcat_tmp-seltext_s = ls_fieldcat_tmp-seltext_m =
ls_fieldcat_tmp-seltext_l = ls_fieldcat_tmp-reptext_ddic = wa_fieldcat-fieldname.
ENDIF.
APPEND ls_fieldcat_tmp TO lt_fieldcat_tmp.
ENDLOOP.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
* I_CALLBACK_PROGRAM = ' '
* 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 = 'ZRPMM_EQUIPMENT_INSPECTION_3'
* I_BACKGROUND_ID = ' '
i_grid_title = 'Equipmentlist Inspection'
* I_GRID_SETTINGS =
is_layout = ls_layout
it_fieldcat = lt_fieldcat_tmp
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
i_save = 'X'
is_variant = lv_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
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* I_HTML_HEIGHT_TOP =
* I_HTML_HEIGHT_END =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = <t_dyn_table>
EXCEPTIONS
program_error = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.