Field Modifications

1. How to selectively grey out a field in VA01/02 ?

User Exit USEREXIT_FIELD_MODIFICATION
This exit is processed for EVERY field in the screen.
eg., Submitted date/time is entered here when creating the quote. In change mode this field by default is editable. The business required that this field should not be editable later after
the quote is created.
The following code is written to accomplish this.

if t180-trtyp eq 'V' and vbak-auart ne 'ZQTE' and (
screen-name = 'VBAK-MAHDT' or
screen-name = 'VBAK-BSTZD' ).

data: w_mahdt like vbak-mahdt.
data: w_bstzd like vbak-bstzd.

clear: w_mahdt, w_bstzd. "Submitted Date and Time fields

select single mahdt bstzd " Select the actual fields from the document.
from vbak
into (w_mahdt, w_bstzd)
where vbeln = vbak-vbeln.

if ( not w_mahdt is initial )
and ( not w_bstzd is initial ).
screen-input = 0. " This is what makes the fields grayed out.
endif.
endif.

1 comment:

sonia said...

Hi,
Thank you for your post. It is nice to visit your site.
SAP SD Training in Hyderabad