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

Update Table fails without Debugger

Former Member
0 Likes
2,632

Hello All,

I am suffering with a strange situation, that as per my requirement.

Scenerio is like.

We need to modify specific record of table /SAPSLL/CUIV in GTS, which get created via VF01 called from R/3, so we had placed the logic to call a new RFC in R/3, just after the Call FM 'RV_INVOICE_DOCUMENT_ADD',  which create a new entry in GTS table.

So outr new RFC has the logic to update the table /SAPSLL/CUIV for newly created record.

Now when we run the VF01, its does everting but doesnt Update the Table record, unless we do a debugging in any side.

means if the execution is being stopped by debugger then only it updates the table in GTS, else it doesnt.

i have tried to use, Call RFC in backgroung,seperate task... also i have tried to use COMMIT work and wait, in GTS side FM.

Please suggest.

Regards,

Nitin

1 ACCEPTED SOLUTION
Read only

former_member209920
Active Participant
0 Likes
2,156

Commit and wait is the only possible soltuion.

Try varying wait time.

It may help

11 REPLIES 11
Read only

Former Member
0 Likes
2,156

Hello All,

Seems nobody has got any idea about this..

Read only

0 Likes
2,156

Hi Nitin

Check the Login Id credentials for the RFC in SM59 for your target system.

The driver program should be executed using the same Login Id.

Regards,

Xineohpi.

Read only

0 Likes
2,156

Nitin,

Such thing occurs due to implicit commit  which occurs by debugging. implicit commit is executed by the system at each step of debugging - when you enter the debugger, when you do f5 f6 f7 f8. Also while doing debugging you provide sufficient time for commit to save the data to db.

I would suggest

1) creat a FM on r3 side. Put a logic say

do 10 times.

* check if the vf01 data is saved to data base  by doing select signle

* if it has saved then call you rfc fm on the other sid and exit.

* if not then wait say 2 seconds?

endo.

2) Call this FM in background task.

3) put proper commit in your RFC fm on GTS side.

See if it helps

Read only

0 Likes
2,156

Read only

0 Likes
2,156

Hi Gaurav,

i have some query over your suggestions that

1. you said to check the VF01 data in R/3 database..why we need this, i am putting my RFC call when the Billing Documnet is just created in R/3 and Updated in GTS as well.

2. doing that in Loop with waiting for seconds... wont it effect the current execution time of VF01 ?, which will definately not acceptable by business.

I did the things with call rfc in background task as seperate unit..with proper commit work and wait in GTS side..but its not working.

Read only

0 Likes
2,156

What credentials are passed to the std RFC?

Can you pass the same credentials of the RFC and check if your update is working and revert.

Read only

0 Likes
2,156

1. I said to check the entry because if further down the vf01 program call if some problem occurs then the update is terminated then even after that you will will end up updating in GTS. You would not like to do that

2) No it won't affect the VF01 processing. Background task runs in separate task.

Did you do a commit work in r/3 side? it is required to trigger the RFC FM.

Read only

former_member404244
Active Contributor
0 Likes
2,156

Hi,

You create  a separate FM and call the required FM in new task. inside the Fm after your required FM you can use commit work. It should work. If still it is not working then go for a BDC (if possible) instead of calling the required function module.

One thing you need to make sure is don't write commit work in the enhancement point , you write it as i said above then there won't be any issue of LUW.

Regards,

Nagaraj

Read only

0 Likes
2,156

Hi Nagaraj,

i tried as u said... i.e created a seperate FM in R/3 and then in that Fm , i called the RFC to GTS, then used the COMMIT WORK AND WAIT at both GTS and and in R/3(after rfc call in the same FM)...but nothing worked...

Also now the debugger is also not updating the table.

Read only

0 Likes
2,156

Hi,

Just a thought, i might be wrong.. after the invoice created in R/3 , don't call anything.. On the other hand in GTS write a program in which call the RFC function module using destinatoion destination name .. Now in R/3 side create a RFC function module and they to pass the invoice details.Now when you call R/3 from RFC function module in GTS using destinantion destination name, you will get the details.. Now update the table with the require information.. However you need to schedule job for the program in GTS .Hope you got my point.

Regards,

Nagaraj

Read only

former_member209920
Active Participant
0 Likes
2,157

Commit and wait is the only possible soltuion.

Try varying wait time.

It may help