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: 

Refresh problem after call transaction

Former Member
0 Kudos
799

Hi,

I am building a BDC to a transaction and commiting it. When i hit the database, i get the oder values.

I am not using any select query. Selection is done using FM.

When i call the BDC again, its happening perfectly.

Things i have tried.

1. Changed mode to S, A, L - Nothing worked

2. Used wait up to 4 seconds. - Didnt work

Any other pointers???

Regards,

Niyaz

13 REPLIES 13

kesavadas_thekkillath
Active Contributor
0 Kudos
168

Hi Your question is not clear.

Please explain clearly.

0 Kudos
168

Hi,

I have a report program developed using OOPS.

When i click on refresh button, the changes should be updated in database using call transaction method and the entire ALV needs to be refreshed with updated values.

I have coded like below.



When 'REFRESH'.
                                    Perform save_to_database.

PERFORM save_to_database.
...... build BDC...
call transaction 'IW32' using mode 'N' update 'A' messages lt_messages.
if sy-subrc eq 0.
commit work and wait.
endif.

endform.

Now the above code is executed, the ALV is not refreshed with updated value. Where as when i call perform save_to_database again( twice ), the values are refreshed.

Edited by: Niyaz Ahamed on Feb 3, 2010 3:49 PM

0 Kudos
168

Hi,

you have to refresh ALV after performing save_to_database. There are refresh methods for both CL_GUI_ALV_GRID, CL_SALV_TABLE.

Regards,

Adrian

0 Kudos
168

The problem is not with the ALV refresh. The problem is with the Fm which retrives the data, its still returning old values.

I am using FM CY01_EXTERNAL_INTERNFACE.

0 Kudos
168

So set importing parameter RESET_ALL_TABLES_IMP to 'X. Maybe also set FLG_RESET_PROFILES to 'X'. Alternatively call CY01_REFRESH_ALL_TABLES and CY27_INITIALIZE_LIMITED_PLAN after (or before) each call of CY01_EXTERNAL_INTERNFACE.

Adrian

0 Kudos
168

Doesnt work. Any other solutions???

0 Kudos
168

When i Quit the program completely and execute again, it returns the correct data.

Any idea how to refresh the buffers???

0 Kudos
168

It looks like some global variable is still remaining uncleared. I am sorry, but I have no other ideas. Only to debug it by first run and also by second run and find out on which place a program flow differs.

Adrian

0 Kudos
168

Check whether u r clearing & refreshing ur BDCDATA table after your call tranmsaction statemnet.

Former Member
0 Kudos
168

Hi Niyaz,

When we are going for standard transactions the most reliable way to do it is by using a BAPI if available.

If any BAPI is available try using it and see the results.

Hope it helps you,

Regards,

Abhijit G. Borkar

jyotheswar_p2
Active Participant
0 Kudos
168

Hi

After the BDC is sucessfull U have to modify the internal table whihc is dispalyed in the ALV and in the PBO event before dispalying the container Use the follwoing mehtod

CALL METHOD cl_gui_alv_grid->refresh_table_display.

Regards

Jyo

0 Kudos
168

Hi,

Sometimes a normal committ statement doesnt work.

Instead use a BAPI and check.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = wait.

Regards,

Thoufique.

kesavadas_thekkillath
Active Contributor
0 Kudos
168

How are you calling the alv.

can you place the exact structure of code.

saving to database

Displayiung alv.