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

issue in alv user command

Former Member
0 Likes
965

Hi All,

when i'm trying to update the priority value in the alv grid display for one line item, the same is getting updated for all the remaining line items.

Pls help...

Thanks and Regards,

SriLalitha.

1 ACCEPTED SOLUTION
Read only

0 Likes
924

Dear Sri Lalitha Kavuri,

As you know that each ALV grid content is associated with an internal table data that needs to be displayed via Field catalog. As far as your issue is concerned, You must not be using the key fields of an internal table to update only that particular line item. Try to get the index of the selected line and than MODIFY the internal table by using USING INDEX keywords. You can get the index from standard structure by importing it within the USER COMMAND subroutine signature.

Thanks,

Muhammad Asad Qureshi

7 REPLIES 7
Read only

naveenvishal
Contributor
0 Likes
924

You need to share the code for its resolution.

Read only

0 Likes
925

Dear Sri Lalitha Kavuri,

As you know that each ALV grid content is associated with an internal table data that needs to be displayed via Field catalog. As far as your issue is concerned, You must not be using the key fields of an internal table to update only that particular line item. Try to get the index of the selected line and than MODIFY the internal table by using USING INDEX keywords. You can get the index from standard structure by importing it within the USER COMMAND subroutine signature.

Thanks,

Muhammad Asad Qureshi

Read only

Former Member
0 Likes
924

Hi lalitha,

check out this sample code if you are passing subroutine in I_callback_usercommand of reuse_alv_grid_display.

FORM user_command   USING r_ucomm LIKE sy-ucomm

                                               rs_selfield TYPE slis_selfield.

         READ TABLE gi_final_output INTO gw_final_output INDEX rs_selfield-tabindex.

         modify <database_table> from gw_final_output where <key_filed> = gw_final_output-key_field.

    

  ENDFORM.         

Hope it will help.

Regards,

Mohammed Quddus.

Read only

VenkatRamesh_V
Active Contributor
0 Likes
924

Hi Sri ,

you can use User Command.

FORM UCOMM USING UCOMM TYPE SY-UCOMM

                  SEL   TYPE SLIS_SELFIELD.

READ TABLE IT_FINAL INTO WA_FINAL INDEX SEL-TABIndeX.

IF SY-SUBRC - 0.

UPDATE ZTABLE FROM  WA_FINAL.

ENDIF.

ENDFORM.

Regards,

Venkat.

Read only

former_member201275
Active Contributor
0 Likes
924

You using OO or standard functions? Please post code.

also you can look at some of the sap standard demo programs how they do this for example BCALV_EDIT_01. When this doesn't help have a look at other programs beginning with BCALV*

Read only

former_member201275
Active Contributor
0 Likes
924

This message was moderated.

Read only

Former Member
0 Likes
924

Answered..

Thank you all for your useful inputs...