‎2020 Dec 10 2:03 PM
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
‎2020 Dec 10 3:18 PM
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.
‎2020 Dec 10 4:29 PM
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.
‎2020 Dec 10 4:32 PM
vaishalisingh, do you set the updated fieldcat with proper method of CL_GUI_ALV_GRID
In PBO, do you manage the refresh?
‎2020 Dec 10 4:45 PM
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
‎2020 Dec 11 2:39 AM
Sandra, I am not refreshing twice, just once in save on PBO. Instantiation of controller is done once in the start of program.
‎2020 Dec 10 7:31 PM
why set_table_for_first_display twice? probably you instantiate your control twice (only the first one is shown). Instead, just refresh.
‎2020 Dec 11 5:25 AM
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.
‎2020 Dec 11 6:26 AM
Bhavya, All the updated data is present, but not displaying.
‎2020 Dec 11 5:51 AM
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.
‎2020 Dec 11 6:26 AM
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.
‎2020 Dec 11 6:35 AM
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 !!