12-22-2008 9:03 AM
Dear friends,
I developed an ALV, and the quantity colum can be editable, but when I change the quantity without clicking "Check" or "Refresh" button and directly click "Save" button, the old values are displayed again - not what I have input (the new value) just at that time. Does anybody have some solution to save the new value just by clicking the "Save" button only?
Thanks a lot!!
12-22-2008 10:18 AM
Hi,
Your internal table itself is not having the updated data.
In PAI (User command), call the method CHECK_CHANGED_DATA. This method will refresh your internal table with the value available in ALV. Again use REFRESH_TABLE_DISPLAY to display the values in your internal table to the ALV on screen. This method can be called after saving the values.
Thanks,
Lakshmi
12-22-2008 9:12 AM
12-22-2008 9:21 AM
12-22-2008 9:26 AM
Hi,
Please check this link hope it might help you.
http://www.saptechnical .com/Tutorials/ALV/Edit/F4.htm
If this link cannot be posted please delete it.
12-22-2008 9:27 AM
Hi,
Below code will save the changes you made in the screen.
DATA: lv_ref TYPE REF TO cl_gui_alv_grid.
IF ucomm EQ 'SAVE'.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = lv_ref.
CALL METHOD lv_ref->check_changed_data.
ENDIF.
Thanks,
Srilakshmi.
12-22-2008 9:54 AM
Hi, the program was down when I use this method.
it said:
Short text
Zugriff über 'NULL' Objektreferenz nicht möglich.
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_REF_IS_INITIAL', was not
caught in
procedure "OK_CODE_SET" "(FORM)", nor was it propagated by a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
Es wurde versucht mit einer 'NULL' Objektreferenz (zeigt auf 'nichts')
auf eine Komponente zuzugreifen (Variable: "GO_ALV_GRID").
Eine Objektreferenz muß auf ein Objekt (eine Instanz einer Klasse)
zeigen, bevor man sie zum Zugriff auf Komponenten nutzen kann.
Entweder die Referenz wurde noch nie gesetzt, oder sie wurde mit
einer CLEAR Anweisung auf 'NULL' gesetzt.
12-22-2008 10:09 AM
Hi,
In my case i have used the same code which i gave you in my previous thread and it didnt throw me any dump. Just try the below code.
Try using
CREATE OBJECT lv_ref.
after it is declared.
Thanks,
Srilakshmi.
12-22-2008 9:24 AM
Modify your internal table in the event-> AT USER-COMMAND.
case sy-ucomm.
when 'SAVE'.
MODIFY internal table.
perform Display.
Form Display. -> COntains Funtion Module or Method that Displays the ALV
12-22-2008 10:18 AM
Hi,
Your internal table itself is not having the updated data.
In PAI (User command), call the method CHECK_CHANGED_DATA. This method will refresh your internal table with the value available in ALV. Again use REFRESH_TABLE_DISPLAY to display the values in your internal table to the ALV on screen. This method can be called after saving the values.
Thanks,
Lakshmi