10-29-2007 8:56 AM
I'm using ALV to Display screen with <b>editable</b> fields.
Is it possible to define some fields as mandatory?
If yes how?
10-29-2007 10:43 AM
Dear Itzik,
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
Kesava
10-29-2007 3:35 PM
Kesava,
Thanks for your reply.
I already implement this code, but I need also to put the cursor on the specific cell,
So I'm using method SET_SELECTED_CELLS_ID
Now I come to another problem, when the ALV displayed (after the error message)
The color on the last cell which I change the data, display with the default color (the cells color changed before the first display)
Any suggestion?
12-20-2007 11:18 AM
Hi, Itzik!
I had a similar problem and solved it using example from [An Easy Reference For ALV Grid Control|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907].
Chapter: "Controlling Data Changes", on page 49.
Good luck!
Vladan