The way its designed is input fields on screen of transaction MSC1N are grouped together and setting are applied on the group (field status group). For argument sake if Production date and Shelf life exp date are grouped together the attribute set on the field status group is shared by both the inputs. The attributes you can set is optional/ required and display/hide. Additionally, these setting are made independently for transaction MSC1N MSC2N MSC3N and MSC4N. So you can have a field mandatory on MSC1N, optional in MSC2N.
Below steps and setting are specific to make SLED input mandatory on MSC1N and MSC2N however you can use this to set attribute of any input on these transactions.
First find out the technical name of the input field. Press F1 on the field and then hit ‘Technical information’ button on the screen. Note down the screen field name which is DFBATCH-MHD_IO for SLED.
Now in SPRO follow menu path Logistics General->Batch Management->Batch Master->Field Selection Batch Master->Assign Fields to Field Groups.
Here you will see the field names and there Field group. Field Group can be any number between 1 and 40. Here field DFBATCH-MHD_IO is assigned to Field group 003. So if you change the attribute to group 003 it will be applied to SLED. Problem is there are few more fields which belong to this group and in turn they all will be mandatory.
Because of this reason we need to move field DFBATCH-MHD_IO to new field group. Find a field group number which is not assigned and change the field group of input to that number.
In this case I am assigning Field group as 010 to DFBATCH-MHD_IO. Save changes and exit transaction.
Now go to next item in SPRO i.e. Edit Field Selection Control. In this screen you can assign attributes to each field group which is defined in previous step. In case you are wondering how, each dot in column ‘Field Selection String’ represent one field group depending on its position. For example third dot represent field group 030. Since we have assigned SLED to 010 put cursor on 10th dot and press change button.
Notice in next dialog box the field SLED appeared and now you can change the attribute of the field or rather the group. So select option button ‘Required Entry’ and click OK.
Repeat same for MSC2N. Then save the setting and that’s it, you are ready to go.
User can also use transaction VL031N or VL032N to create batches without using MSC1N. To restrict user to create batch without SLED date you can check the value of SLED in user exit EXIT_SAPLVBMD_001 (Enhancement name SAPLMHD1). Put code to issue error message if SLED date is initial.