‎2014 Jul 22 9:04 AM
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.
‎2014 Jul 22 9:14 AM
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
‎2014 Jul 22 9:09 AM
‎2014 Jul 22 9:14 AM
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
‎2014 Jul 22 11:24 AM
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.
‎2014 Jul 22 11:29 AM
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.
‎2014 Jul 22 12:32 PM
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*
‎2014 Jul 31 3:49 PM
‎2014 Aug 01 4:09 AM