10-15-2008 1:22 PM
Hi
In AlV Grid i want to display a particular field as error field when other two fields of the same rows are equal.
Can i show a field in error when alv is displayed and when user enter some value in the error field the error should go away.
note : i want to display such scenario for first display also so...
methods like mt_good_cells or mt_mod_cells wont work here
regards
vivek
10-15-2008 2:21 PM
Hello vivek jain ,
You show that error column or row in the Red color icon when ever it contains error message.
data:
p_y_wa_layout TYPE slis_layout_alv
box TYPE char1,
lights TYPE char1,
y_wa_lignam TYPE slis_fieldname VALUE 'LIGHTS'.
pass this to Grid layout
____________________________
p_y_wa_layout-lights_fieldname = y_wa_lignam.
Try,
First declare one field like box and light in the internal table and
10-16-2008 3:53 AM
hi
Thx for the reply but i want to show field in error for particular recors only not for all...so if i put something in layout for the fieldname it will be applicable for entire column..which i dont want.....
and one more thing i cant change the layout i guess when i enter some value in errror field(then it should display w/o error)
any other thghts on this???plz reply
regards
vivek
10-16-2008 4:06 AM
hai,
use alv oops
*set the field as edit in fieldcatlog**
WFIELDCAT-COL_POS = '3'.
WFIELDCAT-FIELDNAME = 'ERNAM'.
WFIELDCAT-EDIT = 'X'.
APPEND WFIELDCAT TO IFIELDCAT.
CLEAR WFIELDCAT.
***check ur condition in pbo****
IF WMARA-ERNAM <> 'RUDISILL'.
PERFORM FILL_CELLTAB USING '00080000'
CHANGING LT_CELLTAB.
ELSE.
PERFORM FILL_CELLTAB USING '00100000'
CHANGING LT_CELLTAB.
ENDIF.
INSERT LINES OF LT_CELLTAB INTO TABLE WMARA-CELLTAB.
MODIFY IMARA INDEX L_INDEX FROM WMARA.
**********************************************************
FORM FILL_CELLTAB USING VALUE(P_MODE)
CHANGING PT_CELLTAB TYPE LVC_T_STYL.
DATA: LS_CELLTAB TYPE LVC_S_STYL,
L_MODE TYPE RAW4.
This forms sets the style of column 'PRICE' editable
according to 'p_mode' and the rest to read only either way.
IF P_MODE EQ '00080000'.
*§2a.Use attribute CL_GUI_ALV_GRID=>MC_STYLE_ENABLED to set a cell
to status "editable".
L_MODE = CL_GUI_ALV_GRID=>MC_STYLE_ENABLED.
ELSE. "p_mode eq '00100000'
*§2b.Use attribute CL_GUI_ALV_GRID=>MC_STYLE_DISABLED to set a cell
to status "non-editable".
L_MODE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
ENDIF.
LS_CELLTAB-FIELDNAME = 'MATNR'.
LS_CELLTAB-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
INSERT LS_CELLTAB INTO TABLE PT_CELLTAB.
LS_CELLTAB-FIELDNAME = 'ERSDA'.
LS_CELLTAB-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
INSERT LS_CELLTAB INTO TABLE PT_CELLTAB.
LS_CELLTAB-FIELDNAME = 'ERNAM'.
LS_CELLTAB-STYLE = L_MODE.
INSERT LS_CELLTAB INTO TABLE PT_CELLTAB.
LS_CELLTAB-FIELDNAME = 'BRGEW'.
LS_CELLTAB-STYLE = L_MODE.
INSERT LS_CELLTAB INTO TABLE PT_CELLTAB.
ENDFORM.
10-22-2008 11:51 AM