Application Development and Automation 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: 
Read only

alv refresh issue after save

vaishali_singh
Participant
0 Likes
3,711

Hi,

I have an editable alv . I am editing the value and on save I am passing the right data and saving it to database. afater that in PBO I have changed value of editable column to non editable(edit = ' ') in PBO but on displaying its still showing the old data. I tried using refresh table method before set_table_for_display but its throwing error. Am I missing something ?

Thanks

Vaishali

11 REPLIES 11
Read only

SimoneMilesi
Active Contributor
0 Likes
3,402

How do you change the value? If it's on fieldcat, you have to set the new fieldcat before refresh.

PS.

If you invoke refresh method, you do not need to invoke the set_table_first_display.

Read only

0 Likes
3,402

Initially ALV display is getting called in PBO. In PAI on Save action I am updating database and changing fieldcatalog of editable field to make it non editable. Called refresh table method. After that PBO gets called again and alv is displaying. All values are in place but still the grid displayed is the one before Save action.

Read only

0 Likes
3,402

vaishalisingh, do you set the updated fieldcat with proper method of CL_GUI_ALV_GRID

In PBO, do you manage the refresh?

Read only

0 Likes
3,402

I am just looping the fieldcatalog for that fiedname and changing edit = ‘ ‘.

Refresh table i am calling in save action in PAI only, not in PBO

Read only

0 Likes
3,402

Sandra, I am not refreshing twice, just once in save on PBO. Instantiation of controller is done once in the start of program.

Read only

Sandra_Rossi
Active Contributor
0 Likes
3,402

why set_table_for_first_display twice? probably you instantiate your control twice (only the first one is shown). Instead, just refresh.

Read only

bhavya_bhat
Explorer
0 Likes
3,402

After the data is updated , the database has to be queried before the next ALV display. In PBO, check whether the internal table passed to the method has the latest data. If it does not , then check where the Select Statement (or query to populate the internal table) is placed.

Read only

0 Likes
3,402

Bhavya, All the updated data is present, but not displaying.

Read only

Sandra_Rossi
Active Contributor
0 Likes
3,402

You say somewhere in the comments that "I am not refreshing twice, just once in save on PBO." Well, it's not what I was talking about, but that contradicts what you said in the question: "I tried using refresh table method before set_table_for_display but its throwing error." I supposed that "before" meant that you were calling set_table_for_first_display. I still suppose that after save you call again set_table_for_first_display, hence "twice".

You say "Instantiation of controller is done once in the start of program." In that case, I guess your question "its still showing the old data" doesn't mean that the old data is displayed that that the "edit" property was not reflected. Use SET_FRONTEND_FIELDCATALOG to transfer it.

If it doesn't answer your question, please attach your program as a text file, or just paste all the relevant lines.

Read only

vaishali_singh
Participant
0 Likes
3,402

Sandra, In PAI under Save action I am updating my output table, used the method get_frontend_fieldcatalog, edited fieldcatalog t and then set_frontend_fieldcatalog, then refresh_table_display and then set_table_for_first_display.

After that it goes to PBO where only set_table_for_first_display is placed, and i checked the output table and fieldcatalog evrything is in place. But the editable field is still in edit mode and the other field also not showing updated value. Once I execute the progam again the upated values get displayed.

Read only

vaishali_singh
Participant
0 Likes
3,402

Thanks Guys for your help !! Its resolved. I incorrectly placed my container instantiation in PBO before ALV display. I removed it from PBO and its working fine Now.

Thanks Again !!