‎2009 Apr 17 2:15 PM
Hello,
I am editing a field in alv grid but I am not able to save.
I am using normal ALV and not OOALV.
I am able to get the row which I am edit but how do i get modified cell.
‎2009 Apr 17 2:19 PM
Hi Dear,
have you mentioned the key word EDIT for fieldcat.
thanks,
kat.
‎2009 Apr 17 2:22 PM
I can edit alv grid but cannot save the data.
I am not programming in oo.
‎2009 Apr 17 2:33 PM
On the ALV Grid Tool Bar You will have a refresh Button.The data will be save when that Button is clicked.
The Function Code for Refresh Button Is %REFRESH.
Regards,
Gurpreet
‎2009 Apr 17 2:35 PM
Ya Gurpreet I tried the refresh button top-left corner. The grid is getting refresh but data is not getting stored in database.
‎2009 Apr 17 2:56 PM
Hi try to get the concept from the below code snippet. keep a checkbox in your final itab that you want to show using ALV.then mark the checkbox for the line you want to edit a field.
WHEN '&ZXZ'.
CLEAR l_cntr.
CLEAR WA_final.
LOOP AT IT_final INTO WA_final.
IF WA_final-chk = 'X'.
l_cntr = l_cntr + 1.
ENDIF.
ENDLOOP.
IF l_cntr GT 1.
MESSAGE i011.
ELSEIF l_cntr = 1.
READ TABLE IT_final INTO WA_final WITH KEY chk = 'X'.
CALL FUNCTION 'POPUP_TO_GET_VALUE'
EXPORTING
fieldname = 'MENGE'
tabname = 'EKPO'
titel = 'PO Quan.'
valuein = WA_final-menge
IMPORTING
* ANSWER =
valueout = l_out_string
EXCEPTIONS
fieldname_not_found = 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.
CATCH SYSTEM-EXCEPTIONS conversion_errors = 1.
l_out_final = l_out_string.
ENDCATCH.
IF sy-subrc = 1.
MESSAGE i012 DISPLAY LIKE 'E'.
ELSE.
WA_final-menge = l_out_final.
MODIFY IT_final FROM WA_final TRANSPORTING menge
WHERE chk = 'X'.
CLEAR WA_final.
PERFORM disp_alv.
ENDIF.
ELSE.
MESSAGE i010.
ENDIF.
I have kept this code snippet for the subroutine used corresponding to the pf-status.
Regards.
Sarbajit
‎2009 Apr 17 3:05 PM
But I want to fetch data from alv grid and not from a popup screen
‎2009 Apr 17 3:11 PM
Hi at first you display your ALV............ok.Then you select a row and click the button that you created on toolbar..ok?Then the popup will come with the value that you want to change.then you change the value and when submit, it update the internal table. My logic in the above code snippet is something like that.
Regards.
Sarbajit.