cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding ALV edit feature

Former Member
0 Kudos

Hi All,

An ALV can be set into editable state by

1. setting the layout attribute "edit" to 'X' and also by

2. calling the method "set_ready_for_input" of cl

guialv_grid.

The SAP documentation in the sample program BCALV_EDIT_01 says that

<u><i><b> You switch between "editable and not ready for input" and

"editable and ready for input" using method SET_READY_FOR_INPUT.</b></i></u>

i didn't quite understand the feature "editable and not ready for input". Even if i don't

call the method "set_ready_for_input" i'm able to edit the ALV, then what is the necessity

of calling this method.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Vijay,

You can set the EDIT feature in two ways.

1. Layout level - all the fields will be in edit mode.

2. FIELDCATA leve - only those fields for which you set EDIT = 'X' will be in edit mode.

Now, the method in question is used to toggle between edit and read only mode at run time. Just like ME22n transaction.

You can even set the EDIT functionality at the CELL level with in a column using STYLES.

Regards,

Ravi

Note : If this solves your issue, please close the thread

former_member188685
Active Contributor
0 Kudos

Hi,

the below code set the grid editable for the fields with option edit = 'X' only it is required for initial.

CALL METHOD g_grid->set_ready_for_input

EXPORTING i_ready_for_input = 1.[/code]

you can switch edit off with the below code..

  CALL METHOD G_GRID->SET_READY_FOR_INPUT
    EXPORTING
      I_READY_FOR_INPUT = 0.

Regards

vijay

Former Member
0 Kudos

hi vijay

In the documentation it is defined that editable and not ready for input is that it will be in the editable mode but not active by default the editable feature is present but not activated using method SET_READY_FOR_INPUT the feature is activated initially.

hope u might have understood...if not please let me know.

priya

Former Member
0 Kudos

Hi Priya,

It seems there is a little confusion in understanding my question or may be i'm not able to understand ur explantion. I'm again repeating the same.

Even if we don't activate the edit feature by using the method set_ready_for_input, we'll be able to edit the grid by setting the "EDIT" of the layout structure to 'X', isn't it?. As we are able to edit the grid with out calling the method "set_ready_for_input"(i.e, in the deactivated state) then what is the necessity to call this method?

Former Member
0 Kudos

Vijay,

As explained by me, this method is to switch on/off the EDIT functionality at run time.

If you want the GRID to be in EDIT mode all the time, then just the LAYOUT or FIELDCAT attributes and that should be enough.

Regards,

Ravi

Note : Please close the thread if the issue is cleared

former_member188685
Active Contributor
0 Kudos

Hi,

it is just a call for Initially. but when you want to turn it off you need to call the same method. if you set layout-edit = 'X' then the whole grid is editable .

how will you turn it off, it is only possible via this method or using styles conditionally can make it edit off.

the method can be used in two ways.

to make grid edit or non edit.

Regards

vijay

Former Member
0 Kudos

Hi Ravikumar,

My doubt is regarding the <u><i><b>difference between the 2 states</b></i></u> "editable and not ready for input" and "editable and ready for input".

Former Member
0 Kudos

Vijay,

Although the EDIT option (Enabled using FIELDCAT / LAYOUT) is enabled, its not ready for input (DISABLED at runtime).

IF you enable it, its enabled at both places.

Without Switching on the EDIT at layout / fieldcat level, I don't think you can use the method at runtime.

Regards,

Ravi

Note : Please mark the helpful answers

Former Member
0 Kudos

Ravikumar,

This is what i'm trying to explain, it is just enough to set the edit attribute of layout/fieldcat to make the grid ready for input at runtime. By going through the replies i came to a conclusion that the method set_ready_for_input is only used for switching purpose at runtime. Correct me if i'm wrong.

Former Member
0 Kudos

Vijay,

You are absolutely right.

If you want to have EDIT functionality all the time, set it at the LAYOUT / FEIDCAT level.

If you want to toggle between the modes, set it at the LYAOUT / FIELDCAT level and then call the method wherever you want to switch. Assume I have CHANGE/DISPLAY button on the toolbar and the user wants to toggle between the modes, that is when you will use this.

Please close the thread, if the issue is closed - Also mark all the helpful answers.

Regards,

Ravi

Message was edited by: Ravikumar Allampallam