bohemianrsd
5+ Views

tab.alv18

FORM FILL_CELLTAB CHANGING PT_LVC_STYL TYPE LVC_T_STYL.
DATA : LS_LVC_STYL TYPE LVC_S_STYL.
DATA : BEGIN OF LS_FIELDCAT.
INCLUDE STRUCTURE LVC_S_FCAT.
DATA : END OF LS_FIELDCAT.
LOOP AT GT_LVC_FCAT INTO LS_FIELDCAT.
LS_LVC_STYL-FIELDNAME = LS_FIELDCAT-FIELDNAME.
CASE LS_LVC_STYL-FIELDNAME.
WHEN "'ZA_FN_CD_VAL'
'ZA_WHL_KRA_NM' OR
'ZA_AVL_BGN_YMD' OR
* 'ZA_AVL_END_YMD' OR
'ZA_USE_YN' OR 'ZA_CD_INFO_CNTNT'.
IF ( GV_MODE_TAB1 = ZGCLZ_EDIT ).
LS_LVC_STYL-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_ENABLED.
ELSE.
LS_LVC_STYL-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
ENDIF.
WHEN 'ZA_FN_CD_VAL' OR 'ZA_AVL_END_YMD'.
IF ( GV_MODE_TAB1 = ZGCLZ_EDIT ) AND
( GT_TAB1-CHECK = ZGCLZ_C ). "신규라인
LS_LVC_STYL-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_ENABLED.
ELSE.
LS_LVC_STYL-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
ENDIF.
WHEN OTHERS.
LS_LVC_STYL-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
ENDCASE.
INSERT LS_LVC_STYL INTO TABLE PT_LVC_STYL.
ENDLOOP.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form INSERT_ROW
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM INSERT_ROW .
DATA : LT_TABIX TYPE LVC_T_ROW,
LS_TABIX TYPE LVC_S_ROW.
DATA : LV_LINES TYPE I.
* RANGES : LR_INDEX FOR ZSCMO0005-INDEX.
CLEAR LS_TABIX. REFRESH LT_TABIX.
CALL METHOD GO_GRID->GET_SELECTED_ROWS
IMPORTING
ET_INDEX_ROWS = LT_TABIX.
IF LT_TABIX[] IS NOT INITIAL.
DESCRIBE TABLE LT_TABIX LINES LV_LINES.
IF LV_LINES > 1.
MESSAGE S000 WITH TEXT-E35 DISPLAY LIKE ZGCLZ_X.
EXIT.
ENDIF.
SORT LT_TABIX BY INDEX DESCENDING.
LOOP AT LT_TABIX INTO LS_TABIX.
CLEAR : GT_TAB1.
GT_TAB1-CHECK = ZGCLZ_C.
INSERT GT_TAB1 INTO GT_TAB1 INDEX LS_TABIX.
ENDLOOP.
ELSE.
CLEAR : GT_TAB1.
GT_TAB1-CHECK = ZGCLZ_C.
APPEND GT_TAB1 TO GT_TAB1.
ENDIF.
* GV_CHANGE = ZGCLZ_X.
PERFORM BUILD_CELL_ATTR.
PERFORM REFRESH_TABLE.
ENDFORM.
Comment
Suggested
Recent
Like
Comment
Share