Hi Guys,
1. If you want to make field EXTI1 as non-edit mode then follow the below steps.
Go to CMOD-->Create a project to assign the enhancement V56BMOD-->You can find component as EXIT_SAPLV56B_001 exit --> Double click on this exit --> You can find
include zxv56u34--> double click and click on enter then you will get the option to create--> Click on create and write the code as below. Do not forget to active the project.
Example : Field EXTI1 as non-edit mode
if c_screen-name = 'VTTK-EXTI1'.
c_screen-input = '0'.
e_screen_modified = 'X'.
endif.
2. If you want to change the field 'VTTK-EXTI1' in run time then follow the below steps.
Go to SE38--> Include MV56AF99N_TA_CNTL--> Click on spiral symbol in the application tool bar--> Right click and select Enhancement Operations->Show Implicit Enhancement Options,find the form header_change,next line of this Right click and select Enhancement Operations->Create Implementations--> Give Custom name, save and activate it. Write the code as below.
Example : If you want the field VTTK-EXTI1' default values in RUN TIME
If sy-tcode = 'VT01N' OR sy-tcode = 'VT02N'.
data lv_vttk type vttkvb.
read table xvttk into lv_vttk index 1.
if sy-subrc = 0.
lv_vttk-exti1 = '999'.
modify xvttk from lv_vttk index 1.
endif.
Endif.
3. If you want to add some validation at the time of save then follow the below steps.
Go to SE19--> Enter BADI details as per below
Enter custom name ZBADI_LE_SHIPMENT and provide the description, save,activate the badi-->In method AT_SAVE add your custom code as below.
Example : Validation at the time of SAVE
data lv_vttk type vttkvb.
read table cha_shipments_at_save-new_vttk into lv_vttk index 1.
if sy-subrc = 0.
if lv_vttk-exti1 = '100'.
message 'Error test' type 'E'.
endif.
endif.
Example : Change data at the time of SAVE
data lv_vttk type vttkvb.
read table cha_shipments_at_save-new_vttk into lv_vttk index 1.
if sy-subrc = 0.
lv_vttk-exti1 = '200'.
modify cha_shipments_at_save-new_vttk from lv_vttk index 1.
endif.
Thanks & Regards,
Shaiksha Vali.