Application Development 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: 

The values of ALV are not kept

Former Member
0 Kudos

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!!

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

8 REPLIES 8

Former Member
0 Kudos

Hi

Call method REFRESH_TABLE_DISPLAY before saving .

0 Kudos

Hi, when I call it, the old value was displayed again:(

0 Kudos

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.

0 Kudos

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.

0 Kudos

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.

0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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