Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Mandatory fields in ALV

Former Member
0 Kudos

I'm using ALV to Display screen with <b>editable</b> fields.

Is it possible to define some fields as mandatory?

If yes how?

3 REPLIES 3

Former Member
0 Kudos

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

0 Kudos

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?

Former Member
0 Kudos

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