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: 

Validating editable field in ALV grid

Former Member
0 Kudos

Hi experts,

I am using the FM REUSE_ALV_GRID_DISPLAY to display an ALV output. I have made one column editable to the user. Now i want to validate the value entered by the user in this editable field upon pressing enter on the ALV grid.

For e.g. if the user input a value in the editable column and presses ENTER on the keyboard, i want to validate the value input by the user.

Any inputs on this will be surely rewarded.

Thanks and Regards,

Nilesh.

7 REPLIES 7

former_member181962
Active Contributor
0 Kudos

Check tyhe sample code:

call function 'REUSE_ALV_GRID.....'
EXPORTING
I_CALLBACK_USERCOMMAND = 'USER_COMMAND'

FORM USER_COMMAND using p_ucomm like sy-ucomm.........

Data ref1 type ref to cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = ref1.
call method ref1->check_changed_data.
CASE p_UCOMM.
WHEN 'SAVE'.
ENDCASE.
ENDFORM.

Check sample code here also:

http://www.sap-img.com/abap/an-interactive-alv-report.htm

Do your validations in USER_COMMAND form-endform.

0 Kudos

Pressing ENTER on the ALV grid does not trigger USER_COMMAND.

I have already try this option but this did not work. The control goes inside USER_COMMAND only when user presses some button on the application toolbar or elsewhere.

0 Kudos

I doubt if its possible to validate without hitting any button.

does at selection-screen output event and user command combo help you.

0 Kudos

Is it possible to link the ALV from REUSE_ALV_GRID_DISPLAY to OOPS alv? Can i call the methods of the cl_gui_alv_grid by creating a reference to this ALV?

0 Kudos

other than calling the reuse FM you will call the cl_gui_* class and use the *first_display method.. then you can link to OO

Former Member
0 Kudos

Please refer below threads:

I know these threads were posted later, but just mentioning here as this link was on top when i searched.

0 Kudos

Thank you sir. The solution is working fine for Oops ALV.