‎2009 Dec 28 10:20 AM
I have binded a table to a ALV grid, and copying the code from BCALV_EDIT_02. I can successfully make some of fields editable. But how can I capture the edited field values and use it for updating the database table? Thanks.
‎2009 Dec 28 10:30 AM
hi ,
create object of alv .... V_OBJ_ALV
CALL METHOD V_OBJ_ALV->SET_TABLE_FOR_FIRST_DISPLAY.
EXPORTING
I_SAVE = 'A'
CHANGING
IT_OUTTAB = " internal table
IT_FIELDCATALOG = " field catalog table
.
after that
method for editable alv....through object
*----------------------------FUNCTION FOR EDITABLE ALV
CALL METHOD V_OBJ_ALV->REGISTER_EDIT_EVENT
EXPORTING
I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED
EXCEPTIONS
ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.*----
handel the event on the editable alv in secondry list display
CASE sy-ucomm.
WHEN 'OK'.
*------logic to handel the event
CALL METHOD V_OBJ_ALV->CHECK_CHANGED_DATA.
CALL METHOD CL_GUI_CFW=>FLUSH.
CALL METHOD CL_GUI_CFW=>DISPATCH.
* handel the user command for the smartform button in secondlist
WHEN 'SF'. "function code for smart form callin button
*--logic to handel the smartform button
ENDCASE.regards
Gaurav
‎2009 Dec 28 10:26 AM
yes..
in PF status you can create a button for your use and use that FCODE in user_command event and update the data base..
‎2009 Dec 28 10:30 AM
hi ,
create object of alv .... V_OBJ_ALV
CALL METHOD V_OBJ_ALV->SET_TABLE_FOR_FIRST_DISPLAY.
EXPORTING
I_SAVE = 'A'
CHANGING
IT_OUTTAB = " internal table
IT_FIELDCATALOG = " field catalog table
.
after that
method for editable alv....through object
*----------------------------FUNCTION FOR EDITABLE ALV
CALL METHOD V_OBJ_ALV->REGISTER_EDIT_EVENT
EXPORTING
I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED
EXCEPTIONS
ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.*----
handel the event on the editable alv in secondry list display
CASE sy-ucomm.
WHEN 'OK'.
*------logic to handel the event
CALL METHOD V_OBJ_ALV->CHECK_CHANGED_DATA.
CALL METHOD CL_GUI_CFW=>FLUSH.
CALL METHOD CL_GUI_CFW=>DISPATCH.
* handel the user command for the smartform button in secondlist
WHEN 'SF'. "function code for smart form callin button
*--logic to handel the smartform button
ENDCASE.regards
Gaurav
‎2009 Dec 29 4:52 AM
HI,
READ TABLE it_item INDEX rs_selfield-tabindex INTO wa_item.
from this code u can get data of the curser and go to the T code by skiping fst screen
Regards
‎2009 Dec 29 5:01 AM