Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Showing ALV Field in Error on Display

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

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.

Former Member
0 Kudos

i found a way!!!!!!