‎2008 Jan 30 7:16 AM
Hi,
I have created a ALV grid using ABAP OO.
I need to make some of the fields as mandatory ones.
Pls help me on this.
I tried using DATA_CHANGED. But for the first time it brings up all the fields(even if teh fields are not modified) in the MT_GOOD_CELLS .
Pls help
‎2008 Jan 30 7:24 AM
Hi,
Which ever field you want as mandatory,in the fieldcatalog place the component VALEXI as 'X'. It would make that field mandatory.
<REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>
Thanks,
Dishant
Edited by: Alvaro Tejada Galindo on Aug 25, 2008 5:21 PM
‎2008 Jan 30 7:19 AM
It is not possible to set some fields as mandatory using fieldcatalog or by layout setting. But we can write some logic to check the whether required fields are filled or not and then give an error message.
Before updating the values, check the internal table whether all the required fields have been filled or not, other wise give an error.
LOOP AT lt_output INTO lwa_output.
IF lwa_output-req_field IS INITIAL.
MESSAGE e000(z1). "Field is mandatory
ENDIF.
ENDLOOP.
Regards
‎2008 Jan 30 7:24 AM
Hi,
Which ever field you want as mandatory,in the fieldcatalog place the component VALEXI as 'X'. It would make that field mandatory.
<REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>
Thanks,
Dishant
Edited by: Alvaro Tejada Galindo on Aug 25, 2008 5:21 PM
‎2008 Aug 25 4:51 PM
Hi Dishant,
thats not right, sorry...valexi works only, if in the dictionary is a foreignkey or valuetable defined...
Greetz
Sabrina