Application Development and Automation 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: 
Read only

ALV GRID edit mode keyboard issue

Former Member
0 Likes
1,645

Hi,

I have created a program that displays an ALV GRID.

From the Layout I said to edit in edit mode the ALV Grid.

In the menu toolbar I exclude the button 'cut - copy -paste and delete line'.

When I run the program I see that these buttons are not displayed --> OK.

BUT my problem is: if I use the keyboard then the ALV Grid manages these actions.

For instance. I select some lines and press the key DELETE on the keyboard --> the lines are removed and that is not that I expect because I removed this action from the toolbar.

For the cut - copy and paste it's the same.

Do you have a solution for me --> intercept an event or change the function keys or ....

I would like that the ALV Grid does not manage the keys delete, CRTL-C, CRTL-V in edit mode.

Thanks,

Stevie,

1 ACCEPTED SOLUTION
Read only

ssimsekler
Product and Topic Expert
Product and Topic Expert
0 Likes
1,359

Hi Steve

I was not aware of this. So, I recommend you to try this:

At the event <b>"before_user_command"</b> you can terminate the process by resetting the ALV user command.

<u><b>e.g.</b></u>


    CASE e_ucomm .

      WHEN '&INFO' .
        CALL METHOD gr_alvgrid->set_user_command
                      EXPORTING i_ucomm = space.
    ENDCASE .

This code within the event overrides the '&INFO' function and terminates its process. For cut and copy, you can find out ucomm values by putting a break point inside the event and tracing the value of <b>"i_ucomm"</b>.

For some relevant issues, you can inspect the tutorial <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an%20easy%20reference%20for%20alv%20grid%20control.pdf">"An Easy Reference For ALV Grid Control"</a>.

<i>As another thing, since you are a new SDN member, you are welcome and let me introduce you the SDN forums pointing system: You can assign points to posts you find helpful while solving your question. You can reward points by clicking the yellow star icon at header of each reply post. You can reward;

- one 10 points (solved)

- two 6 points (very helpful answer)

- many 2 points (helpful answer)</i>

Kind regards...

*--Serdar

Hi Steve

I was not aware of this. So, I recommend you to try this:

At the event <b>"before_user_command"</b> you can terminate the process by resetting the ALV user command.

<u><b>e.g.</b></u>


    CASE e_ucomm .

      WHEN '&INFO' .
        CALL METHOD gr_alvgrid->set_user_command
                      EXPORTING i_ucomm = space.
    ENDCASE .

This code within the event overrides the '&INFO' function and terminates its process. For cut and copy, you can find out ucomm values by putting a break point inside the event and tracing the value of <b>"i_ucomm"</b>.

For some relevant issues, you can inspect the tutorial <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an%20easy%20reference%20for%20alv%20grid%20control.pdf">"An Easy Reference For ALV Grid Control"</a>.

<i>As another thing, since you are a new SDN member, you are welcome and let me introduce you the SDN forums pointing system: You can assign points to posts you find helpful while solving your question. You can reward points by clicking the yellow star icon at header of each reply post. You can reward;

- one 10 points (solved)

- two 6 points (very helpful answer)

- many 2 points (helpful answer)</i>

Kind regards...

*--Serdar

6 REPLIES 6
Read only

ssimsekler
Product and Topic Expert
Product and Topic Expert
0 Likes
1,360

Hi Steve

I was not aware of this. So, I recommend you to try this:

At the event <b>"before_user_command"</b> you can terminate the process by resetting the ALV user command.

<u><b>e.g.</b></u>


    CASE e_ucomm .

      WHEN '&INFO' .
        CALL METHOD gr_alvgrid->set_user_command
                      EXPORTING i_ucomm = space.
    ENDCASE .

This code within the event overrides the '&INFO' function and terminates its process. For cut and copy, you can find out ucomm values by putting a break point inside the event and tracing the value of <b>"i_ucomm"</b>.

For some relevant issues, you can inspect the tutorial <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an%20easy%20reference%20for%20alv%20grid%20control.pdf">"An Easy Reference For ALV Grid Control"</a>.

<i>As another thing, since you are a new SDN member, you are welcome and let me introduce you the SDN forums pointing system: You can assign points to posts you find helpful while solving your question. You can reward points by clicking the yellow star icon at header of each reply post. You can reward;

- one 10 points (solved)

- two 6 points (very helpful answer)

- many 2 points (helpful answer)</i>

Kind regards...

*--Serdar

Read only

0 Likes
1,359

Thank you for the info.

I have tried but the event 'before_user_command' is not trigger.

I have tried also with the button cut and paste displayed and when I click on them the event is not trigger also. But when I click on any other button (i.e.: refresh, check,...) the event is trigger.

Is there a reason why this event is not trigger for the cut and paste? Is there another event?

Read only

0 Likes
1,359

Is the 'EDIT' mode required in this ALV Grid ?

Regards,

Subramanian V.

Read only

ssimsekler
Product and Topic Expert
Product and Topic Expert
0 Likes
1,359

Hi Steve

It is now more challenging. Just a work-around, but try "data_changed" event. There, the protocol object should be holding deleted and inserted rows in tables which are public attributes as I remember, clear them and reset the user command again.

*--Serdar

Read only

younmazz
Participant
0 Likes
1,359

Try this

GT_LAYOUT-NO_ROWMOVE = 'X'.

GT_LAYOUT-NO_ROWINS = 'X'.

  • Call DIS. Meth.

CALL METHOD GT_GRID_MAIN->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

....

IS_LAYOUT = GT_LAYOUT

....

CHANGING

.......

Read only

ronny_haak
Product and Topic Expert
Product and Topic Expert
0 Likes
1,359

Hi Hyung Jin Youn,

I have the same problem as the thread starter. Unfortunately no_rowmove and no_rowins work for me.

My internal table displayed in the ALV contains a field CHDATE which contains the date when the entry was last edited.

By setting no_rowins = 'X' and no_rowmove = 'X' the entry will not be deleted (that's nice) but unfortunately the field CHDATE won't be updated

Any ideas?

Thanks,

Ron